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

# Make a swap with a locked aggregator rate



## OpenAPI

````yaml /openapi.json post /exchange/fx/convert
openapi: 3.0.0
info:
  title: Juicyway API
  version: 1.0.0
servers: []
security: []
tags:
  - description: Payment APIs
    name: payments
  - description: Payouts APIs
    name: payouts
  - description: Exchange APIs
    name: exchange
  - description: Wallets APIs
    name: wallets
paths:
  /exchange/fx/convert:
    post:
      tags:
        - Swaps
      summary: Make a swap with a locked aggregator rate
      operationId: Exchange.Web.SwapController.swap_with_aggregator_rate
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AggregatorRateSwapParams'
        description: Aggregator Rate Swap params
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwapResponse'
          description: Swap Details
        '400':
          $ref: '#/components/responses/bad_request'
        '409':
          $ref: '#/components/responses/conflict'
      callbacks: {}
components:
  schemas:
    AggregatorRateSwapParams:
      description: Aggregator rate swap params
      example:
        amount: 1000
        rate_id: 2f939fe5-fb7b-4234-8b73-761a848d13af
        reference: 6b35c97f-99e3-4310-af92-2bb0404cfa5a
        source_currency: USD
        target_currency: NGN
      properties:
        amount:
          description: Amount, in minor units
          type: integer
        rate_id:
          description: Locked aggregator swap rate Id
          type: string
        reference:
          description: Reference
          type: string
        source_currency:
          description: Source currency
          type: string
        target_currency:
          description: Target currency
          type: string
      required:
        - rate_id
        - source_currency
        - target_currency
        - amount
      title: AggregatorRateSwapParams
      type: object
    SwapResponse:
      description: Response schema for swap
      properties:
        data:
          $ref: '#/components/schemas/SwapDetails'
      title: SwapResponse
      type: object
    SwapDetails:
      description: Swap details
      example:
        correlation_id: 7da742ea-a1bc-11ee-b907-560f156a658b
        created_at: '2021-01-01T00:00:00Z'
        customer:
          email: customer@email.com
          id: '1'
          name: User 1
          type: user
        id: 7da8e726-a1bc-11ee-80cf-560f156a658b
        provider:
          email: provider@email.com
          id: '1'
          name: Provider 1
          type: provider
        source_amount:
          amount: 1
          currency: USD
        status: success
        symbol: USD-NGN
        target_amount:
          amount: 1000
          currency: NGN
        updated_at: '2021-01-01T00:00:00Z'
      properties:
        client_reference:
          description: Reference
          nullable: true
          type: string
        correlation_id:
          description: Correlation ID
          type: string
        created_at:
          description: Creation timestamp
          format: date-time
          type: string
        customer:
          $ref: '#/components/schemas/Profile'
        fee_amount:
          description: Fee Amount
          type: number
        fee_currency:
          description: Fee Currency
          type: string
        id:
          description: Id
          type: string
        provider:
          $ref: '#/components/schemas/Profile'
        source_amount:
          description: Source Amount
          type: number
        source_currency:
          description: Source Currency
          type: string
        status:
          enum:
            - pending
            - success
            - failed
          type: string
        symbol:
          description: Currency pair
          type: string
        target_amount:
          description: Target Amount
          type: number
        target_currency:
          description: Target Currency
          type: string
        updated_at:
          description: Update timestamp
          format: date-time
          type: string
      title: SwapDetails
      type: object
    Profile:
      description: Profile Details
      example:
        email: customer@email.com
        id: '1'
        name: User 1
        type: user
      properties:
        email:
          description: Provider email
          nullable: true
          type: string
        id:
          description: Provider ID
          type: string
        name:
          description: Provider name
          nullable: true
          type: string
        type:
          description: Provider type
          type: string
      title: Profile
      type: object
  responses:
    bad_request:
      description: Bad Request
    conflict:
      description: Conflict

````