{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "Taghvim Engine",
    "version": "2.0.0",
    "summary": "زیرساخت برنامه‌پذیر زمان برای ایران — Programmable time infrastructure for Iran.",
    "description": "موتور تقویم: تقویم شمسی، میلادی و قمری، روز کاری، تعطیلات رسمی، سررسید، تکرار و خرید پلن، از طریق یک API نسخه‌بندی‌شده.\n\nTaghvim Engine: calendars, business days, holidays, deadlines, recurrence and plan billing through one versioned API.\n\nAuthenticate with `Authorization: Bearer tgv_live_…` (or `tgv_test_…`). Every response carries `Taghvim-Request-Id`; metered operations carry the `RateLimit` and `RateLimit-Policy` headers. Errors are `application/problem+json` with a stable `code` and a Persian `title_fa`.",
    "contact": {
      "name": "تقویم.dev",
      "url": "https://taghvim.dev/#contact"
    },
    "x-taghvim-api-version-date": "2026-10-01"
  },
  "servers": [
    {
      "url": "https://api.taghvim.dev",
      "description": "Taghvim Engine (production)"
    }
  ],
  "tags": [
    {
      "name": "system",
      "description": "سلامت سرویس، آمادگی، نسخه‌ها و خود قرارداد API.",
      "x-taghvim-description-en": "Health, readiness, versions and the contract itself."
    },
    {
      "name": "calendar",
      "description": "تقویم‌ها و تبدیل تاریخ.",
      "x-taghvim-description-en": "Calendar systems and date conversion."
    },
    {
      "name": "business-days",
      "description": "محاسبه‌ی روز کاری بر پایه‌ی تقویم بانکی ایران.",
      "x-taghvim-description-en": "Business-day arithmetic on the Iranian bank calendar."
    },
    {
      "name": "holidays",
      "description": "تعطیلات رسمی ایران؛ تعطیلات قمری پیش‌بینی‌شده جدا مشخص می‌شوند.",
      "x-taghvim-description-en": "Official Iranian holidays, with predicted lunar dates marked."
    },
    {
      "name": "deadlines",
      "description": "سررسیدها، مهلت بر حسب ساعت کاری و یادآورها.",
      "x-taghvim-description-en": "Deadlines, SLAs in working hours and reminders."
    },
    {
      "name": "schedules",
      "description": "تکرار: نوبت‌های بعدی یک قاعده.",
      "x-taghvim-description-en": "Recurrence: the next occurrences of a rule."
    },
    {
      "name": "accounts",
      "description": "حساب‌ها و کلیدهای API.",
      "x-taghvim-description-en": "Tenants and API keys."
    },
    {
      "name": "usage",
      "description": "پلن‌ها، مصرف اندازه‌گیری‌شده و خروجی صورت‌حساب.",
      "x-taghvim-description-en": "Plans, metered usage and billing export."
    },
    {
      "name": "billing",
      "description": "خرید پلن: پرداخت، تأیید پرداخت و رسید.",
      "x-taghvim-description-en": "Buying a plan: checkout, payment verification and receipts."
    },
    {
      "name": "events",
      "description": "گزارش رویدادها و انواع رویداد.",
      "x-taghvim-description-en": "Event log and event types."
    },
    {
      "name": "webhooks",
      "description": "نشانی‌های وب‌هوک امضاشده و گزارش تحویل.",
      "x-taghvim-description-en": "Signed webhook endpoints and deliveries."
    },
    {
      "name": "connectors",
      "description": "استاندارد اتصال پرداخت برای ساخت آداپتور خودتان.",
      "x-taghvim-description-en": "The payment connector standard for building your own adapter."
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "getHealth",
        "summary": "سلامت سرویس",
        "description": "Health",
        "responses": {
          "200": {
            "description": "Health",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [],
        "x-taghvim-contract": "contract.system.getHealth@2.0.0",
        "x-taghvim-summary-en": "Health",
        "x-taghvim-auth": "none",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error"
        ]
      }
    },
    "/v1/readiness": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "getReadiness",
        "summary": "آمادگی سرویس",
        "description": "Readiness",
        "responses": {
          "200": {
            "description": "Readiness",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Readiness"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "503": {
            "description": "Readiness",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Readiness"
                }
              }
            }
          }
        },
        "security": [],
        "x-taghvim-contract": "contract.system.getReadiness@2.0.0",
        "x-taghvim-summary-en": "Readiness",
        "x-taghvim-auth": "none",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error"
        ]
      }
    },
    "/v1/versions": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "getVersions",
        "summary": "نسخه‌ها",
        "description": "Versions",
        "responses": {
          "200": {
            "description": "Versions",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Versions"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [],
        "x-taghvim-contract": "contract.system.getVersions@2.0.0",
        "x-taghvim-summary-en": "Versions",
        "x-taghvim-auth": "none",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error"
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "system"
        ],
        "operationId": "getOpenApi",
        "summary": "همین سند OpenAPI",
        "description": "This OpenAPI document",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [],
        "x-taghvim-contract": "contract.system.getOpenApi@2.0.0",
        "x-taghvim-summary-en": "This OpenAPI document",
        "x-taghvim-auth": "none",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error"
        ]
      }
    },
    "/v1/calendars/systems": {
      "get": {
        "tags": [
          "calendar"
        ],
        "operationId": "listCalendarSystems",
        "summary": "تقویم‌های پشتیبانی‌شده",
        "description": "Calendar systems",
        "responses": {
          "200": {
            "description": "CalendarSystems",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarSystems"
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.calendar.listCalendarSystems@2.0.0",
        "x-taghvim-summary-en": "Calendar systems",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "calendar.read",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "calendar",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "key_revoked",
          "quota_exceeded",
          "unauthorized"
        ]
      }
    },
    "/v1/dates/convert": {
      "post": {
        "tags": [
          "calendar"
        ],
        "operationId": "convertDate",
        "summary": "تبدیل تاریخ",
        "description": "یک تاریخ شمسی، میلادی یا قمری را می‌گیرد و همان روز را در هر سه تقویم، همراه با وضعیت روز کاری، برمی‌گرداند.\n\nConvert a date",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvertRequest"
              },
              "example": {
                "date": "1405-07-15"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ConvertResponse",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertResponse"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.calendar.convertDate@2.0.0",
        "x-taghvim-summary-en": "Convert a date",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "calendar.convert",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "calendar",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "invalid_json",
          "key_revoked",
          "out_of_range",
          "payload_too_large",
          "quota_exceeded",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/dates/resolve": {
      "post": {
        "tags": [
          "calendar"
        ],
        "operationId": "resolveDate",
        "summary": "خواندن تاریخ از متن فارسی",
        "description": "تاریخ صریح (مانند «۱۵ مهر ۱۴۰۵») یا عبارت نسبی فارسی (مانند «سه روز کاری بعد از ۱۵ مهر ساعت ۱۰»، «فردا» یا «۵ روز قبل») را با روزهای کاری تقویم بانکی به تاریخ دقیق تبدیل می‌کند و مراحل و فرض‌ها را نشان می‌دهد. عبارتی را که بدون حدس قابل خواندن نباشد، رد می‌کند.\n\nResolve a Persian date expression",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveRequest"
              },
              "example": {
                "text": "سه روز کاری بعد از ۱۵ مهر ساعت ۱۰",
                "locale": "fa-IR",
                "calendar_system": "jalali",
                "timezone": "Asia/Tehran",
                "reference_instant": "2026-09-29T20:00:00Z",
                "ambiguity_policy": "return_candidates"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ResolveResponse",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveResponse"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`unresolved_expression`: این عبارت بدون حدس‌زدن به تاریخ تبدیل نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unresolved_expression",
                  "title": "The text could not be resolved to a date without guessing.",
                  "title_fa": "این عبارت بدون حدس‌زدن به تاریخ تبدیل نشد.",
                  "status": 422,
                  "code": "unresolved_expression",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.calendar.resolveDate@2.0.0",
        "x-taghvim-summary-en": "Resolve a Persian date expression",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "temporal.resolve",
        "x-taghvim-weight": 5,
        "x-taghvim-entitlement": "date_resolution",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_json",
          "key_revoked",
          "payload_too_large",
          "quota_exceeded",
          "unauthorized",
          "unresolved_expression",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/business-days/add": {
      "post": {
        "tags": [
          "business-days"
        ],
        "operationId": "addBusinessDays",
        "summary": "افزودن روز کاری",
        "description": "چند روز کاری به یک تاریخ اضافه یا از آن کم می‌کند؛ جمعه‌ها و تعطیلات رسمی شمرده نمی‌شوند.\n\nAdd business days",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessDaysAddRequest"
              },
              "example": {
                "date": "1405-07-15",
                "days": 30
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "BusinessDaysAddResponse",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDaysAddResponse"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.business-days.addBusinessDays@2.0.0",
        "x-taghvim-summary-en": "Add business days",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "business_day.calculate",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "business_days",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "invalid_json",
          "key_revoked",
          "out_of_range",
          "payload_too_large",
          "quota_exceeded",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/business-days/diff": {
      "post": {
        "tags": [
          "business-days"
        ],
        "operationId": "diffBusinessDays",
        "summary": "شمارش روزهای کاری میان دو تاریخ",
        "description": "روزهای کاری و روزهای تعطیل میان دو تاریخ را می‌شمارد (روز آغاز شمرده نمی‌شود، روز پایان شمرده می‌شود).\n\nCount business days between two dates",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessDaysDiffRequest"
              },
              "example": {
                "from": "1405-07-15",
                "to": "1405-08-15"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "BusinessDaysDiffResponse",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDaysDiffResponse"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.business-days.diffBusinessDays@2.0.0",
        "x-taghvim-summary-en": "Count business days between two dates",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "business_day.calculate",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "business_days",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "invalid_json",
          "key_revoked",
          "out_of_range",
          "payload_too_large",
          "quota_exceeded",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/business-days/is-business-day": {
      "post": {
        "tags": [
          "business-days"
        ],
        "operationId": "isBusinessDay",
        "summary": "آیا این روز کاری است؟",
        "description": "Is this a business day?",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IsBusinessDayRequest"
              },
              "example": {
                "date": "1405-07-15"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "BusinessDayStatus",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDayStatus"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.business-days.isBusinessDay@2.0.0",
        "x-taghvim-summary-en": "Is this a business day?",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "business_day.calculate",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "business_days",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "invalid_json",
          "key_revoked",
          "out_of_range",
          "payload_too_large",
          "quota_exceeded",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/business-days/check": {
      "get": {
        "tags": [
          "business-days"
        ],
        "operationId": "checkBusinessDay",
        "summary": "آیا این روز کاری است؟ (با پارامتر)",
        "description": "Is this a business day? (query form)",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DateInput"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "BusinessDayStatus",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDayStatus"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.business-days.checkBusinessDay@2.0.0",
        "x-taghvim-summary-en": "Is this a business day? (query form)",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "business_day.calculate",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "business_days",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "key_revoked",
          "out_of_range",
          "quota_exceeded",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/business-days/next": {
      "get": {
        "tags": [
          "business-days"
        ],
        "operationId": "nextBusinessDay",
        "summary": "روز کاری بعدی",
        "description": "Next business day",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DateInput"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AdjacentBusinessDay",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdjacentBusinessDay"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.business-days.nextBusinessDay@2.0.0",
        "x-taghvim-summary-en": "Next business day",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "business_day.calculate",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "business_days",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "key_revoked",
          "out_of_range",
          "quota_exceeded",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/business-days/previous": {
      "get": {
        "tags": [
          "business-days"
        ],
        "operationId": "previousBusinessDay",
        "summary": "روز کاری قبلی",
        "description": "Previous business day",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DateInput"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AdjacentBusinessDay",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdjacentBusinessDay"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.business-days.previousBusinessDay@2.0.0",
        "x-taghvim-summary-en": "Previous business day",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "business_day.calculate",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "business_days",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "key_revoked",
          "out_of_range",
          "quota_exceeded",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/holidays": {
      "get": {
        "tags": [
          "holidays"
        ],
        "operationId": "listHolidays",
        "summary": "تعطیلات رسمی یک سال یا ماه شمسی",
        "description": "تعطیلات قمری تا اعلام رسمی «پیش‌بینی» هستند و ممکن است یک روز جابه‌جا شوند.\n\nOfficial holidays of a Jalali year or month",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1300,
              "maximum": 1500,
              "examples": [
                1405
              ]
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12,
              "examples": [
                11
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "HolidayList",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HolidayList"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/out_of_range",
                  "title": "The value is outside the supported range.",
                  "title_fa": "مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
                  "status": 422,
                  "code": "out_of_range",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.holidays.listHolidays@2.0.0",
        "x-taghvim-summary-en": "Official holidays of a Jalali year or month",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "calendar.read",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "holidays",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "key_revoked",
          "out_of_range",
          "quota_exceeded",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/holidays/{date}": {
      "get": {
        "tags": [
          "holidays"
        ],
        "operationId": "getHolidaysOn",
        "summary": "تعطیلات یک روز",
        "description": "Holidays on one day",
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/DateInput"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "HolidayDay",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HolidayDay"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.holidays.getHolidaysOn@2.0.0",
        "x-taghvim-summary-en": "Holidays on one day",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "calendar.read",
        "x-taghvim-weight": 1,
        "x-taghvim-entitlement": "holidays",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "key_revoked",
          "out_of_range",
          "quota_exceeded",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/deadlines": {
      "post": {
        "tags": [
          "deadlines"
        ],
        "operationId": "createDeadline",
        "summary": "ساختن سررسید",
        "description": "سررسیدی بر پایه‌ی تاریخ مبنا، تعداد روز (کاری یا تقویمی) و قاعده‌ی جابه‌جایی در روز تعطیل می‌سازد و نگه می‌دارد.\n\nCreate a deadline",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeadlineRequest"
              },
              "example": {
                "anchor": "1405-07-15",
                "days": 10,
                "type": "business"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Deadline",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deadline"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.deadlines.createDeadline@2.0.0",
        "x-taghvim-summary-en": "Create a deadline",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "deadline.calculate",
        "x-taghvim-weight": 3,
        "x-taghvim-entitlement": "deadlines",
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [
          "taghvim.event.deadline.created.v1"
        ],
        "x-taghvim-errors": [
          "entitlement_required",
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "invalid_date",
          "invalid_json",
          "key_revoked",
          "out_of_range",
          "payload_too_large",
          "quota_exceeded",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/deadlines/{id}": {
      "get": {
        "tags": [
          "deadlines"
        ],
        "operationId": "getDeadline",
        "summary": "دریافت سررسید",
        "description": "Get a deadline",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ddl_"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deadline",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deadline"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.deadlines.getDeadline@2.0.0",
        "x-taghvim-summary-en": "Get a deadline",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": "deadlines",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/sla/due": {
      "post": {
        "tags": [
          "deadlines"
        ],
        "operationId": "dueSla",
        "summary": "مهلت بر حسب ساعت کاری",
        "description": "پایان یک مهلت را با شمردن فقط ساعت‌های کاری حساب می‌کند؛ روزهای تعطیل و ساعت‌های بیرون از وقت اداری شمرده نمی‌شوند.\n\nSLA due time in working hours",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlaRequest"
              },
              "example": {
                "start": "1405-07-15",
                "time": "15:00",
                "hours": 24,
                "open": "08:00",
                "close": "16:00",
                "thursday_close": "13:00"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SlaResponse",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlaResponse"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`invalid_time`: ساعت واردشده معتبر نیست.\n\n`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.deadlines.dueSla@2.0.0",
        "x-taghvim-summary-en": "SLA due time in working hours",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "sla.calculate",
        "x-taghvim-weight": 2,
        "x-taghvim-entitlement": "business_days",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "invalid_json",
          "invalid_time",
          "key_revoked",
          "out_of_range",
          "payload_too_large",
          "quota_exceeded",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/reminders/preview": {
      "post": {
        "tags": [
          "deadlines"
        ],
        "operationId": "previewReminders",
        "summary": "پیش‌نمایش یادآورها",
        "description": "زمان یادآورها را پیش از سررسید حساب می‌کند؛ یادآوری که به روز تعطیل بخورد به روز کاری قبل می‌رود.\n\nPreview reminders before a due date",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemindersRequest"
              },
              "example": {
                "due": "1405-08-20",
                "time": "09:00",
                "offsets": [
                  {
                    "n": 7,
                    "unit": "calendar"
                  },
                  {
                    "n": 3,
                    "unit": "business"
                  },
                  {
                    "n": 0,
                    "unit": "calendar"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "RemindersResponse",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemindersResponse"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.\n\n`invalid_time`: ساعت واردشده معتبر نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.deadlines.previewReminders@2.0.0",
        "x-taghvim-summary-en": "Preview reminders before a due date",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "schedule.preview",
        "x-taghvim-weight": 2,
        "x-taghvim-entitlement": "business_days",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "invalid_json",
          "invalid_time",
          "key_revoked",
          "payload_too_large",
          "quota_exceeded",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/schedules/preview": {
      "post": {
        "tags": [
          "schedules"
        ],
        "operationId": "previewSchedule",
        "summary": "نوبت‌های بعدی یک قاعده‌ی تکرار",
        "description": "نوبت‌های بعدی یک قاعده‌ی تکرار را حساب می‌کند؛ مثلاً «آخرین روز کاری هر ماه».\n\nNext occurrences of a recurrence rule",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SchedulePreviewRequest"
              },
              "example": {
                "rule": "last-business",
                "from": "1405-07-01",
                "count": 4
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SchedulePreview",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "Taghvim-Calendar-Data-Version": {
                "$ref": "#/components/headers/CalendarDataVersion"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchedulePreview"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`invalid_date`: تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_date",
                  "title": "The date is not a valid Jalali, Gregorian or Hijri date.",
                  "title_fa": "تاریخ واردشده تاریخ شمسی، میلادی یا قمری معتبری نیست.",
                  "status": 422,
                  "code": "invalid_date",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "429": {
            "description": "`quota_exceeded`: سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/quota_exceeded",
                  "title": "The monthly operations quota of your plan is used up.",
                  "title_fa": "سهمیه‌ی ماهانه‌ی عملیات پلن شما تمام شده است.",
                  "status": 429,
                  "code": "quota_exceeded",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.schedules.previewSchedule@2.0.0",
        "x-taghvim-summary-en": "Next occurrences of a recurrence rule",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": "recurrence.expand",
        "x-taghvim-weight": 2,
        "x-taghvim-entitlement": "calendar",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "invalid_date",
          "invalid_json",
          "key_revoked",
          "payload_too_large",
          "quota_exceeded",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/tenants": {
      "post": {
        "tags": [
          "accounts"
        ],
        "operationId": "createTenant",
        "summary": "ساختن حساب و نخستین کلید API (ویژه‌ی اپراتور)",
        "description": "Create a tenant and its first API key (operator)",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantRequest"
              },
              "example": {
                "name": "Acme Clinic",
                "billing_email": "billing@example.com",
                "environment": "test"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "TenantCreated",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantCreated"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unauthorized",
                  "title": "A valid API key is required.",
                  "title_fa": "برای این درخواست کلید API معتبر لازم است.",
                  "status": 401,
                  "code": "unauthorized",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`forbidden`: این اعتبارنامه اجازه‌ی انجام این کار را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/forbidden",
                  "title": "This credential may not perform this operation.",
                  "title_fa": "این اعتبارنامه اجازه‌ی انجام این کار را ندارد.",
                  "status": 403,
                  "code": "forbidden",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "OperatorToken": []
          }
        ],
        "x-taghvim-contract": "contract.accounts.createTenant@2.0.0",
        "x-taghvim-summary-en": "Create a tenant and its first API key (operator)",
        "x-taghvim-auth": "admin",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [
          "taghvim.event.tenant.created.v1"
        ],
        "x-taghvim-errors": [
          "forbidden",
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "invalid_json",
          "payload_too_large",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "accounts"
        ],
        "operationId": "getMe",
        "summary": "حساب و کلیدی که این درخواست را فرستاده است",
        "description": "The tenant and key making this call",
        "responses": {
          "200": {
            "description": "Me",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.accounts.getMe@2.0.0",
        "x-taghvim-summary-en": "The tenant and key making this call",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "unauthorized"
        ]
      }
    },
    "/v1/keys": {
      "post": {
        "tags": [
          "accounts"
        ],
        "operationId": "createApiKey",
        "summary": "ساختن کلید API",
        "description": "Create an API key",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyRequest"
              },
              "example": {
                "name": "server",
                "environment": "live"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "ApiKeyWithSecret",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.accounts.createApiKey@2.0.0",
        "x-taghvim-summary-en": "Create an API key",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [
          "taghvim.event.api_key.created.v1"
        ],
        "x-taghvim-errors": [
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "invalid_json",
          "key_revoked",
          "payload_too_large",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      },
      "get": {
        "tags": [
          "accounts"
        ],
        "operationId": "listApiKeys",
        "summary": "فهرست کلیدهای API",
        "description": "List API keys",
        "responses": {
          "200": {
            "description": "ApiKeyList",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyList"
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.accounts.listApiKeys@2.0.0",
        "x-taghvim-summary-en": "List API keys",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "unauthorized"
        ]
      }
    },
    "/v1/keys/{id}": {
      "delete": {
        "tags": [
          "accounts"
        ],
        "operationId": "revokeApiKey",
        "summary": "باطل کردن کلید API",
        "description": "Revoke an API key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^key_"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "responses": {
          "200": {
            "description": "ApiKey",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.accounts.revokeApiKey@2.0.0",
        "x-taghvim-summary-en": "Revoke an API key",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [
          "taghvim.event.api_key.revoked.v1"
        ],
        "x-taghvim-errors": [
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "tags": [
          "usage"
        ],
        "operationId": "getUsage",
        "summary": "مصرف در یک دوره",
        "description": "Usage in a period",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}$",
              "examples": [
                "1405-07"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usage",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/out_of_range",
                  "title": "The value is outside the supported range.",
                  "title_fa": "مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
                  "status": 422,
                  "code": "out_of_range",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.usage.getUsage@2.0.0",
        "x-taghvim-summary-en": "Usage in a period",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "out_of_range",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/usage/export": {
      "get": {
        "tags": [
          "usage"
        ],
        "operationId": "exportUsage",
        "summary": "خروجی صورت‌حساب یک دوره",
        "description": "Billing export for a period",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}$"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "UsageExport",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageExport"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/out_of_range",
                  "title": "The value is outside the supported range.",
                  "title_fa": "مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
                  "status": 422,
                  "code": "out_of_range",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.usage.exportUsage@2.0.0",
        "x-taghvim-summary-en": "Billing export for a period",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "out_of_range",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/plans": {
      "get": {
        "tags": [
          "usage"
        ],
        "operationId": "listPlans",
        "summary": "پلن‌ها و قیمت‌ها",
        "description": "Plans and prices",
        "responses": {
          "200": {
            "description": "PlanList",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanList"
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.usage.listPlans@2.0.0",
        "x-taghvim-summary-en": "Plans and prices",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "unauthorized"
        ]
      }
    },
    "/v1/subscription": {
      "get": {
        "tags": [
          "usage"
        ],
        "operationId": "getSubscription",
        "summary": "اشتراک فعلی",
        "description": "Current subscription",
        "responses": {
          "200": {
            "description": "Subscription",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.usage.getSubscription@2.0.0",
        "x-taghvim-summary-en": "Current subscription",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "unauthorized"
        ]
      }
    },
    "/v1/admin/billing-export": {
      "get": {
        "tags": [
          "usage"
        ],
        "operationId": "exportBilling",
        "summary": "خروجی صورت‌حساب همه‌ی حساب‌ها (ویژه‌ی اپراتور)",
        "description": "Billing export for all tenants (operator)",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "BillingExport",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingExport"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unauthorized",
                  "title": "A valid API key is required.",
                  "title_fa": "برای این درخواست کلید API معتبر لازم است.",
                  "status": 401,
                  "code": "unauthorized",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`forbidden`: این اعتبارنامه اجازه‌ی انجام این کار را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/forbidden",
                  "title": "This credential may not perform this operation.",
                  "title_fa": "این اعتبارنامه اجازه‌ی انجام این کار را ندارد.",
                  "status": 403,
                  "code": "forbidden",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`out_of_range`: مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/out_of_range",
                  "title": "The value is outside the supported range.",
                  "title_fa": "مقدار واردشده بیرون از بازه‌ی پشتیبانی‌شده است.",
                  "status": 422,
                  "code": "out_of_range",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "OperatorToken": []
          }
        ],
        "x-taghvim-contract": "contract.usage.exportBilling@2.0.0",
        "x-taghvim-summary-en": "Billing export for all tenants (operator)",
        "x-taghvim-auth": "admin",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "forbidden",
          "internal_error",
          "out_of_range",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/payment-intents": {
      "post": {
        "tags": [
          "billing"
        ],
        "operationId": "createPaymentIntent",
        "summary": "ساختن درخواست پرداخت برای خرید پلن",
        "description": "برای پلن انتخاب‌شده درخواست پرداخت می‌سازد و نشانی صفحه‌ی پرداخت را برمی‌گرداند. تا پیش از راه‌اندازی پرداخت آنلاین، پاسخ خطای payments_not_configured است.\n\nCreate a payment intent to buy a plan",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentIntentCreateRequest"
              },
              "example": {
                "plan_id": "plan_builder"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "PaymentIntent",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            }
          },
          "400": {
            "description": "`idempotency_key_required`: این عملیات به سرآیند Idempotency-Key نیاز دارد.\n\n`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_key_required",
                  "title": "This operation requires an Idempotency-Key header.",
                  "title_fa": "این عملیات به سرآیند Idempotency-Key نیاز دارد.",
                  "status": 400,
                  "code": "idempotency_key_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.\n\n`plan_unchanged`: حساب شما هم‌اکنون روی همین پلن یا پلن بالاتری است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`plan_not_purchasable`: این پلن را نمی‌توان به‌صورت آنلاین خرید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/plan_not_purchasable",
                  "title": "This plan cannot be bought online.",
                  "title_fa": "این پلن را نمی‌توان به‌صورت آنلاین خرید.",
                  "status": 422,
                  "code": "plan_not_purchasable",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "502": {
            "description": "`payment_provider_error`: درگاه پرداخت خطا برگرداند.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payment_provider_error",
                  "title": "The payment provider returned an error.",
                  "title_fa": "درگاه پرداخت خطا برگرداند.",
                  "status": 502,
                  "code": "payment_provider_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "503": {
            "description": "`payments_not_configured`: پرداخت آنلاین هنوز راه‌اندازی نشده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payments_not_configured",
                  "title": "Online payments are not configured yet.",
                  "title_fa": "پرداخت آنلاین هنوز راه‌اندازی نشده است.",
                  "status": 503,
                  "code": "payments_not_configured",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.billing.createPaymentIntent@2.0.0",
        "x-taghvim-summary-en": "Create a payment intent to buy a plan",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "required",
        "x-taghvim-emits": [
          "taghvim.event.payment.intent.created.v1"
        ],
        "x-taghvim-errors": [
          "idempotency_conflict",
          "idempotency_in_progress",
          "idempotency_key_required",
          "internal_error",
          "invalid_json",
          "key_revoked",
          "not_found",
          "payload_too_large",
          "payment_provider_error",
          "payments_not_configured",
          "plan_not_purchasable",
          "plan_unchanged",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    },
    "/v1/payment-intents/{id}": {
      "get": {
        "tags": [
          "billing"
        ],
        "operationId": "getPaymentIntent",
        "summary": "وضعیت درخواست پرداخت",
        "description": "Get a payment intent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pay_"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PaymentIntent",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.billing.getPaymentIntent@2.0.0",
        "x-taghvim-summary-en": "Get a payment intent",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/payment-intents/{id}/verify": {
      "post": {
        "tags": [
          "billing"
        ],
        "operationId": "verifyPaymentIntent",
        "summary": "تأیید پرداخت از درگاه",
        "description": "اگر بازگشت از درگاه گم شده باشد، این عملیات وضعیت پرداخت را از درگاه می‌پرسد و در صورت تأیید، پلن را ارتقا می‌دهد.\n\nVerify a payment with the provider",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pay_"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "responses": {
          "200": {
            "description": "PaymentIntent",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.\n\n`payment_amount_mismatch`: مبلغ تأییدشده با مبلغ درخواست پرداخت یکسان نیست.\n\n`payment_intent_state`: وضعیت درخواست پرداخت اجازه‌ی این کار را نمی‌دهد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "502": {
            "description": "`payment_provider_error`: درگاه پرداخت خطا برگرداند.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payment_provider_error",
                  "title": "The payment provider returned an error.",
                  "title_fa": "درگاه پرداخت خطا برگرداند.",
                  "status": 502,
                  "code": "payment_provider_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          },
          "503": {
            "description": "`payments_not_configured`: پرداخت آنلاین هنوز راه‌اندازی نشده است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payments_not_configured",
                  "title": "Online payments are not configured yet.",
                  "title_fa": "پرداخت آنلاین هنوز راه‌اندازی نشده است.",
                  "status": 503,
                  "code": "payments_not_configured",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.billing.verifyPaymentIntent@2.0.0",
        "x-taghvim-summary-en": "Verify a payment with the provider",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [
          "taghvim.event.payment.intent.verified.v1",
          "taghvim.event.payment.intent.failed.v1",
          "taghvim.event.subscription.upgraded.v1"
        ],
        "x-taghvim-errors": [
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "key_revoked",
          "not_found",
          "payment_amount_mismatch",
          "payment_intent_state",
          "payment_provider_error",
          "payments_not_configured",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/payment-intents/{id}/cancel": {
      "post": {
        "tags": [
          "billing"
        ],
        "operationId": "cancelPaymentIntent",
        "summary": "لغو درخواست پرداخت",
        "description": "Cancel a payment intent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^pay_"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "responses": {
          "200": {
            "description": "PaymentIntent",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntent"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.\n\n`payment_intent_state`: وضعیت درخواست پرداخت اجازه‌ی این کار را نمی‌دهد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.billing.cancelPaymentIntent@2.0.0",
        "x-taghvim-summary-en": "Cancel a payment intent",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [
          "taghvim.event.payment.intent.cancelled.v1"
        ],
        "x-taghvim-errors": [
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "key_revoked",
          "not_found",
          "payment_intent_state",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/billing/callback/vandar": {
      "get": {
        "tags": [
          "billing"
        ],
        "operationId": "paymentCallback",
        "summary": "بازگشت پرداخت‌کننده از درگاه",
        "description": "پرداخت‌کننده پس از پرداخت به این نشانی برمی‌گردد. این بازگشت فقط یک نشانه است: پرداخت تنها پس از تأیید مستقیم از درگاه و برابری مبلغ، موفق ثبت می‌شود.\n\nPayment provider return (payer's browser)",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "payment_status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A Persian page with the payment result and receipt.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [],
        "x-taghvim-contract": "contract.billing.paymentCallback@2.0.0",
        "x-taghvim-summary-en": "Payment provider return (payer's browser)",
        "x-taghvim-auth": "none",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [
          "taghvim.event.payment.intent.verified.v1",
          "taghvim.event.payment.intent.failed.v1",
          "taghvim.event.subscription.upgraded.v1"
        ],
        "x-taghvim-errors": [
          "internal_error",
          "validation_failed"
        ]
      }
    },
    "/v1/receipts/{id}": {
      "get": {
        "tags": [
          "billing"
        ],
        "operationId": "getReceipt",
        "summary": "دریافت رسید",
        "description": "Get a receipt",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^rcpt_"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Receipt",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.billing.getReceipt@2.0.0",
        "x-taghvim-summary-en": "Get a receipt",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/event-log": {
      "get": {
        "tags": [
          "events"
        ],
        "operationId": "listEventLog",
        "summary": "گزارش رویدادهای حساب",
        "description": "رویدادهای ثبت‌شده‌ی حساب، تازه‌ترین در ابتدا. شناسه‌ی هر رویداد با evtlog_ آغاز می‌شود؛ evt_ برای رویدادهای تقویم کنار گذاشته شده است.\n\nEvent log",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EventType"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "EventList",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.events.listEventLog@2.0.0",
        "x-taghvim-summary-en": "Event log",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/event-log/{id}": {
      "get": {
        "tags": [
          "events"
        ],
        "operationId": "getEventLogEntry",
        "summary": "یک رویداد از گزارش رویدادها",
        "description": "One event-log entry",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^evtlog_"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.events.getEventLogEntry@2.0.0",
        "x-taghvim-summary-en": "One event-log entry",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/event-types": {
      "get": {
        "tags": [
          "events"
        ],
        "operationId": "listEventTypes",
        "summary": "انواع رویداد",
        "description": "Event types",
        "responses": {
          "200": {
            "description": "EventTypeList",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventTypeList"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [],
        "x-taghvim-contract": "contract.events.listEventTypes@2.0.0",
        "x-taghvim-summary-en": "Event types",
        "x-taghvim-auth": "none",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error"
        ]
      }
    },
    "/v1/webhooks": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "operationId": "createWebhook",
        "summary": "ساختن نشانی وب‌هوک",
        "description": "Create a webhook endpoint",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreateRequest"
              },
              "example": {
                "url": "https://example.com/webhooks/taghvim",
                "event_types": [
                  "taghvim.event.payment.intent.verified.v1"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "WebhookWithSecret",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.\n\n`webhook_limit_reached`: به سقف تعداد نشانی‌های وب‌هوک رسیده‌اید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "422": {
            "description": "`webhook_url_rejected`: نشانی وب‌هوک باید یک نشانی عمومی HTTPS باشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/webhook_url_rejected",
                  "title": "The webhook URL must be a public HTTPS URL.",
                  "title_fa": "نشانی وب‌هوک باید یک نشانی عمومی HTTPS باشد.",
                  "status": 422,
                  "code": "webhook_url_rejected",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.webhooks.createWebhook@2.0.0",
        "x-taghvim-summary-en": "Create a webhook endpoint",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": "webhooks",
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "invalid_json",
          "key_revoked",
          "payload_too_large",
          "unauthorized",
          "unsupported_media_type",
          "validation_failed",
          "webhook_limit_reached",
          "webhook_url_rejected"
        ]
      },
      "get": {
        "tags": [
          "webhooks"
        ],
        "operationId": "listWebhooks",
        "summary": "فهرست نشانی‌های وب‌هوک",
        "description": "List webhook endpoints",
        "responses": {
          "200": {
            "description": "WebhookList",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.webhooks.listWebhooks@2.0.0",
        "x-taghvim-summary-en": "List webhook endpoints",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": "webhooks",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "key_revoked",
          "unauthorized"
        ]
      }
    },
    "/v1/webhooks/{id}": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "operationId": "getWebhook",
        "summary": "دریافت نشانی وب‌هوک",
        "description": "Get a webhook endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^whk_"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.webhooks.getWebhook@2.0.0",
        "x-taghvim-summary-en": "Get a webhook endpoint",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": "webhooks",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      },
      "delete": {
        "tags": [
          "webhooks"
        ],
        "operationId": "deleteWebhook",
        "summary": "غیرفعال کردن نشانی وب‌هوک",
        "description": "Disable a webhook endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^whk_"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.webhooks.deleteWebhook@2.0.0",
        "x-taghvim-summary-en": "Disable a webhook endpoint",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": "webhooks",
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "operationId": "rotateWebhookSecret",
        "summary": "تعویض کلید امضا",
        "description": "کلید تازه می‌سازد؛ کلید قبلی تا پایان دوره‌ی هم‌پوشانی هم امضا می‌کند.\n\nRotate the signing secret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^whk_"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "responses": {
          "200": {
            "description": "WebhookWithSecret",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.webhooks.rotateWebhookSecret@2.0.0",
        "x-taghvim-summary-en": "Rotate the signing secret",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": "webhooks",
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "operationId": "listWebhookDeliveries",
        "summary": "گزارش تحویل‌های یک وب‌هوک",
        "description": "Deliveries of a webhook endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^whk_"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DeliveryList",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryList"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.webhooks.listWebhookDeliveries@2.0.0",
        "x-taghvim-summary-en": "Deliveries of a webhook endpoint",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": "webhooks",
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "entitlement_required",
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "operationId": "testWebhook",
        "summary": "ارسال تحویل آزمایشی",
        "description": "Send a test delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^whk_"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            },
            "description": "Retries with the same key and body return the first response; a different body returns idempotency_conflict."
          }
        ],
        "responses": {
          "202": {
            "description": "Event",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "Taghvim-Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/validation_failed",
                  "title": "The request does not match the contract.",
                  "title_fa": "درخواست با قرارداد API هم‌خوان نیست.",
                  "status": 400,
                  "code": "validation_failed",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "401": {
            "description": "`key_revoked`: این کلید API باطل شده است.\n\n`unauthorized`: برای این درخواست کلید API معتبر لازم است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/key_revoked",
                  "title": "This API key has been revoked.",
                  "title_fa": "این کلید API باطل شده است.",
                  "status": 401,
                  "code": "key_revoked",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "403": {
            "description": "`entitlement_required`: پلن فعلی شما این قابلیت را ندارد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/entitlement_required",
                  "title": "Your plan does not include this capability.",
                  "title_fa": "پلن فعلی شما این قابلیت را ندارد.",
                  "status": 403,
                  "code": "entitlement_required",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: منبع خواسته‌شده پیدا نشد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/not_found",
                  "title": "The resource was not found.",
                  "title_fa": "منبع خواسته‌شده پیدا نشد.",
                  "status": 404,
                  "code": "not_found",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.\n\n`idempotency_in_progress`: درخواستی با همین Idempotency-Key هنوز در حال پردازش است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/idempotency_conflict",
                  "title": "This Idempotency-Key was already used with a different request.",
                  "title_fa": "این Idempotency-Key پیش‌تر با درخواست دیگری به کار رفته است.",
                  "status": 409,
                  "code": "idempotency_conflict",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-taghvim-contract": "contract.webhooks.testWebhook@2.0.0",
        "x-taghvim-summary-en": "Send a test delivery",
        "x-taghvim-auth": "api_key",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": "webhooks",
        "x-taghvim-idempotency": "optional",
        "x-taghvim-emits": [
          "taghvim.event.webhook.ping.v1"
        ],
        "x-taghvim-errors": [
          "entitlement_required",
          "idempotency_conflict",
          "idempotency_in_progress",
          "internal_error",
          "key_revoked",
          "not_found",
          "unauthorized",
          "validation_failed"
        ]
      }
    },
    "/v1/connectors/payment/standard": {
      "get": {
        "tags": [
          "connectors"
        ],
        "operationId": "getPaymentConnectorStandard",
        "summary": "استاندارد اتصال پرداخت",
        "description": "The payment connector standard",
        "responses": {
          "200": {
            "description": "PaymentConnectorStandard",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentConnectorStandard"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [],
        "x-taghvim-contract": "contract.connectors.getPaymentConnectorStandard@2.0.0",
        "x-taghvim-summary-en": "The payment connector standard",
        "x-taghvim-auth": "none",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error"
        ]
      }
    },
    "/v1/connectors/payment/manifests/validate": {
      "post": {
        "tags": [
          "connectors"
        ],
        "operationId": "validateAdapterManifest",
        "summary": "بررسی مانیفست آداپتور",
        "description": "Validate an adapter manifest",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnyObject"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ManifestValidation",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManifestValidation"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_json`: بدنه‌ی درخواست JSON معتبر نیست.\n\n`validation_failed`: درخواست با قرارداد API هم‌خوان نیست.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/invalid_json",
                  "title": "The request body is not valid JSON.",
                  "title_fa": "بدنه‌ی درخواست JSON معتبر نیست.",
                  "status": 400,
                  "code": "invalid_json",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: حجم بدنه‌ی درخواست بیش از حد مجاز است.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/payload_too_large",
                  "title": "The request body is too large.",
                  "title_fa": "حجم بدنه‌ی درخواست بیش از حد مجاز است.",
                  "status": 413,
                  "code": "payload_too_large",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: بدنه‌ی درخواست را با نوع application/json بفرستید.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/unsupported_media_type",
                  "title": "Send the body as application/json.",
                  "title_fa": "بدنه‌ی درخواست را با نوع application/json بفرستید.",
                  "status": 415,
                  "code": "unsupported_media_type",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": false
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: خطای پیش‌بینی‌نشده‌ای رخ داد.",
            "headers": {
              "Taghvim-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "type": "https://taghvim.dev/errors/internal_error",
                  "title": "An unexpected error occurred.",
                  "title_fa": "خطای پیش‌بینی‌نشده‌ای رخ داد.",
                  "status": 500,
                  "code": "internal_error",
                  "request_id": "req_01JABCDEFGHJKMNPQRSTVWXYZ0",
                  "retryable": true
                }
              }
            }
          }
        },
        "security": [],
        "x-taghvim-contract": "contract.connectors.validateAdapterManifest@2.0.0",
        "x-taghvim-summary-en": "Validate an adapter manifest",
        "x-taghvim-auth": "none",
        "x-taghvim-meter": null,
        "x-taghvim-weight": 0,
        "x-taghvim-entitlement": null,
        "x-taghvim-idempotency": "none",
        "x-taghvim-emits": [],
        "x-taghvim-errors": [
          "internal_error",
          "invalid_json",
          "payload_too_large",
          "unsupported_media_type",
          "validation_failed"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AdjacentBusinessDay": {
        "title": "AdjacentBusinessDay",
        "type": "object",
        "required": [
          "from",
          "direction",
          "result",
          "calendar_days",
          "calendar_data_version"
        ],
        "properties": {
          "from": {
            "$ref": "#/components/schemas/DayRef"
          },
          "direction": {
            "enum": [
              "next",
              "previous"
            ]
          },
          "result": {
            "$ref": "#/components/schemas/Day"
          },
          "calendar_days": {
            "type": "integer"
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "AmbiguityPolicy": {
        "title": "AmbiguityPolicy",
        "description": "What to do when the text leaves something to assume (today: a missing year). The build replaces this with the enum of config calendar.resolution.ambiguity_policies.",
        "type": "string",
        "enum": [
          "assume_and_report",
          "return_candidates",
          "reject"
        ]
      },
      "AmountIrr": {
        "title": "AmountIrr",
        "description": "An amount in integer Iranian Rial.",
        "type": "integer",
        "minimum": 0
      },
      "AnyObject": {
        "title": "AnyObject",
        "type": "object"
      },
      "ApiKey": {
        "title": "ApiKey",
        "type": "object",
        "required": [
          "id",
          "name",
          "environment",
          "display",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^key_"
          },
          "name": {
            "type": "string"
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          },
          "display": {
            "type": "string",
            "pattern": "^tgv_(live|test)_",
            "description": "Prefix and last four characters; the secret is never stored."
          },
          "status": {
            "enum": [
              "active",
              "revoked"
            ]
          },
          "created_at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "last_used_at": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "revoked_at": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ApiKeyList": {
        "title": "ApiKeyList",
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKey"
            }
          }
        }
      },
      "ApiKeyWithSecret": {
        "title": "ApiKeyWithSecret",
        "allOf": [
          {
            "$ref": "#/components/schemas/ApiKey"
          }
        ],
        "type": "object",
        "required": [
          "secret"
        ],
        "properties": {
          "secret": {
            "type": "string",
            "pattern": "^tgv_(live|test)_[A-Za-z0-9]{20,}$",
            "description": "Shown once. Store it in a secret manager."
          }
        }
      },
      "BillingExport": {
        "title": "BillingExport",
        "type": "object",
        "required": [
          "period",
          "currency",
          "tenants"
        ],
        "properties": {
          "period": {
            "$ref": "#/components/schemas/Period"
          },
          "currency": {
            "const": "IRR"
          },
          "tenants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageExport"
            }
          }
        }
      },
      "BusinessDaysAddRequest": {
        "title": "BusinessDaysAddRequest",
        "type": "object",
        "required": [
          "date",
          "days"
        ],
        "additionalProperties": false,
        "properties": {
          "date": {
            "$ref": "#/components/schemas/DateInput"
          },
          "days": {
            "type": "integer",
            "minimum": -3650,
            "maximum": 3650,
            "description": "Business days to add; negative goes back."
          }
        },
        "examples": [
          {
            "date": "1405-07-15",
            "days": 30
          }
        ]
      },
      "BusinessDaysAddResponse": {
        "title": "BusinessDaysAddResponse",
        "type": "object",
        "required": [
          "from",
          "days",
          "result",
          "calendar_days",
          "depends_on_predicted_holiday",
          "calendar_data_version"
        ],
        "properties": {
          "from": {
            "$ref": "#/components/schemas/Day"
          },
          "days": {
            "type": "integer"
          },
          "result": {
            "$ref": "#/components/schemas/Day"
          },
          "calendar_days": {
            "type": "integer"
          },
          "depends_on_predicted_holiday": {
            "type": "boolean"
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "BusinessDaysDiffRequest": {
        "title": "BusinessDaysDiffRequest",
        "type": "object",
        "required": [
          "from",
          "to"
        ],
        "additionalProperties": false,
        "properties": {
          "from": {
            "$ref": "#/components/schemas/DateInput"
          },
          "to": {
            "$ref": "#/components/schemas/DateInput"
          }
        },
        "examples": [
          {
            "from": "1405-07-15",
            "to": "1405-08-15"
          }
        ]
      },
      "BusinessDaysDiffResponse": {
        "title": "BusinessDaysDiffResponse",
        "type": "object",
        "required": [
          "from",
          "to",
          "calendar_days",
          "business_days",
          "days_off",
          "depends_on_predicted_holiday",
          "calendar_data_version"
        ],
        "properties": {
          "from": {
            "$ref": "#/components/schemas/DayRef"
          },
          "to": {
            "$ref": "#/components/schemas/DayRef"
          },
          "calendar_days": {
            "type": "integer",
            "minimum": 0
          },
          "business_days": {
            "type": "integer",
            "minimum": 0
          },
          "days_off": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "jalali",
                "iso",
                "reason",
                "titles"
              ],
              "properties": {
                "jalali": {
                  "type": "string"
                },
                "iso": {
                  "type": "string",
                  "format": "date"
                },
                "reason": {
                  "enum": [
                    "weekend",
                    "holiday"
                  ]
                },
                "titles": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "depends_on_predicted_holiday": {
            "type": "boolean"
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "BusinessDayStatus": {
        "title": "BusinessDayStatus",
        "type": "object",
        "required": [
          "date",
          "business_day",
          "reason",
          "predicted",
          "previous_business_day",
          "next_business_day",
          "calendar_data_version"
        ],
        "properties": {
          "date": {
            "$ref": "#/components/schemas/Day"
          },
          "business_day": {
            "type": "boolean"
          },
          "reason": {
            "enum": [
              "weekend",
              "holiday",
              null
            ]
          },
          "predicted": {
            "type": "boolean"
          },
          "previous_business_day": {
            "$ref": "#/components/schemas/DayRef"
          },
          "next_business_day": {
            "$ref": "#/components/schemas/DayRef"
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "CalendarDataVersion": {
        "title": "CalendarDataVersion",
        "description": "Version of the holiday and calendar data that produced the answer.",
        "type": "string",
        "examples": [
          "iran-2026.10.01"
        ]
      },
      "CalendarSystems": {
        "title": "CalendarSystems",
        "type": "object",
        "required": [
          "systems",
          "business_day_profile",
          "timezone",
          "calendar_data_version"
        ],
        "properties": {
          "systems": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "name_fa",
                "year_range"
              ],
              "properties": {
                "id": {
                  "enum": [
                    "jalali",
                    "gregorian",
                    "hijri"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "name_fa": {
                  "type": "string"
                },
                "year_range": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "minItems": 2,
                  "maxItems": 2
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "business_day_profile": {
            "type": "object",
            "required": [
              "id",
              "weekend",
              "description_fa"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "weekend": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 7
                },
                "description": "ISO weekdays off (5 = Friday)."
              },
              "description_fa": {
                "type": "string"
              }
            }
          },
          "timezone": {
            "const": "Asia/Tehran"
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "ConnectorAdapterManifest": {
        "title": "ConnectorAdapterManifest",
        "description": "Manifest every payment adapter ships with: who built it, which gateway API version it pins, what it can do and which secrets it needs.",
        "type": "object",
        "required": [
          "standard",
          "standard_version",
          "id",
          "name",
          "version",
          "publisher",
          "provider",
          "capabilities",
          "currencies",
          "amount_limits",
          "secrets"
        ],
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "type": "string"
          },
          "standard": {
            "const": "taghvim.payment_connector"
          },
          "standard_version": {
            "type": "string",
            "pattern": "^2\\.\\d+\\.\\d+$",
            "description": "The standard major this adapter implements (contracts/connector/payment/v2/standard.json)."
          },
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{1,62}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "name_fa": {
            "type": "string",
            "maxLength": 120
          },
          "version": {
            "type": "string",
            "pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$"
          },
          "publisher": {
            "type": "object",
            "required": [
              "name"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "url": {
                "type": "string",
                "pattern": "^https://"
              },
              "email": {
                "type": "string",
                "format": "email"
              }
            }
          },
          "provider": {
            "type": "object",
            "required": [
              "name",
              "api_version"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "api_version": {
                "type": "string",
                "minLength": 1,
                "description": "The gateway API version this adapter pins."
              },
              "docs_url": {
                "type": "string",
                "pattern": "^https://"
              },
              "verified_on": {
                "type": "string",
                "format": "date"
              }
            }
          },
          "capabilities": {
            "type": "object",
            "required": [
              "create_payment",
              "verify",
              "inquiry",
              "refund",
              "settlement",
              "webhooks"
            ],
            "additionalProperties": false,
            "properties": {
              "create_payment": {
                "const": true
              },
              "verify": {
                "const": true
              },
              "inquiry": {
                "type": "boolean"
              },
              "refund": {
                "type": "object",
                "required": [
                  "supported",
                  "partial"
                ],
                "additionalProperties": false,
                "properties": {
                  "supported": {
                    "type": "boolean"
                  },
                  "partial": {
                    "type": "boolean"
                  }
                }
              },
              "settlement": {
                "type": "boolean"
              },
              "webhooks": {
                "type": "boolean"
              }
            }
          },
          "currencies": {
            "type": "array",
            "items": {
              "const": "IRR"
            },
            "minItems": 1,
            "maxItems": 1
          },
          "amount_limits": {
            "type": "object",
            "required": [
              "min",
              "max"
            ],
            "additionalProperties": false,
            "properties": {
              "min": {
                "type": "integer",
                "minimum": 0
              },
              "max": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1
              }
            }
          },
          "callback": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "methods": {
                "type": "array",
                "items": {
                  "enum": [
                    "GET",
                    "POST"
                  ]
                },
                "minItems": 1,
                "uniqueItems": true
              },
              "expiry_minutes": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "secrets": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "description"
              ],
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[A-Z][A-Z0-9_]*$"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          },
          "sandbox": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "supported": {
                "type": "boolean"
              },
              "notes": {
                "type": "string"
              }
            }
          },
          "conformance": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "suite_version": {
                "type": "string"
              },
              "passed_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "ConnectorCallbackSignal": {
        "title": "ConnectorCallbackSignal",
        "description": "What parseCallback returns. A callback is an untrusted signal: it never marks a payment paid; only verifyPayment does.",
        "type": "object",
        "required": [
          "provider_reference",
          "signal",
          "trusted"
        ],
        "additionalProperties": false,
        "properties": {
          "provider_reference": {
            "type": "string",
            "minLength": 1
          },
          "signal": {
            "enum": [
              "paid",
              "failed",
              "cancelled"
            ]
          },
          "trusted": {
            "const": false
          },
          "raw_status": {
            "type": "string"
          }
        }
      },
      "ConnectorCreateResult": {
        "title": "ConnectorCreateResult",
        "description": "What createPayment returns: where to send the payer.",
        "type": "object",
        "required": [
          "status",
          "provider_reference",
          "redirect"
        ],
        "additionalProperties": false,
        "properties": {
          "status": {
            "const": "requires_action"
          },
          "provider_reference": {
            "type": "string",
            "minLength": 1
          },
          "redirect": {
            "type": "object",
            "required": [
              "url",
              "method"
            ],
            "additionalProperties": false,
            "properties": {
              "url": {
                "type": "string",
                "pattern": "^https://"
              },
              "method": {
                "enum": [
                  "GET",
                  "POST"
                ]
              },
              "fields": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          },
          "expires_at": {
            "$ref": "#/components/schemas/ConnectorTimestamp"
          }
        }
      },
      "ConnectorError": {
        "title": "ConnectorError",
        "type": "object",
        "required": [
          "code",
          "retryable",
          "message"
        ],
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[a-z][a-z_]*$",
            "description": "One of error-codes.json."
          },
          "retryable": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "message_fa": {
            "type": "string"
          },
          "provider_code": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ConnectorInquiryResult": {
        "title": "ConnectorInquiryResult",
        "type": "object",
        "required": [
          "status",
          "provider_reference"
        ],
        "additionalProperties": false,
        "properties": {
          "status": {
            "$ref": "#/components/schemas/ConnectorStatus"
          },
          "provider_reference": {
            "type": "string"
          },
          "amount": {
            "$ref": "#/components/schemas/ConnectorMoney"
          },
          "provider_transaction_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "raw_status": {
            "type": "string"
          }
        }
      },
      "ConnectorMoney": {
        "title": "ConnectorMoney",
        "type": "object",
        "required": [
          "amount",
          "currency"
        ],
        "additionalProperties": false,
        "properties": {
          "amount": {
            "type": "integer",
            "minimum": 0,
            "description": "Integer Rial. Never Toman, never decimals."
          },
          "currency": {
            "const": "IRR"
          }
        }
      },
      "ConnectorPaymentIntent": {
        "title": "ConnectorPaymentIntent",
        "type": "object",
        "required": [
          "id",
          "merchant_reference",
          "amount",
          "status",
          "return_url",
          "idempotency_key",
          "created_at",
          "expires_at"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 4,
            "maxLength": 64
          },
          "merchant_reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Your order or invoice number."
          },
          "amount": {
            "$ref": "#/components/schemas/ConnectorMoney"
          },
          "status": {
            "$ref": "#/components/schemas/ConnectorStatus"
          },
          "description": {
            "type": "string",
            "maxLength": 255
          },
          "payer": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "mobile": {
                "type": "string",
                "pattern": "^09\\d{9}$"
              },
              "national_code": {
                "type": "string",
                "pattern": "^\\d{10}$"
              }
            }
          },
          "return_url": {
            "type": "string",
            "pattern": "^https://",
            "maxLength": 255
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128
          },
          "created_at": {
            "$ref": "#/components/schemas/ConnectorTimestamp"
          },
          "expires_at": {
            "$ref": "#/components/schemas/ConnectorTimestamp"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 500
            },
            "maxProperties": 20
          }
        }
      },
      "ConnectorRefundRequest": {
        "title": "ConnectorRefundRequest",
        "type": "object",
        "required": [
          "intent_id",
          "provider_reference",
          "amount",
          "idempotency_key"
        ],
        "additionalProperties": false,
        "properties": {
          "intent_id": {
            "type": "string"
          },
          "provider_reference": {
            "type": "string"
          },
          "amount": {
            "$ref": "#/components/schemas/ConnectorMoney"
          },
          "reason": {
            "type": "string",
            "maxLength": 255
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128
          }
        }
      },
      "ConnectorRefundResult": {
        "title": "ConnectorRefundResult",
        "type": "object",
        "required": [
          "refund_id",
          "status",
          "amount"
        ],
        "additionalProperties": false,
        "properties": {
          "refund_id": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "succeeded",
              "failed"
            ]
          },
          "amount": {
            "$ref": "#/components/schemas/ConnectorMoney"
          },
          "error": {
            "$ref": "#/components/schemas/ConnectorError"
          }
        }
      },
      "ConnectorSettlementReport": {
        "title": "ConnectorSettlementReport",
        "description": "Settlement and reconciliation: what the provider paid out and which payments it covers.",
        "type": "object",
        "required": [
          "from",
          "to",
          "settlements"
        ],
        "additionalProperties": false,
        "properties": {
          "from": {
            "$ref": "#/components/schemas/ConnectorTimestamp"
          },
          "to": {
            "$ref": "#/components/schemas/ConnectorTimestamp"
          },
          "settlements": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "status",
                "amount",
                "provider_references"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "status": {
                  "enum": [
                    "pending",
                    "processing",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "amount": {
                  "$ref": "#/components/schemas/ConnectorMoney"
                },
                "fee": {
                  "$ref": "#/components/schemas/ConnectorMoney"
                },
                "provider_references": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "settled_at": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ConnectorTimestamp"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "raw_status": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ConnectorStatus": {
        "title": "ConnectorStatus",
        "description": "States of the canonical status machine (status-machine.json).",
        "enum": [
          "created",
          "requires_action",
          "processing",
          "succeeded",
          "failed",
          "cancelled",
          "expired",
          "partially_refunded",
          "refunded"
        ]
      },
      "ConnectorTimestamp": {
        "title": "ConnectorTimestamp",
        "type": "object",
        "required": [
          "iso",
          "jalali",
          "timezone"
        ],
        "additionalProperties": false,
        "properties": {
          "iso": {
            "type": "string",
            "format": "date-time"
          },
          "jalali": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"
          },
          "timezone": {
            "const": "Asia/Tehran"
          }
        }
      },
      "ConnectorVerifyResult": {
        "title": "ConnectorVerifyResult",
        "type": "object",
        "required": [
          "status",
          "amount",
          "provider_reference"
        ],
        "additionalProperties": false,
        "properties": {
          "status": {
            "enum": [
              "succeeded",
              "failed",
              "processing"
            ]
          },
          "amount": {
            "$ref": "#/components/schemas/ConnectorMoney"
          },
          "fee": {
            "$ref": "#/components/schemas/ConnectorMoney"
          },
          "provider_reference": {
            "type": "string"
          },
          "provider_transaction_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_mask": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9*]{12,19}$"
          },
          "paid_at": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectorTimestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "already_verified": {
            "type": "boolean"
          },
          "raw_status": {
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/ConnectorError"
          }
        }
      },
      "ConnectorWebhookEnvelope": {
        "title": "ConnectorWebhookEnvelope",
        "description": "Signed envelope for every asynchronous notification. Headers: Taghvim-Signature: t=<unix seconds>,kid=<key id>,v1=<hex HMAC-SHA256 of '<t>.<raw body>'> and Taghvim-Timestamp: <t>. Receivers reject a timestamp outside the replay window (300 s) and dedupe on id.",
        "type": "object",
        "required": [
          "id",
          "type",
          "created_at",
          "adapter",
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 8,
            "maxLength": 64
          },
          "type": {
            "enum": [
              "taghvim.connector.payment_succeeded.v1",
              "taghvim.connector.payment_failed.v1",
              "taghvim.connector.payment_expired.v1",
              "taghvim.connector.refund_succeeded.v1",
              "taghvim.connector.refund_failed.v1",
              "taghvim.connector.settlement_completed.v1"
            ]
          },
          "created_at": {
            "$ref": "#/components/schemas/ConnectorTimestamp"
          },
          "adapter": {
            "type": "object",
            "required": [
              "id",
              "version"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "intent_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "data": {
            "type": "object"
          }
        }
      },
      "ConvertRequest": {
        "title": "ConvertRequest",
        "type": "object",
        "required": [
          "date"
        ],
        "additionalProperties": false,
        "properties": {
          "date": {
            "$ref": "#/components/schemas/DateInput"
          },
          "calendar_system": {
            "enum": [
              "jalali",
              "gregorian",
              "hijri"
            ],
            "description": "Read a numeric date in this calendar (needed for numeric Hijri dates such as 1448-04-26)."
          }
        },
        "examples": [
          {
            "date": "1405-07-15"
          }
        ]
      },
      "ConvertResponse": {
        "title": "ConvertResponse",
        "type": "object",
        "required": [
          "input",
          "date",
          "calendar_data_version"
        ],
        "properties": {
          "input": {
            "type": "object",
            "required": [
              "text",
              "calendar_system"
            ],
            "properties": {
              "text": {
                "type": "string"
              },
              "calendar_system": {
                "enum": [
                  "jalali",
                  "gregorian",
                  "hijri"
                ]
              }
            }
          },
          "date": {
            "$ref": "#/components/schemas/Day"
          },
          "leap_year": {
            "type": "boolean",
            "description": "Whether the Jalali year is a leap year."
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "CreateKeyRequest": {
        "title": "CreateKeyRequest",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          }
        },
        "examples": [
          {
            "name": "server",
            "environment": "live"
          }
        ]
      },
      "CreateTenantRequest": {
        "title": "CreateTenantRequest",
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "billing_email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "environment": {
            "$ref": "#/components/schemas/Environment",
            "default": "test"
          }
        },
        "examples": [
          {
            "name": "Acme Clinic",
            "billing_email": "billing@example.com",
            "environment": "test"
          }
        ]
      },
      "DateInput": {
        "title": "DateInput",
        "description": "A date: Jalali (1405-07-15, ۱۴۰۵/۷/۱۵, ۱۵ مهر ۱۴۰۵), Gregorian ISO (2026-10-07) or Hijri with month name (26 ربیع‌الثانی 1448). Persian and Arabic digits are accepted.",
        "type": "string",
        "minLength": 6,
        "maxLength": 64,
        "examples": [
          "1405-07-15"
        ]
      },
      "Day": {
        "title": "Day",
        "description": "One civil day in the Jalali, Gregorian and Hijri (Umm al-Qura) calendars with its business-day status (Iran, bank profile).",
        "type": "object",
        "required": [
          "iso",
          "jalali",
          "hijri",
          "weekday",
          "business_day",
          "holidays"
        ],
        "properties": {
          "iso": {
            "type": "string",
            "format": "date",
            "examples": [
              "2026-10-07"
            ]
          },
          "jalali": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "examples": [
              "1405-07-15"
            ]
          },
          "hijri": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "examples": [
              "1448-04-26"
            ]
          },
          "weekday": {
            "type": "integer",
            "minimum": 1,
            "maximum": 7,
            "description": "ISO weekday: 1 Monday … 7 Sunday."
          },
          "weekday_fa": {
            "type": "string",
            "examples": [
              "چهارشنبه"
            ]
          },
          "jalali_text_fa": {
            "type": "string",
            "examples": [
              "۱۵ مهر ۱۴۰۵"
            ]
          },
          "business_day": {
            "type": "boolean"
          },
          "holidays": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "predicted_holiday": {
            "type": "boolean",
            "description": "True when a lunar holiday on this day is predicted and not yet officially announced."
          }
        }
      },
      "DayRef": {
        "title": "DayRef",
        "type": "object",
        "required": [
          "iso",
          "jalali"
        ],
        "properties": {
          "iso": {
            "type": "string",
            "format": "date"
          },
          "jalali": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        }
      },
      "Deadline": {
        "title": "Deadline",
        "type": "object",
        "required": [
          "id",
          "status",
          "anchor",
          "rule",
          "due",
          "moved_days",
          "depends_on_predicted_holiday",
          "created_at",
          "calendar_data_version"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ddl_"
          },
          "status": {
            "enum": [
              "active"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "anchor": {
            "$ref": "#/components/schemas/Day"
          },
          "rule": {
            "type": "object",
            "required": [
              "days",
              "type",
              "roll"
            ],
            "properties": {
              "days": {
                "type": "integer"
              },
              "type": {
                "enum": [
                  "business",
                  "calendar"
                ]
              },
              "roll": {
                "$ref": "#/components/schemas/Roll"
              }
            }
          },
          "due": {
            "$ref": "#/components/schemas/Day"
          },
          "moved_days": {
            "type": "integer"
          },
          "depends_on_predicted_holiday": {
            "type": "boolean"
          },
          "created_at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "DeadlineRequest": {
        "title": "DeadlineRequest",
        "type": "object",
        "required": [
          "anchor",
          "days"
        ],
        "additionalProperties": false,
        "properties": {
          "anchor": {
            "$ref": "#/components/schemas/DateInput"
          },
          "days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3650
          },
          "type": {
            "enum": [
              "business",
              "calendar"
            ],
            "default": "business"
          },
          "roll": {
            "$ref": "#/components/schemas/Roll"
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "subject_ref": {
            "type": "string",
            "maxLength": 200
          }
        },
        "examples": [
          {
            "anchor": "1405-07-15",
            "days": 10,
            "type": "business"
          }
        ]
      },
      "Delivery": {
        "title": "Delivery",
        "type": "object",
        "required": [
          "id",
          "webhook_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^del_"
          },
          "webhook_id": {
            "type": "string"
          },
          "event_id": {
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "succeeded",
              "failed",
              "exhausted"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "last_status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "delivered_at": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DeliveryList": {
        "title": "DeliveryList",
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Delivery"
            }
          }
        }
      },
      "Environment": {
        "title": "Environment",
        "enum": [
          "live",
          "test"
        ]
      },
      "Event": {
        "title": "Event",
        "description": "Canonical event envelope; also the body of every webhook delivery.",
        "type": "object",
        "required": [
          "id",
          "type",
          "version",
          "source",
          "occurred_at",
          "tenant_id",
          "subject",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^evtlog_",
            "description": "Event-log id (evtlog_); evt_ is reserved for calendar events."
          },
          "type": {
            "$ref": "#/components/schemas/EventType"
          },
          "version": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "occurred_at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "tenant_id": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "data": {
            "type": "object"
          }
        }
      },
      "EventList": {
        "title": "EventList",
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          }
        }
      },
      "EventType": {
        "title": "EventType",
        "description": "A canonical event type, taghvim.event.<aggregate>.<verb>.v<major>. The build replaces this with the enum of data/events.json.",
        "type": "string",
        "enum": [
          "taghvim.event.tenant.created.v1",
          "taghvim.event.api_key.created.v1",
          "taghvim.event.api_key.revoked.v1",
          "taghvim.event.quota.threshold.reached.v1",
          "taghvim.event.quota.exceeded.v1",
          "taghvim.event.payment.intent.created.v1",
          "taghvim.event.payment.intent.verified.v1",
          "taghvim.event.payment.intent.failed.v1",
          "taghvim.event.payment.intent.cancelled.v1",
          "taghvim.event.payment.intent.expired.v1",
          "taghvim.event.subscription.upgraded.v1",
          "taghvim.event.reconciliation.case.opened.v1",
          "taghvim.event.deadline.created.v1",
          "taghvim.event.webhook.ping.v1"
        ]
      },
      "EventTypeList": {
        "title": "EventTypeList",
        "type": "object",
        "required": [
          "catalog_version",
          "data"
        ],
        "properties": {
          "catalog_version": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type",
                "webhook",
                "description",
                "description_fa"
              ],
              "properties": {
                "type": {
                  "$ref": "#/components/schemas/EventType"
                },
                "webhook": {
                  "type": "boolean"
                },
                "description": {
                  "type": "string"
                },
                "description_fa": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Health": {
        "title": "Health",
        "type": "object",
        "required": [
          "status",
          "service",
          "version",
          "time",
          "calendar_data_version"
        ],
        "properties": {
          "status": {
            "const": "ok"
          },
          "service": {
            "const": "Taghvim Engine"
          },
          "version": {
            "type": "string"
          },
          "time": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "Holiday": {
        "title": "Holiday",
        "type": "object",
        "required": [
          "jalali",
          "iso",
          "title",
          "kind",
          "status"
        ],
        "properties": {
          "jalali": {
            "type": "string"
          },
          "iso": {
            "type": "string",
            "format": "date"
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "solar",
              "lunar",
              "finance",
              "culture"
            ]
          },
          "status": {
            "enum": [
              "official",
              "predicted",
              "fixed"
            ]
          }
        }
      },
      "HolidayDay": {
        "title": "HolidayDay",
        "type": "object",
        "required": [
          "date",
          "holiday",
          "holidays",
          "calendar_data_version"
        ],
        "properties": {
          "date": {
            "$ref": "#/components/schemas/Day"
          },
          "holiday": {
            "type": "boolean"
          },
          "holidays": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday"
            }
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "HolidayList": {
        "title": "HolidayList",
        "type": "object",
        "required": [
          "year",
          "month",
          "count",
          "holidays",
          "calendar_data_version"
        ],
        "properties": {
          "year": {
            "type": "integer"
          },
          "month": {
            "type": [
              "integer",
              "null"
            ]
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "holidays": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday"
            }
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "IsBusinessDayRequest": {
        "title": "IsBusinessDayRequest",
        "type": "object",
        "required": [
          "date"
        ],
        "additionalProperties": false,
        "properties": {
          "date": {
            "$ref": "#/components/schemas/DateInput"
          }
        },
        "examples": [
          {
            "date": "1405-07-15"
          }
        ]
      },
      "ManifestValidation": {
        "title": "ManifestValidation",
        "type": "object",
        "required": [
          "valid",
          "errors",
          "standard_version"
        ],
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "standard_version": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "pointer",
                "message"
              ],
              "properties": {
                "pointer": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Me": {
        "title": "Me",
        "type": "object",
        "required": [
          "tenant",
          "api_key",
          "plan",
          "entitlements"
        ],
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/Tenant"
          },
          "api_key": {
            "$ref": "#/components/schemas/ApiKey"
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "entitlements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PaymentConnectorStandard": {
        "title": "PaymentConnectorStandard",
        "type": "object",
        "required": [
          "name",
          "version",
          "status_machine",
          "error_codes",
          "operations",
          "signature"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "operations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status_machine": {
            "type": "object"
          },
          "error_codes": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "signature": {
            "type": "object"
          }
        }
      },
      "PaymentIntent": {
        "title": "PaymentIntent",
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "plan_id",
          "amount_irr",
          "currency",
          "status",
          "provider",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^pay_"
          },
          "tenant_id": {
            "type": "string"
          },
          "plan_id": {
            "type": "string"
          },
          "amount_irr": {
            "$ref": "#/components/schemas/AmountIrr"
          },
          "currency": {
            "const": "IRR"
          },
          "status": {
            "$ref": "#/components/schemas/PaymentIntentStatus"
          },
          "provider": {
            "const": "vandar"
          },
          "environment": {
            "enum": [
              "live",
              "test"
            ]
          },
          "redirect_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send the payer here (single use)."
          },
          "failure_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "receipt_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "expires_at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "verified_at": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PaymentIntentCreateRequest": {
        "title": "PaymentIntentCreateRequest",
        "description": "Buy a plan: the amount comes from the pricebook, never from the request.",
        "type": "object",
        "required": [
          "plan_id"
        ],
        "additionalProperties": false,
        "properties": {
          "plan_id": {
            "type": "string",
            "pattern": "^plan_[a-z]+$"
          },
          "mobile_number": {
            "type": "string",
            "pattern": "^09\\d{9}$",
            "description": "Optional payer mobile; the provider shows the payer's saved cards."
          }
        },
        "examples": [
          {
            "plan_id": "plan_builder"
          }
        ]
      },
      "PaymentIntentStatus": {
        "title": "PaymentIntentStatus",
        "enum": [
          "requires_action",
          "verifying",
          "succeeded",
          "failed",
          "cancelled",
          "expired"
        ]
      },
      "Period": {
        "title": "Period",
        "description": "A Jalali calendar month in Tehran time.",
        "type": "object",
        "required": [
          "key",
          "start",
          "end"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}$",
            "examples": [
              "1405-07"
            ]
          },
          "start": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "end": {
            "$ref": "#/components/schemas/Timestamp"
          }
        }
      },
      "Plan": {
        "title": "Plan",
        "type": "object",
        "required": [
          "id",
          "version",
          "name",
          "name_fa",
          "price_irr",
          "period",
          "included_operations",
          "purchasable",
          "entitlements"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^plan_"
          },
          "version": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "name_fa": {
            "type": "string"
          },
          "price_irr": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AmountIrr"
              },
              {
                "type": "null"
              }
            ]
          },
          "period": {
            "const": "month"
          },
          "included_operations": {
            "type": [
              "integer",
              "null"
            ]
          },
          "purchasable": {
            "type": "boolean"
          },
          "entitlements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PlanList": {
        "title": "PlanList",
        "type": "object",
        "required": [
          "pricebook_version",
          "currency",
          "commercial_status",
          "operation_weights",
          "data"
        ],
        "properties": {
          "pricebook_version": {
            "type": "string"
          },
          "currency": {
            "const": "IRR"
          },
          "commercial_status": {
            "enum": [
              "illustrative",
              "locked"
            ]
          },
          "operation_weights": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          }
        }
      },
      "Problem": {
        "title": "Problem",
        "description": "Structured error (RFC 9457 problem details) with a stable code and Persian title.",
        "type": "object",
        "required": [
          "type",
          "title",
          "title_fa",
          "status",
          "code",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "pattern": "^https://taghvim\\.dev/errors/[a-z_]+$",
            "examples": [
              "https://taghvim.dev/errors/quota_exceeded"
            ]
          },
          "title": {
            "type": "string"
          },
          "title_fa": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599
          },
          "code": {
            "type": "string",
            "pattern": "^[a-z][a-z_]*$"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "request_id": {
            "type": "string",
            "pattern": "^req_"
          },
          "retryable": {
            "type": "boolean"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "pointer",
                "message"
              ],
              "properties": {
                "pointer": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Step"
            }
          }
        }
      },
      "Readiness": {
        "title": "Readiness",
        "type": "object",
        "required": [
          "status",
          "checks"
        ],
        "properties": {
          "status": {
            "enum": [
              "ready",
              "degraded"
            ]
          },
          "checks": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "required": [
                "ok"
              ],
              "properties": {
                "ok": {
                  "type": "boolean"
                },
                "detail": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Receipt": {
        "title": "Receipt",
        "description": "Proof of a verified payment, with Persian presentation fields.",
        "type": "object",
        "required": [
          "id",
          "receipt_type",
          "status",
          "subject_ref",
          "tenant_id",
          "issued_at",
          "result",
          "presentation_fa",
          "checksum"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^rcpt_"
          },
          "receipt_type": {
            "const": "payment.subscription"
          },
          "status": {
            "enum": [
              "succeeded"
            ]
          },
          "subject_ref": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "issued_at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "result": {
            "type": "object",
            "required": [
              "plan_id",
              "amount_irr",
              "provider_reference"
            ],
            "properties": {
              "plan_id": {
                "type": "string"
              },
              "amount_irr": {
                "type": "integer"
              },
              "provider_reference": {
                "type": "string"
              },
              "card_mask": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "paid_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "presentation_fa": {
            "type": "object",
            "required": [
              "title",
              "lines"
            ],
            "properties": {
              "title": {
                "type": "string"
              },
              "lines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "label",
                    "value"
                  ],
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "email_status": {
            "enum": [
              "not_configured",
              "sent",
              "failed",
              "no_recipient"
            ]
          },
          "checksum": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$"
          }
        }
      },
      "RemindersRequest": {
        "title": "RemindersRequest",
        "type": "object",
        "required": [
          "due",
          "offsets"
        ],
        "additionalProperties": false,
        "properties": {
          "due": {
            "$ref": "#/components/schemas/DateInput"
          },
          "time": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "default": "09:00"
          },
          "offsets": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "object",
              "required": [
                "n",
                "unit"
              ],
              "additionalProperties": false,
              "properties": {
                "n": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 365
                },
                "unit": {
                  "enum": [
                    "business",
                    "calendar"
                  ]
                }
              }
            }
          }
        },
        "examples": [
          {
            "due": "1405-08-20",
            "time": "09:00",
            "offsets": [
              {
                "n": 7,
                "unit": "calendar"
              },
              {
                "n": 3,
                "unit": "business"
              },
              {
                "n": 0,
                "unit": "calendar"
              }
            ]
          }
        ]
      },
      "RemindersResponse": {
        "title": "RemindersResponse",
        "type": "object",
        "required": [
          "due",
          "reminders",
          "calendar_data_version"
        ],
        "properties": {
          "due": {
            "$ref": "#/components/schemas/DayRef"
          },
          "reminders": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "offset",
                "at",
                "moved_days",
                "depends_on_predicted_holiday"
              ],
              "properties": {
                "offset": {
                  "type": "object",
                  "required": [
                    "n",
                    "unit"
                  ],
                  "properties": {
                    "n": {
                      "type": "integer"
                    },
                    "unit": {
                      "enum": [
                        "business",
                        "calendar"
                      ]
                    }
                  }
                },
                "at": {
                  "$ref": "#/components/schemas/Timestamp"
                },
                "moved_days": {
                  "type": "integer"
                },
                "depends_on_predicted_holiday": {
                  "type": "boolean"
                }
              }
            }
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "ResolvedInstant": {
        "title": "ResolvedInstant",
        "type": "object",
        "required": [
          "instant",
          "timezone",
          "jalali",
          "gregorian"
        ],
        "properties": {
          "instant": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "const": "Asia/Tehran"
          },
          "jalali": {
            "type": "string",
            "examples": [
              "1405-07-19 10:00"
            ]
          },
          "gregorian": {
            "type": "string",
            "examples": [
              "2026-10-11 10:00"
            ]
          }
        }
      },
      "ResolveRequest": {
        "title": "ResolveRequest",
        "type": "object",
        "required": [
          "text"
        ],
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "An explicit date (1405-07-15, ۱۵ مهر ۱۴۰۵, 2026-10-07, امروز), a relative day (فردا, پس‌فردا, دیروز) or an offset «N روز [کاری] بعد|قبل [از <date>]», with an optional «ساعت HH:MM». A day and month without a year means this Jalali year (reported in assumptions).",
            "examples": [
              "۱۵ مهر ۱۴۰۵",
              "سه روز کاری بعد از ۱۵ مهر ساعت ۱۰",
              "فردا",
              "۵ روز قبل"
            ]
          },
          "locale": {
            "const": "fa-IR",
            "default": "fa-IR"
          },
          "timezone": {
            "const": "Asia/Tehran",
            "default": "Asia/Tehran"
          },
          "calendar_system": {
            "const": "jalali",
            "default": "jalali",
            "description": "Persian expressions are read on the Jalali calendar."
          },
          "reference_instant": {
            "type": "string",
            "format": "date-time",
            "description": "The instant that «today», «فردا» and a missing year are relative to; defaults to now.",
            "examples": [
              "2026-09-29T20:00:00Z"
            ]
          },
          "ambiguity_policy": {
            "$ref": "#/components/schemas/AmbiguityPolicy"
          }
        },
        "examples": [
          {
            "text": "سه روز کاری بعد از ۱۵ مهر ساعت ۱۰",
            "locale": "fa-IR",
            "calendar_system": "jalali",
            "timezone": "Asia/Tehran",
            "reference_instant": "2026-09-29T20:00:00Z",
            "ambiguity_policy": "return_candidates"
          },
          {
            "text": "۱۵ مهر ۱۴۰۵",
            "locale": "fa-IR"
          }
        ]
      },
      "ResolveResponse": {
        "title": "ResolveResponse",
        "type": "object",
        "required": [
          "resolution_id",
          "status",
          "normalized_expression",
          "resolved",
          "confidence",
          "jalali",
          "iso",
          "timezone",
          "business_day",
          "depends_on_predicted_holiday",
          "assumptions",
          "candidates",
          "ambiguity_policy",
          "reference_instant",
          "steps",
          "calendar_data_version"
        ],
        "properties": {
          "status": {
            "enum": [
              "resolved",
              "ambiguous"
            ]
          },
          "jalali": {
            "type": "string"
          },
          "iso": {
            "type": "string"
          },
          "time": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "description": "Wall time in Asia/Tehran when the text gave one (ساعت ۱۰ → 10:00)."
          },
          "timezone": {
            "const": "Asia/Tehran"
          },
          "assumptions": {
            "type": "array",
            "description": "What was assumed to resolve the text, e.g. a missing year taken as this Jalali year.",
            "items": {
              "type": "object",
              "required": [
                "kind",
                "value"
              ],
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "enum": [
                    "year"
                  ]
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "date": {
            "$ref": "#/components/schemas/Day"
          },
          "business_day": {
            "type": "boolean"
          },
          "depends_on_predicted_holiday": {
            "type": "boolean"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Step"
            }
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          },
          "resolution_id": {
            "type": "string",
            "pattern": "^resolv_"
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "ambiguity_policy": {
            "$ref": "#/components/schemas/AmbiguityPolicy"
          },
          "reference_instant": {
            "type": "string",
            "format": "date-time"
          },
          "resolved": {
            "$ref": "#/components/schemas/ResolvedInstant"
          },
          "normalized_expression": {
            "title": "NormalizedExpression",
            "type": "object",
            "required": [
              "type",
              "anchor",
              "local_time"
            ],
            "properties": {
              "type": {
                "enum": [
                  "explicit_date",
                  "relative_day",
                  "business_day_offset",
                  "calendar_day_offset"
                ]
              },
              "anchor": {
                "type": "object",
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "enum": [
                      "explicit_date",
                      "relative_day"
                    ]
                  },
                  "calendar_system": {
                    "enum": [
                      "jalali",
                      "gregorian",
                      "hijri"
                    ]
                  },
                  "text": {
                    "type": "string"
                  }
                }
              },
              "offset_business_days": {
                "type": "integer"
              },
              "offset_days": {
                "type": "integer"
              },
              "local_time": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^([01]\\d|2[0-3]):[0-5]\\d:00$"
              }
            }
          },
          "candidates": {
            "type": "array",
            "description": "With ambiguity_policy return_candidates and a missing year: this Jalali year and the next.",
            "items": {
              "type": "object",
              "required": [
                "jalali",
                "iso",
                "time",
                "resolved",
                "assumptions",
                "business_day"
              ],
              "properties": {
                "jalali": {
                  "type": "string"
                },
                "iso": {
                  "type": "string",
                  "format": "date"
                },
                "time": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "resolved": {
                  "$ref": "#/components/schemas/ResolvedInstant"
                },
                "assumptions": {
                  "type": "array"
                },
                "business_day": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "Roll": {
        "title": "Roll",
        "description": "Where a date that lands on a day off moves.",
        "type": "string",
        "enum": [
          "following",
          "modified_following",
          "preceding",
          "modified_preceding",
          "nearest",
          "none"
        ]
      },
      "SchedulePreview": {
        "title": "SchedulePreview",
        "type": "object",
        "required": [
          "rule",
          "rule_fa",
          "from",
          "occurrences",
          "calendar_data_version"
        ],
        "properties": {
          "rule": {
            "type": "string"
          },
          "rule_fa": {
            "type": "string"
          },
          "from": {
            "$ref": "#/components/schemas/DayRef"
          },
          "occurrences": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "jalali",
                "iso",
                "scheduled_iso",
                "moved_days",
                "depends_on_predicted_holiday"
              ],
              "properties": {
                "jalali": {
                  "type": "string"
                },
                "iso": {
                  "type": "string",
                  "format": "date"
                },
                "scheduled_iso": {
                  "type": "string",
                  "format": "date"
                },
                "moved_days": {
                  "type": "integer"
                },
                "depends_on_predicted_holiday": {
                  "type": "boolean"
                }
              }
            }
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "SchedulePreviewRequest": {
        "title": "SchedulePreviewRequest",
        "type": "object",
        "required": [
          "rule",
          "from"
        ],
        "additionalProperties": false,
        "properties": {
          "rule": {
            "enum": [
              "last-business",
              "first-business",
              "day-of-month",
              "weekly",
              "every-business"
            ]
          },
          "from": {
            "$ref": "#/components/schemas/DateInput"
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 24,
            "default": 6
          },
          "day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31,
            "description": "Jalali day of month for day-of-month."
          },
          "weekday": {
            "type": "integer",
            "minimum": 1,
            "maximum": 7,
            "description": "For weekly: ISO weekday, 1 Monday … 7 Sunday (Saturday 6, Friday 5), the one weekday convention of every Taghvim schema."
          },
          "roll": {
            "enum": [
              "following",
              "preceding",
              "skip"
            ],
            "default": "following"
          }
        },
        "examples": [
          {
            "rule": "last-business",
            "from": "1405-07-01",
            "count": 4
          }
        ]
      },
      "SlaRequest": {
        "title": "SlaRequest",
        "type": "object",
        "required": [
          "start",
          "hours"
        ],
        "additionalProperties": false,
        "properties": {
          "start": {
            "$ref": "#/components/schemas/DateInput"
          },
          "time": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "default": "09:00"
          },
          "hours": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 2000
          },
          "open": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "default": "08:00"
          },
          "close": {
            "type": "string",
            "pattern": "^\\d{2}:\\d{2}$",
            "default": "16:00"
          },
          "thursday_close": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{2}:\\d{2}$"
          }
        },
        "examples": [
          {
            "start": "1405-07-15",
            "time": "15:00",
            "hours": 24,
            "open": "08:00",
            "close": "16:00",
            "thursday_close": "13:00"
          }
        ]
      },
      "SlaResponse": {
        "title": "SlaResponse",
        "type": "object",
        "required": [
          "start",
          "hours",
          "due",
          "calendar_days",
          "timezone",
          "calendar_data_version"
        ],
        "properties": {
          "start": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "hours": {
            "type": "number"
          },
          "due": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "calendar_days": {
            "type": "integer"
          },
          "timezone": {
            "const": "Asia/Tehran"
          },
          "calendar_data_version": {
            "$ref": "#/components/schemas/CalendarDataVersion"
          }
        }
      },
      "Step": {
        "title": "Step",
        "type": "object",
        "required": [
          "step",
          "value"
        ],
        "properties": {
          "step": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "Subscription": {
        "title": "Subscription",
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "plan",
          "status",
          "current_period"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^sub_"
          },
          "tenant_id": {
            "type": "string"
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "status": {
            "enum": [
              "active"
            ]
          },
          "current_period": {
            "$ref": "#/components/schemas/Period"
          },
          "updated_at": {
            "$ref": "#/components/schemas/Timestamp"
          }
        }
      },
      "Tenant": {
        "title": "Tenant",
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "plan_id",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ten_"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "suspended"
            ]
          },
          "plan_id": {
            "type": "string",
            "pattern": "^plan_"
          },
          "billing_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "$ref": "#/components/schemas/Timestamp"
          }
        }
      },
      "TenantCreated": {
        "title": "TenantCreated",
        "type": "object",
        "required": [
          "tenant",
          "api_key"
        ],
        "properties": {
          "tenant": {
            "$ref": "#/components/schemas/Tenant"
          },
          "api_key": {
            "$ref": "#/components/schemas/ApiKeyWithSecret"
          }
        }
      },
      "Timestamp": {
        "title": "Timestamp",
        "description": "An instant in UTC with its Tehran wall-clock time in the Gregorian and Jalali calendars.",
        "type": "object",
        "required": [
          "iso",
          "local",
          "jalali",
          "timezone"
        ],
        "properties": {
          "iso": {
            "type": "string",
            "format": "date-time",
            "examples": [
              "2026-10-07T07:00:00.000Z"
            ]
          },
          "local": {
            "type": "string",
            "examples": [
              "2026-10-07T10:30:00+03:30"
            ]
          },
          "jalali": {
            "type": "string",
            "examples": [
              "1405-07-15 10:30:00"
            ]
          },
          "timezone": {
            "const": "Asia/Tehran"
          }
        }
      },
      "Usage": {
        "title": "Usage",
        "type": "object",
        "required": [
          "tenant_id",
          "period",
          "plan_id",
          "limit",
          "used",
          "remaining",
          "reset_seconds",
          "by_meter"
        ],
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "period": {
            "$ref": "#/components/schemas/Period"
          },
          "plan_id": {
            "type": "string"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "used": {
            "type": "integer"
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reset_seconds": {
            "type": "integer"
          },
          "by_meter": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "meter",
                "requests",
                "operations"
              ],
              "properties": {
                "meter": {
                  "type": "string"
                },
                "requests": {
                  "type": "integer"
                },
                "operations": {
                  "type": "integer"
                }
              }
            }
          },
          "by_endpoint": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "operation_id",
                "requests",
                "operations"
              ],
              "properties": {
                "operation_id": {
                  "type": "string"
                },
                "requests": {
                  "type": "integer"
                },
                "operations": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "UsageExport": {
        "title": "UsageExport",
        "description": "Billing export for one tenant and period: plan charge, metered operations and payments, in integer Rial.",
        "type": "object",
        "required": [
          "tenant_id",
          "period",
          "currency",
          "plan",
          "lines",
          "operations_used",
          "payments",
          "generated_at"
        ],
        "properties": {
          "tenant_id": {
            "type": "string"
          },
          "period": {
            "$ref": "#/components/schemas/Period"
          },
          "currency": {
            "const": "IRR"
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "operations_used": {
            "type": "integer"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "kind",
                "description",
                "quantity",
                "unit_amount_irr",
                "amount_irr"
              ],
              "properties": {
                "kind": {
                  "enum": [
                    "subscription",
                    "usage"
                  ]
                },
                "description": {
                  "type": "string"
                },
                "meter": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "unit_amount_irr": {
                  "type": "integer"
                },
                "amount_irr": {
                  "type": "integer"
                }
              }
            }
          },
          "payments": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "payment_intent_id",
                "amount_irr",
                "status"
              ],
              "properties": {
                "payment_intent_id": {
                  "type": "string"
                },
                "amount_irr": {
                  "type": "integer"
                },
                "status": {
                  "type": "string"
                },
                "receipt_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "verified_at": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Timestamp"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "generated_at": {
            "$ref": "#/components/schemas/Timestamp"
          }
        }
      },
      "Versions": {
        "title": "Versions",
        "type": "object",
        "required": [
          "api_version",
          "engine_version",
          "calendar_engine_version",
          "calendar_data_version",
          "pricebook_version",
          "error_catalog_version",
          "event_catalog_version",
          "payment_connector_standard_version"
        ],
        "properties": {
          "api_version": {
            "type": "string"
          },
          "engine_version": {
            "type": "string"
          },
          "calendar_engine_version": {
            "type": "string"
          },
          "calendar_data_version": {
            "type": "string"
          },
          "pricebook_version": {
            "type": "string"
          },
          "error_catalog_version": {
            "type": "string"
          },
          "event_catalog_version": {
            "type": "string"
          },
          "payment_connector_standard_version": {
            "type": "string"
          }
        }
      },
      "Webhook": {
        "title": "Webhook",
        "type": "object",
        "required": [
          "id",
          "url",
          "event_types",
          "status",
          "secret_version",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^whk_"
          },
          "url": {
            "type": "string"
          },
          "event_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventType"
            }
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "active",
              "disabled"
            ]
          },
          "secret_version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "$ref": "#/components/schemas/Timestamp"
          }
        }
      },
      "WebhookCreateRequest": {
        "title": "WebhookCreateRequest",
        "type": "object",
        "required": [
          "url",
          "event_types"
        ],
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "pattern": "^https://",
            "maxLength": 2000
          },
          "event_types": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/EventType"
            }
          },
          "description": {
            "type": "string",
            "maxLength": 200
          }
        },
        "examples": [
          {
            "url": "https://example.com/webhooks/taghvim",
            "event_types": [
              "taghvim.event.payment.intent.verified.v1"
            ]
          }
        ]
      },
      "WebhookList": {
        "title": "WebhookList",
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          }
        }
      },
      "WebhookWithSecret": {
        "title": "WebhookWithSecret",
        "type": "object",
        "required": [
          "webhook",
          "secret",
          "key_id"
        ],
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          },
          "secret": {
            "type": "string",
            "pattern": "^tgv_whsec_",
            "description": "Signing secret, shown once."
          },
          "key_id": {
            "type": "string"
          }
        }
      }
    },
    "headers": {
      "RequestId": {
        "description": "Unique id of this request; quote it when you contact support.",
        "schema": {
          "type": "string",
          "pattern": "^req_"
        }
      },
      "RateLimit": {
        "description": "Remaining operations in the current quota window and seconds until it resets (IETF RateLimit header fields).",
        "schema": {
          "type": "string",
          "examples": [
            "\"taghvim-monthly\";r=9990;t=86400"
          ]
        }
      },
      "RateLimitPolicy": {
        "description": "The quota policy: operations per window (q) and window length in seconds (w).",
        "schema": {
          "type": "string",
          "examples": [
            "\"taghvim-monthly\";q=10000;w=2592000"
          ]
        }
      },
      "RetryAfter": {
        "description": "Seconds until the quota window resets.",
        "schema": {
          "type": "integer"
        }
      },
      "IdempotentReplayed": {
        "description": "Present and true when the response is a replay of an earlier request with the same Idempotency-Key.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      },
      "CalendarDataVersion": {
        "description": "Version of the calendar and holiday data behind the answer.",
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "tgv_live_… | tgv_test_…",
        "description": "کلید API حساب شما. حساب (tenant) همیشه از روی کلید شناخته می‌شود."
      },
      "OperatorToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "Operator token for tenant provisioning and the all-tenant billing export."
      }
    }
  },
  "x-taghvim-generated": "Generated by scripts/build-contracts.mjs from contracts/src, contracts/schemas, contracts/connector, config and data. Do not edit by hand.",
  "x-taghvim-catalogs": {
    "errors": "1.0.0",
    "events": "2.0.0",
    "pricebook": "2026-10",
    "registry": "2.0.0"
  }
}
