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

# Update Sell and Pay transaction

> Updates an existing Sell and Pay transaction to complete or modify its details. Use this endpoint to add missing required fields (depositCurrency, depositNetwork, refundAddress) or update the payment amount. When all required fields are provided, the transaction status will automatically change from INCOMPLETE to PENDING, making it ready for execution.



## OpenAPI

````yaml ramps-api/openapi.json PUT /api/v1/sellAndPays/{sell_and_pay_id}/
openapi: 3.1.0
info:
  title: Ripio Ramp API
  version: v1
  description: >-
    API for Ripio ramp services, enabling partners to integrate On-Ramp,
    Off-Ramp, customer management, KYC processes, and other financial
    functionalities. This API is RESTful, uses JSON for requests and responses,
    and standard HTTP status codes. This document is based on the
    'onramp-api.pdf' provided and aims to be compliant with OpenAPI
    Specification v3.1.0. The PDF indicates that the API documentation is a
    draft and subject to change.
servers:
  - url: https://skala-sandbox.ripio.com
    description: Sandbox environment
  - url: https://skala.ripio.com
    description: Production environment
security:
  - BearerToken: []
tags:
  - name: Authentication
    description: Operations related to API authentication and authorization.
  - name: Support Tickets
    description: >-
      Operations for raising and tracking customer support tickets with Ripio's
      support team. This feature must be enabled for your account by the Ripio
      team.
  - name: Customers
    description: Operations related to customer management.
  - name: KYC
    description: Operations related to Know Your Customer processes.
  - name: Fiat Accounts
    description: Operations related to managing fiat accounts and their requirements.
  - name: Quotes
    description: Operations related to obtaining and managing conversion quotes.
  - name: On-Ramp
    description: Operations related to fiat-to-crypto (on-ramp) processes.
  - name: Off-Ramp
    description: Operations related to crypto-to-fiat (off-ramp) processes.
  - name: Transactions
    description: Operations related to listing and managing all transaction types.
  - name: Networks
    description: >-
      Operations related to retrieving available deposit and withdrawal
      networks.
  - name: Rates
    description: Operations related to retrieving market rates.
  - name: Transaction Limits
    description: >-
      Operations related to retrieving per-transaction limits by currency and
      ramp operation.
  - name: Sandbox
    description: Operations specific to the sandbox environment for testing purposes.
  - name: Webhooks
    description: Webhook event notifications from Ripio Ramp API.
  - name: Sell and Pay
    description: >-
      Endpoints for managing Sell and Pay transactions, which allow customers to
      convert cryptocurrency to fiat currency and pay merchants via QR codes
paths:
  /api/v1/sellAndPays/{sell_and_pay_id}/:
    put:
      tags:
        - Sell and Pay
      summary: Update Sell and Pay transaction
      description: >-
        Updates an existing Sell and Pay transaction to complete or modify its
        details. Use this endpoint to add missing required fields
        (depositCurrency, depositNetwork, refundAddress) or update the payment
        amount. When all required fields are provided, the transaction status
        will automatically change from INCOMPLETE to PENDING, making it ready
        for execution.
      operationId: updateSellAndPay
      parameters:
        - name: sell_and_pay_id
          in: path
          required: true
          description: Unique identifier of the Sell and Pay transaction to update
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SellAndPayUpdateRequest'
      responses:
        '200':
          description: Sell and Pay transaction successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellAndPayResponse'
        '400':
          description: >-
            Bad Request - e.g., invalid request data, validation error, or the
            amount is outside the account's SELL limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                AmountBelowMinSellLimit:
                  summary: Amount below the minimum SELL limit
                  value:
                    code: 20052
                    type: SellAndPayAmountBelowMinSellLimitException
                    detail:
                      message: The amount is below the minimum SELL limit.
                    status: 400
                AmountAboveMaxSellLimit:
                  summary: Amount above the maximum SELL limit
                  value:
                    code: 20053
                    type: SellAndPayAmountAboveMaxSellLimitException
                    detail:
                      message: The amount is above the maximum SELL limit.
                    status: 400
        '401':
          description: Unauthorized - Invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 40001
                type: NotAuthenticated
                detail:
                  message: Authentication credentials were not provided.
                  code: not_authenticated
                status: 401
        '403':
          description: >-
            Forbidden - QR payments are not enabled for this account. Every Sell
            and Pay endpoint requires QR payments to be enabled; contact Ripio
            to enable it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 40003
                type: QrPaymentsNotEnabledException
                detail:
                  message: QR payments are not enabled for this account.
                status: 403
        '404':
          description: Not Found - e.g., Sell and Pay transaction not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 40016
                type: SellAndPayNotFoundException
                detail:
                  message: Sell and Pay not found.
                status: 404
