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

> Create a new peer-to-peer asset swap offer on Cardano using managed smart contracts for trustless token exchanges.

# Create an offer



## OpenAPI

````yaml cardano/managed-contracts-api/openapi.json post /contracts/directSwap/createOffer
openapi: 3.0.3
info:
  title: Cardano - Managed Contracts API
  description: https://docs.gomaestro.org/getting-started
  contact:
    name: Maestro
    email: info@gomaestro.org
    url: https://gomaestro.org/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.txt
  version: v1.9.0
servers:
  - url: https://mainnet.gomaestro-api.org/v1
    description: Cardano Mainnet
  - url: https://preprod.gomaestro-api.org/v1
    description: Cardano Preprod
  - url: https://preview.gomaestro-api.org/v1
    description: Cardano Preview
security:
  - api-key: []
paths:
  /contracts/directSwap/createOffer:
    post:
      tags:
        - Direct Swap
      summary: Create an offer
      description: Create a new offer for direct swap
      operationId: dswap_create_offer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOfferRequest'
      responses:
        '200':
          description: Offer created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '400':
          description: Bad Request. Invalid request body provided.
components:
  schemas:
    CreateOfferRequest:
      type: object
      properties:
        sender:
          type: string
          description: Sender's bech32 address
        offer:
          $ref: '#/components/schemas/Assets'
          description: Offer assets
        toBuy:
          $ref: '#/components/schemas/Assets'
          description: Assets to buy
      required:
        - sender
        - offer
        - toBuy
    Transaction:
      type: object
      description: Unsigned transaction
      properties:
        cbor_hex:
          type: string
          description: CBOR hexadecimal representation of the transaction
        tx_hash:
          type: string
          description: Transaction hash
      required:
        - cbor_hex
        - tx_hash
    Assets:
      type: object
      additionalProperties:
        type: string
      example:
        policyId1assetName1: '123'
        policyId2assetName2: '456'
        policyId3assetName3: '789'
      description: A record with string keys and bigint values
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: api-key
      description: Project API Key

````