{
  "openapi": "3.0.3",
  "info": {
    "title": "RFQ API",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://api.prod.polymarketexchange.com",
      "description": "Production server"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "RFQs",
      "description": "Read and manage combo RFQs and quotes."
    }
  ],
  "paths": {
    "/v1/rfqs": {
      "get": {
        "summary": "Get RFQs",
        "description": "Returns RFQs matching the query filters.",
        "operationId": "RFQAPI_GetRFQs",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1GetRFQsResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rfqId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "RFQ_STATUS_OPEN",
                "RFQ_STATUS_CLOSED"
              ]
            }
          },
          {
            "name": "userFilter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "USER_FILTER_SELF"
              ]
            }
          }
        ],
        "tags": [
          "RFQs"
        ]
      },
      "post": {
        "summary": "Create RFQ",
        "description": "Creates a combo RFQ.",
        "operationId": "RFQAPI_CreateRFQ",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1CreateRFQResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/v1CreateRFQRequest"
              }
            }
          },
          "required": true
        },
        "tags": [
          "RFQs"
        ]
      }
    },
    "/v1/rfqs/quotes": {
      "get": {
        "summary": "Get quotes",
        "description": "Returns quotes matching the query filters.",
        "operationId": "RFQAPI_GetQuotes",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1GetQuotesResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quoteId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rfqId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "QUOTE_STATUS_ACTIVE",
                "QUOTE_STATUS_CONFIRMED",
                "QUOTE_STATUS_DELETED",
                "QUOTE_STATUS_ACCEPTED",
                "QUOTE_STATUS_EXECUTED"
              ]
            }
          },
          {
            "name": "userFilter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "USER_FILTER_SELF"
              ]
            }
          },
          {
            "name": "rfqUserFilter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "USER_FILTER_SELF"
              ]
            }
          }
        ],
        "tags": [
          "RFQs"
        ]
      },
      "post": {
        "summary": "Create quote",
        "description": "Creates a quote for an RFQ.",
        "operationId": "RFQAPI_CreateQuote",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1CreateQuoteResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/v1CreateQuoteRequest"
              }
            }
          },
          "required": true
        },
        "tags": [
          "RFQs"
        ]
      }
    },
    "/v1/rfqs/user-id": {
      "get": {
        "summary": "Get RFQ user ID",
        "description": "Returns the public RFQ user ID for the authenticated participant.",
        "operationId": "RFQAPI_GetRFQUserID",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1GetRFQUserIDResponse"
                }
              }
            }
          }
        },
        "tags": [
          "RFQs"
        ]
      }
    },
    "/v1/rfqs/{rfqId}": {
      "delete": {
        "summary": "Delete RFQ",
        "description": "Closes an open RFQ.",
        "operationId": "RFQAPI_DeleteRFQ",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1DeleteRFQResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "rfqId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "RFQs"
        ]
      }
    },
    "/v1/rfqs/{rfqId}/quotes/{quoteId}": {
      "delete": {
        "summary": "Delete quote",
        "description": "Deletes a quote so it can no longer be accepted.",
        "operationId": "RFQAPI_DeleteQuote",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1DeleteQuoteResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "rfqId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "RFQs"
        ]
      }
    },
    "/v1/rfqs/{rfqId}/quotes/{quoteId}/accept": {
      "put": {
        "summary": "Accept quote",
        "description": "Accepts one side of a quote.",
        "operationId": "RFQAPI_AcceptQuote",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1AcceptQuoteResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "rfqId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RFQAPIAcceptQuoteBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "RFQs"
        ]
      }
    },
    "/v1/rfqs/{rfqId}/quotes/{quoteId}/confirm": {
      "put": {
        "summary": "Confirm quote",
        "description": "Confirms an accepted quote during last look.",
        "operationId": "RFQAPI_ConfirmQuote",
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/v1ConfirmQuoteResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "rfqId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RFQAPIConfirmQuoteBody"
              }
            }
          },
          "required": true
        },
        "tags": [
          "RFQs"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "RFQAPIAcceptQuoteBody": {
        "type": "object",
        "properties": {
          "acceptedSide": {
            "$ref": "#/components/schemas/v1Side"
          }
        },
        "required": [
          "acceptedSide"
        ]
      },
      "RFQAPIConfirmQuoteBody": {
        "type": "object"
      },
      "v1AcceptQuoteResponse": {
        "type": "object"
      },
      "v1ConfirmQuoteResponse": {
        "type": "object"
      },
      "v1CreateQuoteRequest": {
        "type": "object",
        "properties": {
          "rfqId": {
            "type": "string"
          },
          "buyPrice": {
            "type": "string",
            "description": "Price offered for a requester BUY order; the quote creator takes SELL."
          },
          "sellPrice": {
            "type": "string",
            "description": "Price offered for a requester SELL order; the quote creator takes BUY."
          },
          "restRemainder": {
            "type": "boolean"
          },
          "postOnly": {
            "type": "boolean"
          },
          "account": {
            "type": "string"
          }
        },
        "required": [
          "rfqId",
          "buyPrice",
          "sellPrice",
          "restRemainder",
          "account"
        ]
      },
      "v1CreateQuoteResponse": {
        "type": "object",
        "properties": {
          "quoteId": {
            "type": "string"
          }
        }
      },
      "v1CreateRFQRequest": {
        "type": "object",
        "properties": {
          "qtyDecimal": {
            "type": "string"
          },
          "cashOrderQty": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "restRemainder": {
            "type": "boolean"
          },
          "account": {
            "type": "string"
          }
        },
        "required": [
          "symbol",
          "restRemainder",
          "account"
        ],
        "oneOf": [
          {
            "required": [
              "qtyDecimal"
            ]
          },
          {
            "required": [
              "cashOrderQty"
            ]
          }
        ]
      },
      "v1CreateRFQResponse": {
        "type": "object",
        "properties": {
          "rfqId": {
            "type": "string"
          }
        }
      },
      "v1DeleteQuoteResponse": {
        "type": "object"
      },
      "v1DeleteRFQResponse": {
        "type": "object"
      },
      "v1GetQuotesResponse": {
        "type": "object",
        "properties": {
          "quotes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/v1Quote"
            }
          },
          "cursor": {
            "type": "string"
          }
        }
      },
      "v1GetRFQUserIDResponse": {
        "type": "object",
        "properties": {
          "rfqUserId": {
            "type": "string"
          }
        }
      },
      "v1GetRFQsResponse": {
        "type": "object",
        "properties": {
          "rfqs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/v1RFQ"
            }
          },
          "cursor": {
            "type": "string"
          }
        }
      },
      "v1Quote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "rfqId": {
            "type": "string"
          },
          "creatorRfqUserId": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/v1QuoteStatus"
          },
          "createdTime": {
            "type": "string",
            "format": "date-time"
          },
          "buyPrice": {
            "type": "string",
            "description": "Price offered for a requester BUY order; the quote creator takes SELL."
          },
          "sellPrice": {
            "type": "string",
            "description": "Price offered for a requester SELL order; the quote creator takes BUY."
          },
          "restRemainder": {
            "type": "boolean"
          },
          "postOnly": {
            "type": "boolean"
          },
          "rfqCreatorUserId": {
            "type": "string"
          },
          "rfqCashOrderQty": {
            "type": "string",
            "nullable": true
          },
          "buyQtyDecimal": {
            "type": "string"
          },
          "sellQtyDecimal": {
            "type": "string"
          },
          "updatedTime": {
            "type": "string",
            "format": "date-time"
          },
          "acceptedSide": {
            "$ref": "#/components/schemas/v1Side"
          },
          "acceptedTime": {
            "type": "string",
            "format": "date-time"
          },
          "confirmedTime": {
            "type": "string",
            "format": "date-time"
          },
          "confirmationDeadline": {
            "type": "string",
            "format": "date-time"
          },
          "executionDeadline": {
            "type": "string",
            "format": "date-time",
            "description": "Scheduled time for paired requester and quoter order submission."
          },
          "executedTime": {
            "type": "string",
            "format": "date-time",
            "description": "Durable execution-state timestamp."
          },
          "rfqCreatorOrderId": {
            "type": "string",
            "description": "Requester's exchange order ID. Visible to both requester and quoter when present.",
            "nullable": true
          },
          "creatorOrderId": {
            "type": "string",
            "description": "Quoter's exchange order ID. Visible to both requester and quoter when present.",
            "nullable": true
          }
        }
      },
      "v1QuoteStatus": {
        "type": "string",
        "enum": [
          "QUOTE_STATUS_ACTIVE",
          "QUOTE_STATUS_CONFIRMED",
          "QUOTE_STATUS_DELETED",
          "QUOTE_STATUS_ACCEPTED",
          "QUOTE_STATUS_EXECUTED"
        ]
      },
      "v1RFQ": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "qtyDecimal": {
            "type": "string",
            "nullable": true
          },
          "cashOrderQty": {
            "type": "string",
            "nullable": true
          },
          "symbol": {
            "type": "string"
          },
          "rfqCreatorUserId": {
            "type": "string"
          },
          "createdTime": {
            "type": "string",
            "format": "date-time"
          },
          "restRemainder": {
            "type": "boolean"
          },
          "status": {
            "$ref": "#/components/schemas/v1RFQStatus"
          },
          "updatedTime": {
            "type": "string",
            "format": "date-time"
          },
          "comboLegs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/v1RFQComboLeg"
            }
          }
        }
      },
      "v1RFQComboLeg": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "side": {
            "$ref": "#/components/schemas/v1Side"
          },
          "settlementPrice": {
            "type": "string",
            "description": "Raw YES/LONG settlement normalized to [0,1].\nAbsent until a valid terminal settlement has been projected.",
            "nullable": true
          }
        },
        "required": [
          "symbol",
          "side"
        ]
      },
      "v1RFQStatus": {
        "type": "string",
        "enum": [
          "RFQ_STATUS_OPEN",
          "RFQ_STATUS_CLOSED"
        ]
      },
      "v1Side": {
        "type": "string",
        "enum": [
          "SIDE_BUY",
          "SIDE_SELL"
        ],
        "description": "Side indicates the side of an Order."
      }
    }
  }
}
