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

# Initiate swap (step 1/2)

> Start a swap using a quotation id. Scope: `crypto:write`. Requires `Idempotency-Key`.

> [!NOTE]
>
> This product may be disabled on your deployment. Contact [support@sendpadi.com](mailto:support@sendpadi.com) if calls return unavailable.

> [!NOTE]
>
> Live API key required for this endpoint.


## OpenAPI

````yaml POST /api/v1/merchant/crypto/swap
openapi: 3.1.0
info:
  title: SendPadi Merchant API
  version: 1.0.0
  description: >-
    Merchant REST API. Authenticate with HMAC headers (`X-Api-Key`,
    `X-Timestamp`, `X-Signature`). Generate playground headers with [Sign
    requests (playground)](/guides/sign-requests).
servers:
  - url: https://api.sendpadi.com
    description: Production (test + live keys)
security: []
paths:
  /api/v1/merchant/crypto/swap:
    post:
      tags:
        - crypto
      summary: Initiate swap (step 1/2)
      description: >-
        Start a swap using a quotation id. **Scope:** `crypto:write`. Requires
        `Idempotency-Key` on this write.
      operationId: api-reference_crypto_swap
      parameters:
        - name: X-Timestamp
          in: header
          required: true
          description: Unix time in seconds
          schema:
            type: string
        - name: X-Signature
          in: header
          required: true
          description: HMAC-SHA256 signature
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          description: UUID. Required on money-moving writes.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                quotationId:
                  type: string
                fromCurrency:
                  type: string
                toCurrency:
                  type: string
                fromAmount:
                  type: integer
              required:
                - quotationId
                - fromCurrency
                - toCurrency
                - fromAmount
            example:
              quotationId: qt_swap_001
              fromCurrency: usdt
              toCurrency: btc
              fromAmount: 100
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                success: true
                message: OK
                data:
                  intentId: intent_swap
                  operation: swap
                  confirmationToken: tok_secret_xyz
                  status: pending_confirmation
              examples:
                success:
                  summary: Success
                  value:
                    success: true
                    message: OK
                    data:
                      intentId: intent_swap
                      operation: swap
                      confirmationToken: tok_secret_xyz
                      status: pending_confirmation
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key id (sp_test_… / sp_live_…)

````

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