{
  "openapi": "3.1.0",
  "info": {
    "title": "iQuote API",
    "version": "1.0.0",
    "summary": "Customers, quotes, invoices, payments and webhooks for iQuote businesses.",
    "description": "Full guide with examples: https://i-quote.app/developers\n\nAuthenticate with `Authorization: Bearer <token>`: an OAuth access token (`iqat_...`, from \"Connect with iQuote\") or an API key (`iqk_...`, Settings -> Developers). Passwords and iQuote session tokens are never accepted.\n\nAPI access needs a business on Pro, Multi-Business, Enterprise, Infinity, and the connected user must be an owner or admin of it. Every call runs as that user, under the same rules as the app.\n\nAn OAuth connection can cover one or several businesses, chosen by the user on the consent page. Name the business per request with the `IQuote-Business` header (optional when only one is connected). API keys belong to one business.\n\nRate limits: 120 requests per minute per credential and 600 per minute per business (429 with Retry-After). Lists are cursor-paginated: `limit` 1-100 (default 25), `cursor` = `next_cursor`. Writes accept an `Idempotency-Key` header, replayed for 24 hours.",
    "contact": {
      "name": "iQuote support",
      "email": "support@i-quote.app",
      "url": "https://i-quote.app/developers"
    },
    "termsOfService": "https://i-quote.app/terms"
  },
  "externalDocs": {
    "description": "iQuote developer documentation",
    "url": "https://i-quote.app/developers"
  },
  "servers": [
    {
      "url": "https://i-quote.app/api/v1",
      "description": "Production (HTTPS only)"
    }
  ],
  "security": [
    {
      "oauth2": []
    },
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Credential and businesses",
      "description": "Who the credential is, what it may do, and which businesses it reaches. Neither endpoint needs a scope or the IQuote-Business header."
    },
    {
      "name": "Customers",
      "description": "The same rules as the customer form in the app: one customer per email per business, and a customer with quotes, invoices or payments cannot be deleted."
    },
    {
      "name": "Quotes",
      "description": "Quotes are created as drafts, numbered and totalled like the app does. Sending emails the customer from the business, in its branding."
    },
    {
      "name": "Invoices",
      "description": "Invoices can be edited until money moves on them. Payments recorded by hand, refunds and voids follow the app's money rules."
    },
    {
      "name": "Payments",
      "description": "Money received: card payments through Stripe and payments recorded by hand."
    },
    {
      "name": "Reports",
      "description": "Money per currency, never added across currencies."
    },
    {
      "name": "Webhook endpoints",
      "description": "Up to 10 endpoints per business. The signing secret is returned only when an endpoint is created and when its secret is rotated. Through the API an app or key sees and manages only the endpoints it created, may only subscribe to events it can read (customer.* needs customers:read, quote.* quotes:read, invoice.* invoices:read, payment.* payments:read; * needs all four), and its endpoints are disabled when the connection or key is revoked. Endpoints added in Settings belong to the business."
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "getMe",
        "tags": [
          "Credential and businesses"
        ],
        "summary": "Describe this credential",
        "description": "Credential type (OAuth access token or API key), the user it acts as, its scopes and the business ids it is connected to.\n\nNo scope needed.",
        "parameters": [],
        "security": [
          {
            "oauth2": []
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Describe this credential",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-me"
        }
      }
    },
    "/businesses": {
      "get": {
        "operationId": "getBusinesses",
        "tags": [
          "Credential and businesses"
        ],
        "summary": "List connected businesses",
        "description": "Every business this credential is connected to, with the user's role, the plan, and whether the API can be used on it right now (api_access, and api_access_error when not).\n\nNo scope needed.",
        "parameters": [],
        "security": [
          {
            "oauth2": []
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "List connected businesses",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-businesses"
        }
      }
    },
    "/customers": {
      "get": {
        "operationId": "getCustomers",
        "tags": [
          "Customers"
        ],
        "summary": "List customers",
        "description": "Newest first.\n\nScope: `customers:read`.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1-100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Exact email (case-insensitive).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "external_id",
            "in": "query",
            "required": false,
            "description": "Exact external_id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "customers:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "List customers",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-customers"
        },
        "x-iquote-scope": "customers:read"
      },
      "post": {
        "operationId": "postCustomers",
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer",
        "description": "Scope: `customers:write`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "customers:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Create a customer",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-customers"
        },
        "x-iquote-scope": "customers:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreate"
              }
            }
          }
        }
      }
    },
    "/customers/bulk_upsert": {
      "post": {
        "operationId": "postCustomersBulkUpsert",
        "tags": [
          "Customers"
        ],
        "summary": "Create or update up to 100 customers",
        "description": "Rows are matched by external_id, then email (match_on), updated when matched and created otherwise. One result per row, in order; a bad row does not stop the others.\n\nScope: `customers:write`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "customers:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Create or update up to 100 customers",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-customers-bulk-upsert"
        },
        "x-iquote-scope": "customers:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerBulkUpsert"
              }
            }
          }
        }
      }
    },
    "/customers/{id}": {
      "get": {
        "operationId": "getCustomersId",
        "tags": [
          "Customers"
        ],
        "summary": "Retrieve a customer",
        "description": "Scope: `customers:read`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "customers:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a customer",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-customers-id"
        },
        "x-iquote-scope": "customers:read"
      },
      "patch": {
        "operationId": "patchCustomersId",
        "tags": [
          "Customers"
        ],
        "summary": "Update a customer",
        "description": "Scope: `customers:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "customers:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Update a customer",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#patch-customers-id"
        },
        "x-iquote-scope": "customers:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpdate"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomersId",
        "tags": [
          "Customers"
        ],
        "summary": "Delete a customer",
        "description": "Refused (409 customer_has_history) when the customer has quotes, invoices or payments.\n\nScope: `customers:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "customers:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a customer",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#delete-customers-id"
        },
        "x-iquote-scope": "customers:write"
      }
    },
    "/quotes": {
      "get": {
        "operationId": "getQuotes",
        "tags": [
          "Quotes"
        ],
        "summary": "List quotes",
        "description": "Newest first.\n\nScope: `quotes:read`.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1-100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Comma-separated: draft, sent, viewed, accepted, declined, converted.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Only this customer's quotes.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "quotes:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "List quotes",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-quotes"
        },
        "x-iquote-scope": "quotes:read"
      },
      "post": {
        "operationId": "postQuotes",
        "tags": [
          "Quotes"
        ],
        "summary": "Create a draft quote",
        "description": "Scope: `quotes:write`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "quotes:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Create a draft quote",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-quotes"
        },
        "x-iquote-scope": "quotes:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteCreate"
              }
            }
          }
        }
      }
    },
    "/quotes/{id}": {
      "get": {
        "operationId": "getQuotesId",
        "tags": [
          "Quotes"
        ],
        "summary": "Retrieve a quote",
        "description": "Scope: `quotes:read`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "quotes:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a quote",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-quotes-id"
        },
        "x-iquote-scope": "quotes:read"
      },
      "patch": {
        "operationId": "patchQuotesId",
        "tags": [
          "Quotes"
        ],
        "summary": "Update a quote",
        "description": "Accepted and converted quotes are records and cannot be edited (409 quote_not_editable); duplicate them instead.\n\nScope: `quotes:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "quotes:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Update a quote",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#patch-quotes-id"
        },
        "x-iquote-scope": "quotes:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteUpdate"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteQuotesId",
        "tags": [
          "Quotes"
        ],
        "summary": "Delete a draft quote",
        "description": "Only drafts (409 quote_not_draft).\n\nScope: `quotes:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "quotes:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a draft quote",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#delete-quotes-id"
        },
        "x-iquote-scope": "quotes:write"
      }
    },
    "/quotes/{id}/send": {
      "post": {
        "operationId": "postQuotesIdSend",
        "tags": [
          "Quotes"
        ],
        "summary": "Email the quote to the customer",
        "description": "Draft, sent and viewed quotes only. Emails first, then marks the quote sent (a resend keeps its status). Needs a customer email. Retry with the same Idempotency-Key to avoid a second email.\n\nScope: `quotes:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "quotes:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Email the quote to the customer",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-quotes-id-send"
        },
        "x-iquote-scope": "quotes:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/quotes/{id}/duplicate": {
      "post": {
        "operationId": "postQuotesIdDuplicate",
        "tags": [
          "Quotes"
        ],
        "summary": "Copy into a new draft",
        "description": "Scope: `quotes:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "quotes:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Copy into a new draft",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-quotes-id-duplicate"
        },
        "x-iquote-scope": "quotes:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/quotes/{id}/convert": {
      "post": {
        "operationId": "postQuotesIdConvert",
        "tags": [
          "Quotes"
        ],
        "summary": "Convert to an invoice",
        "description": "Sent, viewed and accepted quotes can be converted. Returns the invoice: 201 when created, 200 when the quote was already converted (idempotent).\n\nScope: `quotes:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "quotes:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Already done: the existing result.",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "201": {
            "description": "Convert to an invoice",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-quotes-id-convert"
        },
        "x-iquote-scope": "quotes:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/invoices": {
      "get": {
        "operationId": "getInvoices",
        "tags": [
          "Invoices"
        ],
        "summary": "List invoices",
        "description": "Newest first.\n\nScope: `invoices:read`.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1-100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Comma-separated: draft, sent, viewed, partially_paid, paid, overdue, void, refunded, partially_refunded.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Only this customer's invoices.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "quote_id",
            "in": "query",
            "required": false,
            "description": "The invoice made from this quote.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "List invoices",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-invoices"
        },
        "x-iquote-scope": "invoices:read"
      },
      "post": {
        "operationId": "postInvoices",
        "tags": [
          "Invoices"
        ],
        "summary": "Create a draft invoice",
        "description": "Scope: `invoices:write`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Create a draft invoice",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-invoices"
        },
        "x-iquote-scope": "invoices:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceCreate"
              }
            }
          }
        }
      }
    },
    "/invoices/{id}": {
      "get": {
        "operationId": "getInvoicesId",
        "tags": [
          "Invoices"
        ],
        "summary": "Retrieve an invoice",
        "description": "Scope: `invoices:read`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve an invoice",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-invoices-id"
        },
        "x-iquote-scope": "invoices:read"
      },
      "patch": {
        "operationId": "patchInvoicesId",
        "tags": [
          "Invoices"
        ],
        "summary": "Update an invoice",
        "description": "Only while the invoice is draft, sent, viewed or overdue with nothing paid (409 invoice_not_editable).\n\nScope: `invoices:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Update an invoice",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#patch-invoices-id"
        },
        "x-iquote-scope": "invoices:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceUpdate"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteInvoicesId",
        "tags": [
          "Invoices"
        ],
        "summary": "Delete a draft invoice",
        "description": "Only drafts with no payments. Void a sent invoice instead.\n\nScope: `invoices:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a draft invoice",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#delete-invoices-id"
        },
        "x-iquote-scope": "invoices:write"
      }
    },
    "/invoices/{id}/send": {
      "post": {
        "operationId": "postInvoicesIdSend",
        "tags": [
          "Invoices"
        ],
        "summary": "Email the invoice to the customer",
        "description": "Sets the issue and due dates the way the app does on first send, emails, then marks the invoice sent. Retry with the same Idempotency-Key to avoid a second email.\n\nScope: `invoices:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Email the invoice to the customer",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-invoices-id-send"
        },
        "x-iquote-scope": "invoices:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/remind": {
      "post": {
        "operationId": "postInvoicesIdRemind",
        "tags": [
          "Invoices"
        ],
        "summary": "Send a payment reminder",
        "description": "A \"due soon\" reminder before the due date, an overdue notice after it. Only on invoices awaiting payment.\n\nScope: `invoices:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Send a payment reminder",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceWithReminder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-invoices-id-remind"
        },
        "x-iquote-scope": "invoices:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/pause_reminders": {
      "post": {
        "operationId": "postInvoicesIdPauseReminders",
        "tags": [
          "Invoices"
        ],
        "summary": "Pause or resume automatic reminders",
        "description": "Scope: `invoices:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Pause or resume automatic reminders",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-invoices-id-pause-reminders"
        },
        "x-iquote-scope": "invoices:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseReminders"
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/stop_recurring": {
      "post": {
        "operationId": "postInvoicesIdStopRecurring",
        "tags": [
          "Invoices"
        ],
        "summary": "Stop a recurring series",
        "description": "Call it on the first invoice of the series. No further invoices are created.\n\nScope: `invoices:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Stop a recurring series",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-invoices-id-stop-recurring"
        },
        "x-iquote-scope": "invoices:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/void": {
      "post": {
        "operationId": "postInvoicesIdVoid",
        "tags": [
          "Invoices"
        ],
        "summary": "Void an invoice",
        "description": "Only without money on it: refund or remove payments first.\n\nScope: `invoices:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Void an invoice",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-invoices-id-void"
        },
        "x-iquote-scope": "invoices:write",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/refund": {
      "post": {
        "operationId": "postInvoicesIdRefund",
        "tags": [
          "Invoices"
        ],
        "summary": "Refund card payments",
        "description": "Refunds card payments through the business's connected Stripe account. Owner or admin only. Requires an Idempotency-Key header (400 idempotency_key_required). At most 20 API refunds per business per hour (429 refund_rate_limited). The business is notified of every API refund. pending is true while Stripe is still processing.\n\nScope: `refunds:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "refunds:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Refund card payments",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refund"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-invoices-id-refund"
        },
        "x-iquote-scope": "refunds:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundCreate"
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/payment_link": {
      "post": {
        "operationId": "postInvoicesIdPaymentLink",
        "tags": [
          "Invoices"
        ],
        "summary": "Get the customer payment page",
        "description": "The hosted page where the customer views and pays the invoice, and whether it can take a card payment now (payable, reason). Changes nothing.\n\nScope: `invoices:read`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Get the customer payment page",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentLink"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-invoices-id-payment-link"
        },
        "x-iquote-scope": "invoices:read",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/payments": {
      "get": {
        "operationId": "getInvoicesIdPayments",
        "tags": [
          "Invoices"
        ],
        "summary": "List the invoice's payments",
        "description": "All of them, newest first (not paginated).\n\nScope: `invoices:read`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "List the invoice's payments",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-invoices-id-payments"
        },
        "x-iquote-scope": "invoices:read"
      },
      "post": {
        "operationId": "postInvoicesIdPayments",
        "tags": [
          "Invoices"
        ],
        "summary": "Record a payment received outside iQuote",
        "description": "Requires an Idempotency-Key header (400 idempotency_key_required), so a retry never records the money twice.\n\nScope: `invoices:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Record a payment received outside iQuote",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordedPayment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-invoices-id-payments"
        },
        "x-iquote-scope": "invoices:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentCreate"
              }
            }
          }
        }
      }
    },
    "/invoices/{id}/payments/{payment_id}": {
      "delete": {
        "operationId": "deleteInvoicesIdPaymentsPaymentId",
        "tags": [
          "Invoices"
        ],
        "summary": "Remove a recorded payment",
        "description": "Only payments recorded by hand, and only by an owner or admin. Card payments are refunded instead (409 card_payment).\n\nScope: `invoices:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "payment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:write"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Remove a recorded payment",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedPayment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#delete-invoices-id-payments-payment-id"
        },
        "x-iquote-scope": "invoices:write"
      }
    },
    "/payments": {
      "get": {
        "operationId": "getPayments",
        "tags": [
          "Payments"
        ],
        "summary": "List payments",
        "description": "Newest first.\n\nScope: `payments:read`.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1-100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoice_id",
            "in": "query",
            "required": false,
            "description": "Only this invoice's payments.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Only this customer's payments.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "payments:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "List payments",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-payments"
        },
        "x-iquote-scope": "payments:read"
      }
    },
    "/payments/{id}": {
      "get": {
        "operationId": "getPaymentsId",
        "tags": [
          "Payments"
        ],
        "summary": "Retrieve a payment",
        "description": "Scope: `payments:read`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "payments:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a payment",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-payments-id"
        },
        "x-iquote-scope": "payments:read"
      }
    },
    "/reports/summary": {
      "get": {
        "operationId": "getReportsSummary",
        "tags": [
          "Reports"
        ],
        "summary": "Summary for a period",
        "description": "invoiced, collected (net of refunds), refunded, outstanding and overdue per currency, plus counts. With quotes:read as well, quote counts by status and the acceptance rate.\n\nScope: `invoices:read`.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "YYYY-MM-DD. Default: 30 days ago.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "YYYY-MM-DD, inclusive. Default: today.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "invoices:read"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Summary for a period",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSummary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-reports-summary"
        },
        "x-iquote-scope": "invoices:read"
      }
    },
    "/webhook_endpoints": {
      "get": {
        "operationId": "getWebhookEndpoints",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "List webhook endpoints",
        "description": "The endpoints this app or key created (not paginated).\n\nScope: `webhooks:manage`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "webhooks:manage"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "List webhook endpoints",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-webhook-endpoints"
        },
        "x-iquote-scope": "webhooks:manage"
      },
      "post": {
        "operationId": "postWebhookEndpoints",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Create a webhook endpoint",
        "description": "The response includes the signing secret (whsec_...). Store it: it is not shown again.\n\nScope: `webhooks:manage`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "webhooks:manage"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Create a webhook endpoint",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-webhook-endpoints"
        },
        "x-iquote-scope": "webhooks:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointCreate"
              }
            }
          }
        }
      }
    },
    "/webhook_endpoints/{id}": {
      "get": {
        "operationId": "getWebhookEndpointsId",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Retrieve a webhook endpoint",
        "description": "Scope: `webhooks:manage`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "webhooks:manage"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a webhook endpoint",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-webhook-endpoints-id"
        },
        "x-iquote-scope": "webhooks:manage"
      },
      "patch": {
        "operationId": "patchWebhookEndpointsId",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Update a webhook endpoint",
        "description": "Scope: `webhooks:manage`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "webhooks:manage"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Update a webhook endpoint",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#patch-webhook-endpoints-id"
        },
        "x-iquote-scope": "webhooks:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointUpdate"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhookEndpointsId",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Delete a webhook endpoint",
        "description": "Scope: `webhooks:manage`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "webhooks:manage"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a webhook endpoint",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#delete-webhook-endpoints-id"
        },
        "x-iquote-scope": "webhooks:manage"
      }
    },
    "/webhook_endpoints/{id}/rotate_secret": {
      "post": {
        "operationId": "postWebhookEndpointsIdRotateSecret",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Rotate the signing secret",
        "description": "Returns the new secret. The old one stops working at once.\n\nScope: `webhooks:manage`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "webhooks:manage"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Rotate the signing secret",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-webhook-endpoints-id-rotate-secret"
        },
        "x-iquote-scope": "webhooks:manage",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/webhook_endpoints/{id}/test": {
      "post": {
        "operationId": "postWebhookEndpointsIdTest",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Send a test ping",
        "description": "Delivers a signed ping event now (not stored, not retried) and reports what the endpoint answered.\n\nScope: `webhooks:manage`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "webhooks:manage"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Send a test ping",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-webhook-endpoints-id-test"
        },
        "x-iquote-scope": "webhooks:manage",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    },
    "/webhook_endpoints/{id}/deliveries": {
      "get": {
        "operationId": "getWebhookEndpointsIdDeliveries",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "List recent deliveries",
        "description": "Newest first, up to limit (default 50, at most 100). Not paginated.\n\nScope: `webhooks:manage`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1-100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only deliveries in this state.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivering",
                "succeeded",
                "failed"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          }
        ],
        "security": [
          {
            "oauth2": [
              "webhooks:manage"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "List recent deliveries",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#get-webhook-endpoints-id-deliveries"
        },
        "x-iquote-scope": "webhooks:manage"
      }
    },
    "/webhook_deliveries/{id}/retry": {
      "post": {
        "operationId": "postWebhookDeliveriesIdRetry",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Retry a delivery now",
        "description": "Queues a finished or failed delivery to be sent again within a minute.\n\nScope: `webhooks:manage`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IQuoteBusiness"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "security": [
          {
            "oauth2": [
              "webhooks:manage"
            ]
          },
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retry a delivery now",
            "headers": {
              "IQuote-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "externalDocs": {
          "url": "https://i-quote.app/developers#post-webhook-deliveries-id-retry"
        },
        "x-iquote-scope": "webhooks:manage",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBody"
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "quote.sent": {
      "post": {
        "operationId": "webhook_quote_sent",
        "summary": "quote.sent",
        "description": "A quote was sent to the customer for the first time (its status became sent).\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "quote.sent"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Quote"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "quote.viewed": {
      "post": {
        "operationId": "webhook_quote_viewed",
        "summary": "quote.viewed",
        "description": "The customer opened the quote link.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "quote.viewed"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Quote"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "quote.accepted": {
      "post": {
        "operationId": "webhook_quote_accepted",
        "summary": "quote.accepted",
        "description": "The customer accepted the quote.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "quote.accepted"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Quote"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "quote.declined": {
      "post": {
        "operationId": "webhook_quote_declined",
        "summary": "quote.declined",
        "description": "The customer declined the quote.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "quote.declined"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Quote"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "quote.converted": {
      "post": {
        "operationId": "webhook_quote_converted",
        "summary": "quote.converted",
        "description": "The quote became an invoice (converted_invoice_id is set).\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "quote.converted"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Quote"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "invoice.sent": {
      "post": {
        "operationId": "webhook_invoice_sent",
        "summary": "invoice.sent",
        "description": "An invoice was sent for the first time (its status became sent).\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "invoice.sent"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "invoice.viewed": {
      "post": {
        "operationId": "webhook_invoice_viewed",
        "summary": "invoice.viewed",
        "description": "The customer opened the invoice link.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "invoice.viewed"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "invoice.paid": {
      "post": {
        "operationId": "webhook_invoice_paid",
        "summary": "invoice.paid",
        "description": "The invoice is paid in full.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "invoice.paid"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "invoice.partially_paid": {
      "post": {
        "operationId": "webhook_invoice_partially_paid",
        "summary": "invoice.partially_paid",
        "description": "A payment left part of the invoice still to pay (a deposit, or a part payment).\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "invoice.partially_paid"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "invoice.overdue": {
      "post": {
        "operationId": "webhook_invoice_overdue",
        "summary": "invoice.overdue",
        "description": "The due date passed with money still owed.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "invoice.overdue"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "invoice.voided": {
      "post": {
        "operationId": "webhook_invoice_voided",
        "summary": "invoice.voided",
        "description": "The invoice was voided.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "invoice.voided"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "payment.received": {
      "post": {
        "operationId": "webhook_payment_received",
        "summary": "payment.received",
        "description": "A payment succeeded: a card payment, or one recorded by hand.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "payment.received"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Payment"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "payment.refunded": {
      "post": {
        "operationId": "webhook_payment_refunded",
        "summary": "payment.refunded",
        "description": "Money was refunded on a payment. The object also carries refunded_now, the amount of this refund.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "payment.refunded"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "allOf": [
                              {
                                "$ref": "#/components/schemas/Payment"
                              },
                              {
                                "type": "object",
                                "required": [
                                  "refunded_now"
                                ],
                                "properties": {
                                  "refunded_now": {
                                    "type": "number",
                                    "description": "Amount of this refund."
                                  }
                                }
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "customer.created": {
      "post": {
        "operationId": "webhook_customer_created",
        "summary": "customer.created",
        "description": "A customer was added, in the app, by import or through the API.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Event"
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "data"
                    ],
                    "properties": {
                      "type": {
                        "const": "customer.created"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "object"
                        ],
                        "properties": {
                          "object": {
                            "$ref": "#/components/schemas/Customer"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    },
    "ping": {
      "post": {
        "operationId": "webhook_ping",
        "summary": "ping",
        "description": "Sent by POST /webhook_endpoints/{id}/test. data.object is { \"message\": \"Webhook test from iQuote\" }.\n\nVerify IQuote-Signature before trusting the body, answer 2xx within 10 seconds, and deduplicate on the event id.",
        "parameters": [
          {
            "name": "IQuote-Signature",
            "in": "header",
            "required": true,
            "description": "Signature over \"<t>.<raw body>\" with the endpoint signing secret.",
            "schema": {
              "type": "string",
              "examples": [
                "t=<unix seconds>,v1=<hex HMAC-SHA256>"
              ]
            }
          },
          {
            "name": "IQuote-Event-Id",
            "in": "header",
            "required": true,
            "description": "The event id, the same as the body id. Deduplicate on it.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Event-Type",
            "in": "header",
            "required": true,
            "description": "The event type, the same as the body type.",
            "schema": {
              "type": "string",
              "examples": [
                "invoice.paid"
              ]
            }
          },
          {
            "name": "IQuote-Delivery-Id",
            "in": "header",
            "required": true,
            "description": "This delivery. Retries of one delivery keep the id.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          },
          {
            "name": "IQuote-Business",
            "in": "header",
            "required": true,
            "description": "The business the event belongs to.",
            "schema": {
              "type": "string",
              "examples": [
                "uuid"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any other answer, a redirect or no answer within 10 seconds is a failure and is retried."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "description": "\"Connect with iQuote\". Authorization code flow; PKCE with S256 is required for every client, confidential or public. The user signs in to iQuote, chooses one or several businesses (owner/admin, Pro or higher) and approves the scopes. The redirect back carries code, state and iss (https://i-quote.app).\n\nToken endpoint: form-encoded or JSON; client authentication with HTTP Basic or client_id/client_secret in the body; public clients send client_id only. Access tokens last 60 minutes. Refresh tokens last 30 days and rotate on every use; presenting a used refresh token revokes the connection. The token response includes businesses: [{ id, name }].\n\nRevocation (RFC 7009): POST https://i-quote.app/oauth/revoke with token=<access or refresh token>; a refresh token ends the whole connection.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://i-quote.app/oauth/authorize",
            "tokenUrl": "https://i-quote.app/oauth/token",
            "refreshUrl": "https://i-quote.app/oauth/token",
            "scopes": {
              "customers:read": "See your customers",
              "customers:write": "Create, change and delete customers",
              "quotes:read": "See your quotes",
              "quotes:write": "Create, change, send and convert quotes",
              "invoices:read": "See your invoices and reports",
              "invoices:write": "Create, change, send and void invoices, send reminders and record payments received",
              "refunds:write": "Refund card payments to your customers",
              "payments:read": "See payments received",
              "webhooks:manage": "Manage webhook endpoints that receive your business events"
            }
          }
        }
      },
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "iqk_...",
        "description": "A business API key from Settings -> Developers, shown once when created. It carries the scopes chosen for it and reaches only its own business."
      }
    },
    "parameters": {
      "IQuoteBusiness": {
        "name": "IQuote-Business",
        "in": "header",
        "required": false,
        "description": "The business id this request acts on. Required when the credential covers several businesses (400 business_required otherwise); optional with one. GET /businesses lists them. ?business_id= works too.",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "1-255 printable ASCII characters. The first answer is replayed for 24 hours (Idempotent-Replayed: true); a request still running answers 409 idempotency_in_progress; the same key with a different request answers 422 idempotency_key_reused. 5xx answers are not stored, so retrying them runs again.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      }
    },
    "headers": {
      "RequestId": {
        "description": "Quote it to support.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimitLimit": {
        "description": "Requests allowed per minute for this credential (120).",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in the current minute (the lower of the credential and business budgets).",
        "schema": {
          "type": "integer"
        }
      },
      "IdempotentReplayed": {
        "description": "true when this is the stored answer to an earlier request with the same Idempotency-Key.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "invalid_request: malformed input (see error.code and error.param).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "authentication_error: missing_token or invalid_token.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PlanRequired": {
        "description": "plan_error: plan_required (the business is not on Pro or higher) or plan_limit_reached.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "permission_error: insufficient_scope, business_not_connected, insufficient_role, business_blocked, https_required.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "not_found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "conflict: the object is not in a state that allows this, or idempotency_in_progress.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "idempotency_key_reused, invalid_reference or a database rule.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "rate_limit_error. Wait Retry-After seconds.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait.",
            "schema": {
              "type": "integer"
            }
          }
        }
      }
    },
    "schemas": {
      "CustomerCreate": {
        "type": "object",
        "additionalProperties": false,
        "description": "A customer needs a name: send first_name and/or last_name, company_name or name.",
        "anyOf": [
          {
            "required": [
              "name"
            ]
          },
          {
            "required": [
              "first_name"
            ]
          },
          {
            "required": [
              "last_name"
            ]
          },
          {
            "required": [
              "company_name"
            ]
          }
        ],
        "properties": {
          "external_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Your own id for this customer. Unique within the business; bulk_upsert can match on it."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Display name. Derived from first_name + last_name, else company_name, when those are sent."
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "Stored lowercased. One customer per email per business. A changed email is copied onto the customer's open quotes and invoices."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Free-form address."
          },
          "street_address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "zip_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "en",
              "es",
              "fr",
              "he",
              "ar",
              "zh",
              "de",
              "pt",
              "ja",
              "ko",
              null
            ],
            "description": "Language of the emails and documents this customer receives."
          }
        }
      },
      "CustomerUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Only the fields sent change.",
        "properties": {
          "external_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Your own id for this customer. Unique within the business; bulk_upsert can match on it."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Display name. Derived from first_name + last_name, else company_name, when those are sent."
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "Stored lowercased. One customer per email per business. A changed email is copied onto the customer's open quotes and invoices."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Free-form address."
          },
          "street_address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "zip_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "en",
              "es",
              "fr",
              "he",
              "ar",
              "zh",
              "de",
              "pt",
              "ja",
              "ko",
              null
            ],
            "description": "Language of the emails and documents this customer receives."
          }
        }
      },
      "CustomerBulkUpsert": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "customers"
        ],
        "properties": {
          "customers": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/CustomerUpdate"
            },
            "description": "Each row is matched to an existing customer and updated with the fields it sends; unmatched rows are created (and then need a name)."
          },
          "match_on": {
            "type": "string",
            "enum": [
              "external_id",
              "email",
              "external_id_or_email"
            ],
            "default": "external_id_or_email"
          }
        }
      },
      "LineItemInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description",
          "unit_price"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "default": 1
          },
          "unit_price": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          }
        }
      },
      "InvoiceLineItemInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description",
          "unit_price"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "default": 1
          },
          "unit_price": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "is_recurring": {
            "type": "boolean",
            "default": false,
            "description": "Bill this line again on the invoice's recurring_frequency. Any recurring line makes the invoice the start of a recurring series."
          }
        }
      },
      "DepositInput": {
        "type": [
          "object",
          "null"
        ],
        "additionalProperties": false,
        "description": "Deposit asked up front. null removes it. The database computes deposit.amount.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "none",
              "percent",
              "fixed"
            ],
            "default": "none"
          },
          "value": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000,
            "default": 0,
            "description": "A percentage (at most 100) or a fixed amount."
          },
          "balance_due_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the rest is due. A date (YYYY-MM-DD) or an ISO 8601 timestamp.",
            "examples": [
              "2026-11-15"
            ]
          }
        }
      },
      "QuoteCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "customer_id",
          "line_items"
        ],
        "description": "Created as a draft with the next quote number. Totals are computed for you.",
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid",
            "description": "A customer of this business."
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Za-z]{3}$",
            "description": "ISO 4217 code. Default: the business's default currency."
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "percent",
              "fixed"
            ],
            "default": "percent"
          },
          "discount_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1000000000,
            "default": 0
          },
          "tax_rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Percent. Default: the business's default tax rate."
          },
          "line_items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/LineItemInput"
            }
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000,
            "description": "Default: the business's default quote notes."
          },
          "terms": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000,
            "description": "Default: the business's default quote terms."
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default: today plus the business's quote validity days. null for no expiry. A date (YYYY-MM-DD) or an ISO 8601 timestamp.",
            "examples": [
              "2026-11-15"
            ]
          },
          "deposit": {
            "$ref": "#/components/schemas/DepositInput"
          }
        }
      },
      "QuoteUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Only while the quote is editable (draft, sent, viewed or declined). Editing a declined quote reopens it as a draft.",
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Za-z]{3}$",
            "description": "ISO 4217 code. Default: the business's default currency."
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "percent",
              "fixed"
            ],
            "default": "percent"
          },
          "discount_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1000000000,
            "default": 0
          },
          "tax_rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Percent. Default: the business's default tax rate."
          },
          "line_items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/LineItemInput"
            }
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "terms": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "description": "Quote expiry. A date (YYYY-MM-DD) or an ISO 8601 timestamp.",
            "examples": [
              "2026-11-15"
            ]
          },
          "deposit": {
            "$ref": "#/components/schemas/DepositInput"
          }
        }
      },
      "InvoiceCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "customer_id",
          "line_items"
        ],
        "description": "Created as a draft with the next invoice number. Totals and amount_due are computed for you.",
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid",
            "description": "A customer of this business."
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Za-z]{3}$",
            "description": "ISO 4217 code. Default: the business's default currency."
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "percent",
              "fixed"
            ],
            "default": "percent"
          },
          "discount_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1000000000,
            "default": 0
          },
          "tax_rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Percent. Default: the business's default tax rate."
          },
          "line_items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItemInput"
            }
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "terms": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default: from the business's payment terms. A date (YYYY-MM-DD) or an ISO 8601 timestamp.",
            "examples": [
              "2026-11-15"
            ]
          },
          "late_fee_percent": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Default: the business's late fee."
          },
          "recurring_frequency": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "weekly",
              "biweekly",
              "monthly",
              "quarterly",
              "yearly",
              null
            ],
            "description": "Used when a line is recurring. Default: monthly."
          },
          "deposit": {
            "$ref": "#/components/schemas/DepositInput"
          }
        }
      },
      "InvoiceUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Only until money moves on the invoice. Moving the due date of an overdue invoice to today or later reopens it.",
        "properties": {
          "customer_id": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Za-z]{3}$",
            "description": "ISO 4217 code. Default: the business's default currency."
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "percent",
              "fixed"
            ],
            "default": "percent"
          },
          "discount_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1000000000,
            "default": 0
          },
          "tax_rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Percent. Default: the business's default tax rate."
          },
          "line_items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/InvoiceLineItemInput"
            }
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "terms": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Due date. A date (YYYY-MM-DD) or an ISO 8601 timestamp.",
            "examples": [
              "2026-11-15"
            ]
          },
          "late_fee_percent": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "recurring_frequency": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "weekly",
              "biweekly",
              "monthly",
              "quarterly",
              "yearly",
              null
            ]
          },
          "deposit": {
            "$ref": "#/components/schemas/DepositInput"
          }
        }
      },
      "PaymentCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amount"
        ],
        "description": "Money received outside iQuote (bank transfer, cash, cheque). Card payments arrive on their own.",
        "properties": {
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "At most the invoice's amount_due."
          },
          "method": {
            "type": "string",
            "enum": [
              "bank_transfer",
              "cash",
              "check",
              "card_offline",
              "other"
            ],
            "default": "bank_transfer"
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Default: now. A bare date is recorded at 12:00 UTC. A date (YYYY-MM-DD) or an ISO 8601 timestamp.",
            "examples": [
              "2026-11-15"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          }
        }
      },
      "RefundCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amount"
        ],
        "description": "Refunds card payments through the business's connected Stripe account.",
        "properties": {
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        }
      },
      "PauseReminders": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "paused": {
            "type": "boolean",
            "default": true,
            "description": "false resumes automatic reminders."
          }
        }
      },
      "EmptyBody": {
        "type": "object",
        "additionalProperties": false,
        "description": "No fields. Send {} or no body.",
        "properties": {}
      },
      "WebhookEndpointCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000,
            "description": "https only, on a public host, port 443 or 8443."
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "default": [
              "*"
            ],
            "items": {
              "type": "string",
              "enum": [
                "*",
                "quote.sent",
                "quote.viewed",
                "quote.accepted",
                "quote.declined",
                "quote.converted",
                "invoice.sent",
                "invoice.viewed",
                "invoice.paid",
                "invoice.partially_paid",
                "invoice.overdue",
                "invoice.voided",
                "payment.received",
                "payment.refunded",
                "customer.created"
              ]
            },
            "description": "Event types to receive. [\"*\"] means all of them."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "WebhookEndpointUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "*",
                "quote.sent",
                "quote.viewed",
                "quote.accepted",
                "quote.declined",
                "quote.converted",
                "invoice.sent",
                "invoice.viewed",
                "invoice.paid",
                "invoice.partially_paid",
                "invoice.overdue",
                "invoice.voided",
                "payment.received",
                "payment.refunded",
                "customer.created"
              ]
            }
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "description": "true re-enables an endpoint and resets its failure count."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "type",
              "code",
              "message",
              "request_id"
            ],
            "additionalProperties": true,
            "description": "Some errors add fields: param or params (the offending field), required_scope, business_id, business_ids, retry_after (seconds).",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "authentication_error",
                  "plan_error",
                  "permission_error",
                  "not_found",
                  "conflict",
                  "rate_limit_error",
                  "api_error",
                  "upstream_error",
                  "service_unavailable"
                ]
              },
              "code": {
                "type": "string",
                "description": "Stable, machine-readable. See the table on /developers#errors."
              },
              "message": {
                "type": "string",
                "description": "For people. May change."
              },
              "request_id": {
                "type": "string",
                "examples": [
                  "req_8f2a1c9d4b7e6a3f0c5d2e1b"
                ]
              },
              "param": {
                "type": "string"
              },
              "params": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "required_scope": {
                "type": "string"
              },
              "retry_after": {
                "type": "integer"
              },
              "business_id": {
                "type": "string"
              },
              "business_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Credential": {
        "type": "object",
        "required": [
          "object",
          "type",
          "user_id",
          "scopes",
          "business_ids"
        ],
        "properties": {
          "object": {
            "const": "credential"
          },
          "type": {
            "type": "string",
            "enum": [
              "oauth_access_token",
              "api_key"
            ]
          },
          "user_id": {
            "type": "string",
            "format": "uuid",
            "description": "The iQuote user the credential acts as."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "customers:read",
                "customers:write",
                "quotes:read",
                "quotes:write",
                "invoices:read",
                "invoices:write",
                "refunds:write",
                "payments:read",
                "webhooks:manage"
              ]
            }
          },
          "business_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "client_id": {
            "type": "string",
            "pattern": "^iqc_[a-f0-9]{32}$",
            "description": "OAuth access tokens only: the connected app's client_id."
          },
          "api_key_id": {
            "type": "string",
            "format": "uuid",
            "description": "API keys only."
          }
        }
      },
      "Business": {
        "type": "object",
        "required": [
          "id",
          "object",
          "name",
          "default_currency",
          "role",
          "plan",
          "status",
          "api_access",
          "api_access_error"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "const": "business"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_currency": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "USD"
            ]
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "The connected user's role: owner, admin, ..."
          },
          "plan": {
            "type": [
              "string",
              "null"
            ],
            "description": "free, starter, pro, multi_business, enterprise or infinity."
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_access": {
            "type": "boolean",
            "description": "Whether API calls for this business succeed right now."
          },
          "api_access_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why not: plan_required, insufficient_role, not_a_member, business_not_found."
          }
        }
      },
      "Customer": {
        "type": "object",
        "required": [
          "id",
          "object",
          "external_id",
          "name",
          "first_name",
          "last_name",
          "company_name",
          "email",
          "phone",
          "address",
          "street_address",
          "city",
          "state",
          "zip_code",
          "country",
          "tax_id",
          "language",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "const": "customer"
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "street_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": [
              "string",
              "null"
            ]
          },
          "zip_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "en",
              "es",
              "fr",
              "he",
              "ar",
              "zh",
              "de",
              "pt",
              "ja",
              "ko",
              null
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LineItem": {
        "type": "object",
        "required": [
          "description",
          "quantity",
          "unit_price"
        ],
        "properties": {
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unit_price": {
            "type": "number"
          },
          "is_recurring": {
            "const": true,
            "description": "Present only on recurring lines."
          },
          "recurring_frequency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Present only on recurring lines."
          },
          "is_late_fee": {
            "const": true,
            "description": "Present only on late-fee lines added by iQuote."
          }
        }
      },
      "Deposit": {
        "type": "object",
        "required": [
          "type",
          "value",
          "amount",
          "balance_due_date"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "none",
              "percent",
              "fixed"
            ]
          },
          "value": {
            "type": "number"
          },
          "amount": {
            "type": "number",
            "description": "The deposit in money, computed by iQuote."
          },
          "balance_due_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the rest is due."
          }
        }
      },
      "Quote": {
        "type": "object",
        "required": [
          "id",
          "object",
          "number",
          "status",
          "customer_id",
          "customer_email",
          "currency",
          "line_items",
          "subtotal",
          "discount_type",
          "discount_value",
          "discount_amount",
          "tax_rate",
          "tax_amount",
          "total",
          "deposit",
          "notes",
          "terms",
          "valid_until",
          "language",
          "sent_at",
          "responded_at",
          "accepted_by_name",
          "converted_invoice_id",
          "public_url",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "const": "quote"
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Q-0042"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "sent",
              "viewed",
              "accepted",
              "declined",
              "converted"
            ]
          },
          "customer_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string",
            "examples": [
              "USD"
            ]
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LineItem"
            }
          },
          "subtotal": {
            "type": "number"
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "percent",
              "fixed"
            ]
          },
          "discount_value": {
            "type": "number"
          },
          "discount_amount": {
            "type": "number"
          },
          "tax_rate": {
            "type": "number"
          },
          "tax_amount": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "deposit": {
            "$ref": "#/components/schemas/Deposit"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "terms": {
            "type": [
              "string",
              "null"
            ]
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "responded_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the customer accepted or declined."
          },
          "accepted_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "converted_invoice_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "public_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The page where the customer views and answers the quote."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Invoice": {
        "type": "object",
        "required": [
          "id",
          "object",
          "number",
          "status",
          "customer_id",
          "customer_email",
          "quote_id",
          "currency",
          "line_items",
          "subtotal",
          "discount_type",
          "discount_value",
          "discount_amount",
          "tax_rate",
          "tax_amount",
          "total",
          "amount_paid",
          "amount_due",
          "deposit",
          "late_fee_percent",
          "late_fee_amount",
          "issue_date",
          "due_date",
          "sent_at",
          "paid_at",
          "overdue_at",
          "notes",
          "terms",
          "language",
          "reminders",
          "recurring",
          "public_url",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "const": "invoice"
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "INV-0042"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "sent",
              "viewed",
              "partially_paid",
              "paid",
              "overdue",
              "void",
              "refunded",
              "partially_refunded"
            ]
          },
          "customer_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "quote_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The quote this invoice was converted from."
          },
          "currency": {
            "type": "string",
            "examples": [
              "USD"
            ]
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LineItem"
            }
          },
          "subtotal": {
            "type": "number"
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "percent",
              "fixed"
            ]
          },
          "discount_value": {
            "type": "number"
          },
          "discount_amount": {
            "type": "number"
          },
          "tax_rate": {
            "type": "number"
          },
          "tax_amount": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "amount_paid": {
            "type": "number"
          },
          "amount_due": {
            "type": "number"
          },
          "deposit": {
            "$ref": "#/components/schemas/Deposit"
          },
          "late_fee_percent": {
            "type": "number"
          },
          "late_fee_amount": {
            "type": "number"
          },
          "issue_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "overdue_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "terms": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "reminders": {
            "type": "object",
            "required": [
              "paused",
              "count",
              "last_sent_at"
            ],
            "properties": {
              "paused": {
                "type": "boolean"
              },
              "count": {
                "type": "integer"
              },
              "last_sent_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          },
          "recurring": {
            "type": "object",
            "required": [
              "is_recurring",
              "frequency",
              "status",
              "next_at",
              "ends_at",
              "parent_invoice_id"
            ],
            "properties": {
              "is_recurring": {
                "type": "boolean"
              },
              "frequency": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "active or stopped; null when not recurring."
              },
              "next_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "ends_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "parent_invoice_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "Set on invoices generated from a recurring series."
              }
            }
          },
          "public_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The page where the customer views and pays the invoice."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "InvoiceWithReminder": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Invoice"
          },
          {
            "type": "object",
            "required": [
              "reminder"
            ],
            "properties": {
              "reminder": {
                "type": "object",
                "required": [
                  "kind",
                  "to"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "reminder",
                      "overdue"
                    ]
                  },
                  "to": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        ]
      },
      "Payment": {
        "type": "object",
        "required": [
          "id",
          "object",
          "invoice_id",
          "customer_id",
          "amount",
          "currency",
          "status",
          "source",
          "method",
          "amount_refunded",
          "overpaid_amount",
          "note",
          "stripe_payment_intent_id",
          "paid_at",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "const": "payment"
          },
          "invoice_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "customer_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "succeeded"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "stripe",
              "manual"
            ]
          },
          "method": {
            "type": "string",
            "description": "card for Stripe payments; bank_transfer, cash, check, card_offline or other when recorded by hand."
          },
          "amount_refunded": {
            "type": "number"
          },
          "overpaid_amount": {
            "type": "number"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "stripe_payment_intent_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "RecordedPayment": {
        "type": "object",
        "required": [
          "payment",
          "invoice"
        ],
        "properties": {
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "invoice": {
            "$ref": "#/components/schemas/Invoice"
          }
        }
      },
      "Deleted": {
        "type": "object",
        "required": [
          "id",
          "object",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "type": "string"
          },
          "deleted": {
            "const": true
          }
        }
      },
      "DeletedPayment": {
        "type": "object",
        "required": [
          "id",
          "object",
          "deleted",
          "invoice"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "const": "payment"
          },
          "deleted": {
            "const": true
          },
          "invoice": {
            "$ref": "#/components/schemas/Invoice"
          }
        }
      },
      "Refund": {
        "type": "object",
        "required": [
          "object",
          "amount",
          "pending",
          "refunds",
          "invoice"
        ],
        "properties": {
          "object": {
            "const": "refund"
          },
          "amount": {
            "type": "number",
            "description": "Amount refunded by this request."
          },
          "pending": {
            "type": "boolean",
            "description": "true while Stripe is still processing."
          },
          "refunds": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "payment_id",
                "amount",
                "status"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "payment_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "amount": {
                  "type": "number"
                },
                "status": {
                  "type": "string"
                }
              }
            }
          },
          "invoice": {
            "$ref": "#/components/schemas/Invoice"
          }
        }
      },
      "PaymentLink": {
        "type": "object",
        "required": [
          "object",
          "invoice_id",
          "url",
          "card_payments",
          "payable",
          "reason",
          "amount_due",
          "currency"
        ],
        "properties": {
          "object": {
            "const": "payment_link"
          },
          "invoice_id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "card_payments": {
            "type": "boolean",
            "description": "The business has Stripe connected."
          },
          "payable": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it cannot be paid now, when payable is false."
          },
          "amount_due": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          }
        }
      },
      "BulkResult": {
        "type": "object",
        "required": [
          "object",
          "summary",
          "results"
        ],
        "properties": {
          "object": {
            "const": "bulk_result"
          },
          "summary": {
            "type": "object",
            "description": "Counts per status.",
            "properties": {
              "created": {
                "type": "integer"
              },
              "updated": {
                "type": "integer"
              },
              "unchanged": {
                "type": "integer"
              },
              "error": {
                "type": "integer"
              }
            }
          },
          "results": {
            "type": "array",
            "description": "One per input row, in order.",
            "items": {
              "type": "object",
              "required": [
                "index",
                "status"
              ],
              "properties": {
                "index": {
                  "type": "integer"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "created",
                    "updated",
                    "unchanged",
                    "error"
                  ]
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "customer": {
                  "$ref": "#/components/schemas/Customer"
                },
                "error": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "ReportSummary": {
        "type": "object",
        "required": [
          "object",
          "business_id",
          "period",
          "currencies",
          "counts",
          "quotes",
          "generated_at"
        ],
        "properties": {
          "object": {
            "const": "report_summary"
          },
          "business_id": {
            "type": "string",
            "format": "uuid"
          },
          "period": {
            "type": "object",
            "required": [
              "from",
              "to"
            ],
            "properties": {
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              }
            }
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "currency",
                "invoiced",
                "collected",
                "refunded",
                "outstanding",
                "overdue"
              ],
              "properties": {
                "currency": {
                  "type": "string"
                },
                "invoiced": {
                  "type": "number",
                  "description": "Totals of invoices created in the period (not draft or void)."
                },
                "collected": {
                  "type": "number",
                  "description": "Payments received in the period, net of refunds."
                },
                "refunded": {
                  "type": "number"
                },
                "outstanding": {
                  "type": "number",
                  "description": "Owed now on open invoices, whatever their date."
                },
                "overdue": {
                  "type": "number",
                  "description": "The overdue part of outstanding."
                }
              }
            }
          },
          "counts": {
            "type": "object",
            "required": [
              "invoices_issued",
              "invoices_open",
              "invoices_overdue",
              "payments"
            ],
            "properties": {
              "invoices_issued": {
                "type": "integer"
              },
              "invoices_open": {
                "type": "integer"
              },
              "invoices_overdue": {
                "type": "integer"
              },
              "payments": {
                "type": "integer"
              }
            }
          },
          "quotes": {
            "type": [
              "object",
              "null"
            ],
            "description": "Only with the quotes:read scope.",
            "properties": {
              "created": {
                "type": "integer"
              },
              "by_status": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "acceptance_rate": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "0-1: accepted or converted, of those sent, viewed or answered."
              }
            }
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookEndpoint": {
        "type": "object",
        "required": [
          "id",
          "object",
          "url",
          "description",
          "events",
          "enabled",
          "disabled_reason",
          "consecutive_failures",
          "last_success_at",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "const": "webhook_endpoint"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when iQuote disabled the endpoint after 50 failed deliveries in a row over 3 days."
          },
          "consecutive_failures": {
            "type": "integer"
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "WebhookEndpointWithSecret": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookEndpoint"
          },
          {
            "type": "object",
            "required": [
              "secret"
            ],
            "properties": {
              "secret": {
                "type": "string",
                "description": "Signing secret (whsec_...). Returned only on create and rotate_secret. The whole string is the HMAC key.",
                "examples": [
                  "whsec_..."
                ]
              }
            }
          }
        ]
      },
      "WebhookDelivery": {
        "type": "object",
        "required": [
          "id",
          "object",
          "endpoint_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "next_attempt_at",
          "last_status_code",
          "last_error",
          "last_attempt_at",
          "last_duration_ms",
          "delivered_at",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "const": "webhook_delivery"
          },
          "endpoint_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivering",
              "succeeded",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Only while pending."
          },
          "last_status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "WebhookTest": {
        "type": "object",
        "required": [
          "object",
          "endpoint_id",
          "ok",
          "status_code",
          "error",
          "duration_ms"
        ],
        "properties": {
          "object": {
            "const": "webhook_test"
          },
          "endpoint_id": {
            "type": "string",
            "format": "uuid"
          },
          "ok": {
            "type": "boolean"
          },
          "status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_ms": {
            "type": "integer"
          }
        }
      },
      "Event": {
        "type": "object",
        "required": [
          "id",
          "object",
          "type",
          "created_at",
          "business_id",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Event id (a UUID; test pings use evt_test_...). Deduplicate on it."
          },
          "object": {
            "const": "event"
          },
          "type": {
            "type": "string",
            "enum": [
              "quote.sent",
              "quote.viewed",
              "quote.accepted",
              "quote.declined",
              "quote.converted",
              "invoice.sent",
              "invoice.viewed",
              "invoice.paid",
              "invoice.partially_paid",
              "invoice.overdue",
              "invoice.voided",
              "payment.received",
              "payment.refunded",
              "customer.created",
              "ping"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "business_id": {
            "type": "string",
            "format": "uuid"
          },
          "data": {
            "type": "object",
            "required": [
              "object"
            ],
            "properties": {
              "object": {
                "type": "object",
                "description": "The object as the API returns it."
              }
            }
          }
        }
      },
      "CustomerList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Customer"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to get the next page; null on the last page."
          }
        }
      },
      "QuoteList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Quote"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to get the next page; null on the last page."
          }
        }
      },
      "InvoiceList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invoice"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to get the next page; null on the last page."
          }
        }
      },
      "PaymentList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to get the next page; null on the last page."
          }
        }
      },
      "BusinessList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Business"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to get the next page; null on the last page."
          }
        }
      },
      "WebhookEndpointList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to get the next page; null on the last page."
          }
        }
      },
      "WebhookDeliveryList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to get the next page; null on the last page."
          }
        }
      }
    }
  },
  "x-webhook-signature": {
    "header": "IQuote-Signature",
    "format": "t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>",
    "tolerance_seconds": 300,
    "retries": [
      "1 minute",
      "5 minutes",
      "30 minutes",
      "2 hours",
      "6 hours",
      "12 hours",
      "24 hours"
    ],
    "attempts": 8
  }
}