components:
  schemas:
    SellAndPayUpdateRequest:
      type: object
      properties:
        amount:
          type: string
          pattern: ^\d+(\.\d{1,8})?$
          description: >-
            Updated payment amount in fiat currency. Must be a positive decimal
            number with up to 8 decimal places. This represents the amount to be
            paid to the merchant.
          example: '10000.50'
        depositCurrency:
          type: string
          maxLength: 10
          description: >-
            Updated cryptocurrency for deposit (e.g., BTC, ETH, USDC). Changing
            this may affect the deposit address and exchange rate.
          example: USDC
        depositNetwork:
          type: string
          maxLength: 128
          description: >-
            Updated blockchain network for cryptocurrency deposit (e.g.,
            ETHEREUM, POLYGON). Must be compatible with the specified deposit
            currency.
          example: POLYGON
        refundAddress:
          type: string
          maxLength: 255
          description: >-
            Updated cryptocurrency refund address. Should be a valid address on
            the deposit network where funds will be returned in case of
            transaction failure.
          example: '0x4e88BBeFF059BDDF5BF90ee0816E86eDf4214b32'
      description: >-
        Request body for updating a Sell and Pay transaction. All fields are
        optional, allowing partial updates to the transaction details.
    SellAndPayResponse:
      type: object
      properties:
        id:
          type: string
          description: >-
            Unique identifier for the Sell and Pay transaction assigned by the
            B2B Service
          example: a3b2c1d0-1234-5678-90ab-cdef12345678
        createdAt:
          type: string
          format: date-time
          description: >-
            Timestamp when the Sell and Pay transaction was created in ISO 8601
            format
          example: '2024-01-26T12:45:00.078230Z'
        expiresAt:
          type: string
          format: date-time
          description: >-
            Timestamp when the transaction will expire if not completed in ISO
            8601 format. After expiration, cryptocurrency deposits will not be
            processed.
          example: '2024-01-26T13:45:00.078230Z'
        customerId:
          type: string
          format: uuid
          description: Unique identifier of the customer who initiated the transaction
          example: b6cecc1f-c90d-424b-adaa-c82b780696c1
        trade:
          anyOf:
            - $ref: '#/components/schemas/SellAndPayTrade'
            - type: 'null'
          description: >-
            Trade execution details. This will be null until the trade is
            executed and contains information about the cryptocurrency-to-fiat
            conversion.
        paymentOrder:
          anyOf:
            - $ref: '#/components/schemas/SellAndPayPaymentOrder'
            - type: 'null'
          description: >-
            Payment order details for the merchant payment. Contains information
            about the QR code payment and merchant details.
        amount:
          type: string
          description: Payment amount in fiat currency to be paid to the merchant
          example: '10000.50'
        cryptoAmount:
          type: string
          description: >-
            Amount of cryptocurrency required to complete the payment,
            calculated based on current exchange rates and fees
          example: '10.25'
        paymentCurrency:
          type: string
          description: Fiat currency code for the payment (e.g., ARS, MXN, USD)
          example: ARS
        depositCurrency:
          type: string
          description: Cryptocurrency code for the deposit (e.g., BTC, ETH, USDC)
          example: USDC
        depositNetwork:
          type: string
          description: >-
            Blockchain network identifier for the cryptocurrency deposit (e.g.,
            ETHEREUM, POLYGON, BITCOIN)
          example: ETHEREUM
        depositAddress:
          type: string
          description: >-
            Cryptocurrency address where the customer should send the deposit.
            This is a unique address generated for this transaction.
          example: '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D'
        cryptoDeposit:
          anyOf:
            - $ref: '#/components/schemas/SellAndPayCryptoDeposit'
            - type: 'null'
          description: >-
            Information about the cryptocurrency deposit made by the customer.
            This will be null until a deposit is detected on the blockchain.
        status:
          type: string
          enum:
            - INCOMPLETE
            - PENDING
            - WAITING_DEPOSIT
            - RECEIVED_DEPOSIT
            - CONFIRMED_DEPOSIT
            - TRADE_COMPLETED
            - QR_EXECUTION_PENDING
            - COMPLETED
            - CANCELED
            - REFUND_PENDING
            - REFUNDED
          description: >-
            Current status of the Sell and Pay transaction. INCOMPLETE: missing
            required fields. PENDING: ready to execute. WAITING_DEPOSIT:
            executed and ready to receive crypto deposit. RECEIVED_DEPOSIT:
            crypto deposit detected on blockchain. CONFIRMED_DEPOSIT: crypto
            deposit confirmed. TRADE_COMPLETED: cryptocurrency successfully
            converted to fiat. QR_EXECUTION_PENDING: preparing payment to
            merchant. COMPLETED: payment successfully made to merchant.
            CANCELED: transaction cancelled. REFUND_PENDING: refund being
            processed. REFUNDED: funds refunded to customer.
          example: PENDING
        refundAddress:
          type:
            - string
            - 'null'
          description: >-
            Cryptocurrency address for refunds in case of transaction failure or
            cancellation
        refundTxnHash:
          type:
            - string
            - 'null'
          description: >-
            Transaction hash for the refund transaction on the blockchain.
            Present when a refund has been processed.
          example: 0xdef789abc456...
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Application-specific error code.
        type:
          type: string
          description: Type of error or exception.
        detail:
          type: object
          properties:
            message:
              type: string
              description: Detailed error message.
          additionalProperties: true
        status:
          type: integer
          description: HTTP status code.
      required:
        - code
        - type
        - detail
        - status
    SellAndPayTrade:
      type: object
      description: Details of the cryptocurrency-to-fiat trade execution
      properties:
        id:
          type: string
          description: Unique identifier for the trade
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the trade was executed
        externalRef:
          type: string
          description: External reference from the original transaction request
        customerId:
          type: string
          description: Customer identifier (end user) for the trade
        quoteId:
          type: string
          description: Identifier of the quote used for this trade
        txnId:
          type: string
          description: Transaction identifier from the B2B Service
        baseAsset:
          type: string
          description: Base asset in the trade pair (cryptocurrency)
        quoteAsset:
          type: string
          description: Quote asset in the trade pair (fiat currency)
        baseAmount:
          type: string
          description: Amount of base asset (cryptocurrency) used in the trade
        quoteAmount:
          type: string
          description: Amount of quote asset (fiat currency) received from the trade
        rate:
          type: string
          description: Exchange rate applied to the trade including all fees and spreads
        marketRate:
          type: string
          description: Market exchange rate at the time of trade execution
        chargedFee:
          type: string
          description: Total fee charged for the trade in fiat currency
        cryptoChargedFee:
          type: string
          description: Fee charged in cryptocurrency
        deferredChargedFee:
          type: string
          description: Deferred fee amount that may be charged later
        feeChargedInFiat:
          type: string
          description: Total fee amount charged in fiat currency
    SellAndPayPaymentOrder:
      type: object
      description: Details of the payment order to the merchant
      properties:
        id:
          type: string
          description: Unique identifier for the payment order
        customerId:
          type: string
          description: Customer identifier (end user) making the payment
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the payment order was created
        merchant:
          type: string
          description: Merchant identifier or name receiving the payment
        qrCode:
          type: string
          description: Original QR code data containing payment information
        amount:
          type: string
          description: Payment amount in fiat currency
        currency:
          type: string
          description: Fiat currency code for the payment
        providerTxnId:
          type:
            - string
            - 'null'
          description: >-
            Transaction identifier from the payment provider. Will be null until
            the payment is processed.
    SellAndPayCryptoDeposit:
      type: object
      description: Information about the cryptocurrency deposit received from the customer
      properties:
        id:
          type: string
          description: Unique identifier for the crypto deposit record
        txnId:
          type: string
          description: Transaction identifier in the B2B Service
        hash:
          type: string
          description: Blockchain transaction hash for the deposit
        currencyCode:
          type: string
          description: Cryptocurrency code of the deposited asset (e.g., BTC, ETH)
        addressDestination:
          type: string
          description: Destination address that received the cryptocurrency deposit
        confirmationDate:
          type: string
          format: date-time
          description: Timestamp when the deposit was confirmed on the blockchain
        amount:
          type: string
          description: Amount of cryptocurrency deposited
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the deposit record was created
        customerId:
          type: string
          description: Customer identifier (end user) who made the deposit
        status:
          type: string
          description: Status of the crypto deposit (e.g., PENDING, CONFIRMED, PROCESSING)
        network:
          type: string
          description: >-
            Blockchain network where the deposit was made (e.g., ETHEREUM,
            POLYGON)
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Access token obtained via
        [/oauth2/token/](/ramps-api/authentication/acquire-access-token). Use as
        `Authorization: Bearer <access_token>`.

````