# Create a quote (/docs/api/quotes/create-quote)

Freezes a price for a short time. A quote is used by at most one payout.

The operation, from the OpenAPI contract (https://docs.caibopay.app/openapi.json):

```json

{
  "method": "POST",
  "path": "/v1/quotes",
  "description": "Freezes a price for a short time. A quote is used by at most one payout.",
  "operationId": "createQuote",
  "parameters": [
    {
      "$ref": "#/components/parameters/IdempotencyKey"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/QuoteCreate"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Quote"
          }
        }
      },
      "description": "The request was already made: the existing resource is returned.",
      "headers": {
        "Idempotent-Replayed": {
          "schema": {
            "enum": [
              "true"
            ],
            "type": "string"
          }
        }
      }
    },
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Quote"
          }
        }
      },
      "description": "Created"
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "The request is not valid."
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "The API key is missing or not valid."
    },
    "403": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "The API key lacks the required scope."
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "The Idempotency-Key was used with a different request, or the resource is in conflict."
    },
    "422": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "The request is well formed but cannot be carried out."
    },
    "429": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Too many requests."
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "An error on our side. Safe to retry with the same Idempotency-Key."
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Temporarily unavailable or suspended. Safe to retry with the same Idempotency-Key."
    }
  },
  "summary": "Create a quote",
  "tags": [
    "Quotes"
  ],
  "x-required-scope": "write",
  "x-codeSamples": [
    {
      "lang": "js",
      "label": "Node.js",
      "source": "import { Caibo } from \"caibopay\";\n\nconst caibo = new Caibo(process.env.CAIBO_API_KEY);\n\nconst result = await caibo.quotes.create({\n  amount: \"100.00\",\n  amount_side: \"source\",\n  destination_currency: \"PEN\",\n  source_currency: \"USDT\",\n}, { idempotencyKey: \"your-operation-id\" });"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\n\nimport caibopay\n\nclient = caibopay.Client(os.environ[\"CAIBO_API_KEY\"])\n\nresult = client.quotes.create(amount=\"100.00\", amount_side=\"source\", destination_currency=\"PEN\", source_currency=\"USDT\", idempotency_key=\"your-operation-id\")"
    },
    {
      "lang": "go",
      "label": "Go",
      "source": "client, err := caibopay.NewClient(os.Getenv(\"CAIBO_API_KEY\"))\nif err != nil {\n\treturn err\n}\nctx := context.Background()\n\nresult, err := client.Quotes.Create(ctx, &caibopay.QuoteCreate{\n\tAmount: \"100.00\",\n\tAmountSide: \"source\",\n\tDestinationCurrency: \"PEN\",\n\tSourceCurrency: \"USDT\",\n}, caibopay.WithIdempotencyKey(\"your-operation-id\"))\nif err != nil {\n\treturn err\n}\nfmt.Println(result)"
    }
  ]
}

```