{
  "openapi": "3.1.0",
  "info": {
    "title": "Calio API",
    "version": "2026-10-18",
    "description": "ה-API של קאליו לאתרים חיצוניים: דפי תשלום, קטלוג ומלאי, מנויים, לקוחות ומסמכים. כל קריאה היא שרת-מול-שרת עם מפתח סודי.",
    "x-he": "התיעוד המלא נבנה מהקובץ הזה ומ-errorCatalog.json — הם גם מה שהשרת אוכף."
  },
  "servers": [
    {
      "url": "https://api.calio-app.com"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "x-calio-common-errors": [
    "invalid_api_key",
    "api_key_revoked",
    "api_key_expired",
    "key_suspended_security",
    "api_key_ip_not_allowed",
    "secret_key_from_browser",
    "auth_rate_limited",
    "rate_limited",
    "monthly_quota_exceeded",
    "rate_limiter_unavailable",
    "api_disabled",
    "api_unavailable",
    "api_version_invalid",
    "route_not_found",
    "method_not_allowed",
    "payload_too_large",
    "internal_error",
    "capability_denied",
    "unknown_parameter",
    "invalid_parameter"
  ],
  "x-calio-write-errors": [
    "invalid_json",
    "unsupported_media_type",
    "missing_parameter",
    "idempotency_key_required",
    "idempotency_key_invalid",
    "idempotency_key_reused",
    "idempotency_request_in_progress"
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer calio_sk_live_… (או calio_sk_test_… למצב בדיקה). לעולם לא מהדפדפן."
      }
    },
    "headers": {
      "Calio-Request-Id": {
        "description": "מזהה הבקשה — לצרף בפנייה לתמיכה",
        "schema": {
          "type": "string"
        }
      },
      "Calio-Api-Version": {
        "description": "גרסת ה-API שענתה",
        "schema": {
          "type": "string"
        }
      },
      "Calio-Idempotent-Replayed": {
        "description": "true כשהתשובה חוזרת מבקשה קודמת עם אותו Idempotency-Key",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "שניות עד שמותר לנסות שוב (429 / 503)",
        "schema": {
          "type": "string"
        }
      },
      "X-RateLimit-Limit": {
        "schema": {
          "type": "string"
        }
      },
      "X-RateLimit-Remaining": {
        "schema": {
          "type": "string"
        }
      },
      "X-RateLimit-Reset": {
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "type",
              "code",
              "message",
              "developer_message",
              "param",
              "retryable",
              "retry_after_seconds",
              "doc_url",
              "request_id"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "auth",
                  "invalid_request",
                  "state",
                  "business",
                  "rate_limit",
                  "payment",
                  "upstream",
                  "internal"
                ]
              },
              "code": {
                "type": "string",
                "description": "יציב לנצח. ראו קטלוג השגיאות"
              },
              "message": {
                "type": "string",
                "description": "עברית — אפשר להציג לקונה כמו שהיא"
              },
              "developer_message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "השדה שגרם לשגיאה, בנתיב JSON (lines[0].quantity)"
              },
              "retryable": {
                "type": "boolean",
                "description": "האם בטוח לשלוח שוב את אותה בקשה (עם אותו Idempotency-Key)"
              },
              "retry_after_seconds": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "doc_url": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              }
            }
          }
        }
      },
      "Account": {
        "type": "object",
        "required": [
          "object",
          "livemode",
          "business",
          "api_key",
          "readiness",
          "request_ip"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "account"
            ]
          },
          "livemode": {
            "type": "boolean"
          },
          "business": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "api_key": {
            "type": "object",
            "required": [
              "id",
              "display",
              "name",
              "capabilities"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "display": {
                "type": "string",
                "description": "calio_sk_live_a4F2…••••3d91"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "capabilities": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "readiness": {
            "type": [
              "object",
              "null"
            ],
            "description": "האם דף תשלום במצב live יתקבל עכשיו, ובאילו גבולות. מוחזר גם במפתח test — מצב בדיקה מדלג על בדיקות ה-live, ולכן בדיקה שעברה לבדה לא מוכיחה שה-live יעבוד. null — לא ניתן היה לבדוק כרגע; המפתח עצמו תקין. מנסים שוב.",
            "required": [
              "can_accept_live_payments",
              "live_blocker",
              "max_installments",
              "minimum_agorot",
              "maximum_agorot",
              "custom_lines_enabled",
              "return_domains"
            ],
            "properties": {
              "can_accept_live_payments": {
                "type": "boolean",
                "description": "true — POST /v1/checkout_sessions במפתח live יעבור את בדיקות העסק (סליקה, מסמכים, מכסה)."
              },
              "live_blocker": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  null,
                  "provider_not_supported_yet",
                  "business_cannot_issue_documents",
                  "business_cannot_accept_payments",
                  "plan_quota_reached"
                ],
                "description": "קוד השגיאה שדף live היה מקבל עכשיו, או null."
              },
              "max_installments": {
                "type": "integer",
                "description": "מספר התשלומים המקסימלי שדף live יקבל עכשיו ב-max_installments: 12, או 1 אם החבילה של העסק לא כוללת תשלומים."
              },
              "minimum_agorot": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "הסכום המינימלי לדף live. null כשהעסק עוד לא יכול לקבל תשלומי live."
              },
              "maximum_agorot": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "תקרה לתשלום אחד שבעל העסק קבע, או null."
              },
              "custom_lines_enabled": {
                "type": "boolean",
                "description": "שורות במחיר חופשי (בלי product_id) מותרות."
              },
              "return_domains": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "הדומיינים המאושרים ל-success_url ו-cancel_url."
              }
            }
          },
          "request_ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "כתובת ה-IP שממנה הגיעה הבקשה, כפי שקאליו רואה אותה. לאתר עם תנועה גדולה קאליו מגדירה תקרות לפי הכתובת הזו."
          }
        }
      },
      "Variant": {
        "type": [
          "object",
          "null"
        ],
        "description": "שם קבוצה → אפשרות, או מערך אפשרויות",
        "properties": {}
      },
      "Line": {
        "type": "object",
        "required": [
          "type",
          "product_id",
          "name",
          "quantity",
          "unit_price_agorot",
          "total_agorot"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "product",
              "service",
              "custom"
            ]
          },
          "product_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unit_price_agorot": {
            "type": "integer"
          },
          "total_agorot": {
            "type": "integer"
          },
          "variant": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "CheckoutCustomer": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CheckoutSession": {
        "type": "object",
        "required": [
          "object",
          "id",
          "livemode",
          "status",
          "url",
          "created",
          "expires_at",
          "reference",
          "metadata",
          "customer",
          "lines",
          "amount_total_agorot",
          "charged_amount_agorot",
          "currency",
          "max_installments",
          "success_url",
          "cancel_url",
          "payment_id",
          "order",
          "order_id"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "checkout_session"
            ]
          },
          "id": {
            "type": "string",
            "description": "cs_…"
          },
          "livemode": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "processing",
              "complete",
              "expired",
              "canceled"
            ],
            "description": "open — מחכה לתשלום · processing — הלקוח באמצע · complete — שולם · expired / canceled — סופי"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "דף התשלום להפניית הקונה (רק כשהסטטוס open)"
          },
          "created": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "customer": {
            "$ref": "#/components/schemas/CheckoutCustomer"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Line"
            }
          },
          "amount_total_agorot": {
            "type": "integer",
            "description": "סכום השורות; עם order — מוצרים + משלוח − הנחה (לפני עמלה)"
          },
          "charged_amount_agorot": {
            "type": "integer",
            "description": "מה שהקונה משלם בפועל — גבוה יותר כשהעסק מגלגל עמלה"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ILS"
            ]
          },
          "max_installments": {
            "type": "integer"
          },
          "success_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "cancel_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "pay_… כשהסטטוס complete"
          },
          "order": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrderDetails"
              },
              {
                "type": "null"
              }
            ],
            "description": "פרטי ההזמנה שהאתר שלח (null בלי order)"
          },
          "order_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ord_api_… — אחרי תשלום, כשנשלח order"
          }
        }
      },
      "Issue": {
        "type": "object",
        "required": [
          "code",
          "severity",
          "message",
          "created",
          "resolved"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "קטלוג ה-issues — יציב לנצח"
          },
          "severity": {
            "type": "string",
            "enum": [
              "warning",
              "action_required",
              "critical"
            ]
          },
          "message": {
            "type": "string"
          },
          "created": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolved": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PaymentDocument": {
        "type": "object",
        "required": [
          "id",
          "type",
          "number",
          "status",
          "pdf_url",
          "allocation_number"
        ],
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "description": "The accounting document type (e.g. receipt, tax_invoice_receipt). In test mode: test_receipt — a placeholder with no legal validity; no real document is issued."
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "issued"
            ]
          },
          "pdf_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "הקישור הקבוע שלנו ל-PDF של המסמך. null כשהקובץ עוד לא אצלנו או במסמך בדיקה."
          },
          "allocation_number": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Payment": {
        "type": "object",
        "required": [
          "object",
          "id",
          "livemode",
          "status",
          "document_status",
          "requires_attention",
          "issues",
          "checkout_session_id",
          "reference",
          "metadata",
          "amount_total_agorot",
          "charged_amount_agorot",
          "refunded_amount_agorot",
          "currency",
          "paid_at",
          "payment_method",
          "customer",
          "lines",
          "documents",
          "order_id"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "payment"
            ]
          },
          "id": {
            "type": "string",
            "description": "pay_…"
          },
          "livemode": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "succeeded",
              "partially_refunded",
              "refunded"
            ],
            "description": "🔴 הכסף. ההחלטה על שליחת סחורה / פתיחת שירות — לפי השדה הזה בלבד"
          },
          "document_status": {
            "type": "string",
            "enum": [
              "issued",
              "pending",
              "failed",
              "not_required"
            ],
            "description": "המסמך החשבונאי — נפרד מהכסף"
          },
          "requires_attention": {
            "type": "boolean",
            "description": "יש issue פתוח שהעסק צריך לטפל בו באפליקציה. לא סיבה לעצור את הלקוח"
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Issue"
            }
          },
          "checkout_session_id": {
            "type": "string"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "amount_total_agorot": {
            "type": [
              "integer",
              "null"
            ],
            "description": "סכום השורות; עם order — מוצרים + משלוח − הנחה (לפני עמלה)"
          },
          "charged_amount_agorot": {
            "type": [
              "integer",
              "null"
            ]
          },
          "refunded_amount_agorot": {
            "type": "integer"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ILS"
            ]
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_method": {
            "type": "object",
            "required": [
              "type",
              "brand",
              "last4",
              "installments"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "card",
                  "bit",
                  "apple_pay",
                  "google_pay"
                ]
              },
              "brand": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "last4": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "installments": {
                "type": "integer"
              }
            }
          },
          "customer": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              }
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type",
                "product_id",
                "name",
                "quantity",
                "unit_price_agorot",
                "total_agorot"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "product",
                    "service",
                    "custom"
                  ]
                },
                "product_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unit_price_agorot": {
                  "type": "integer"
                },
                "total_agorot": {
                  "type": "integer"
                }
              }
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentDocument"
            }
          },
          "order_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "ord_api_… — כשהתשלום שייך להזמנה"
          }
        }
      },
      "CheckoutSessionList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckoutSession"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PaymentList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Product": {
        "type": "object",
        "required": [
          "object",
          "id",
          "type",
          "name",
          "description",
          "price_agorot",
          "sale_price_agorot",
          "currency",
          "duration_minutes",
          "images",
          "categories",
          "variant_groups",
          "quantity",
          "stock",
          "purchasable"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "product"
            ]
          },
          "id": {
            "type": "string",
            "description": "prd_… — שולחים אותו ב-lines[].product_id"
          },
          "type": {
            "type": "string",
            "enum": [
              "product",
              "service"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "price_agorot": {
            "type": "integer",
            "description": "מחיר הקטלוג"
          },
          "sale_price_agorot": {
            "type": [
              "integer",
              "null"
            ],
            "description": "מחיר אחרי ההנחה שבקטלוג — זה מה שדף התשלום יגבה"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ILS"
            ]
          },
          "duration_minutes": {
            "type": [
              "integer",
              "null"
            ],
            "description": "לשירות בלבד"
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "variant_groups": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "selection",
                "min_select",
                "max_select",
                "options"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "selection": {
                  "type": "string",
                  "enum": [
                    "single",
                    "multiple",
                    "text"
                  ]
                },
                "min_select": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "max_select": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "options": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "price_adjustment_agorot",
                      "sold_out"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "price_adjustment_agorot": {
                        "type": "integer"
                      },
                      "sold_out": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          },
          "quantity": {
            "type": "object",
            "required": [
              "unit",
              "step",
              "min",
              "max",
              "default"
            ],
            "properties": {
              "unit": {
                "type": "string",
                "enum": [
                  "quantity",
                  "weight"
                ]
              },
              "step": {
                "type": "number"
              },
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              },
              "default": {
                "type": "number"
              }
            }
          },
          "stock": {
            "type": "object",
            "required": [
              "tracked",
              "available",
              "status",
              "by_variant"
            ],
            "properties": {
              "tracked": {
                "type": "boolean"
              },
              "available": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "null כשהעסק בחר להציג סטטוס בלבד"
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "in_stock",
                  "low",
                  "out_of_stock",
                  null
                ]
              },
              "by_variant": {
                "type": [
                  "object",
                  "null"
                ]
              }
            }
          },
          "purchasable": {
            "type": "boolean",
            "description": "אפשר לשלוח אותו ל-checkout עכשיו"
          }
        }
      },
      "ProductList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CategoryList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "object",
                "id",
                "name"
              ],
              "properties": {
                "object": {
                  "type": "string",
                  "enum": [
                    "category"
                  ]
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Event": {
        "type": "object",
        "required": [
          "id",
          "type",
          "created",
          "livemode",
          "api_version",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "ייחודי — לשמור ולהתעלם מכפילות"
          },
          "type": {
            "type": "string",
            "description": "ראו קטלוג האירועים"
          },
          "created": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "api_version": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "required": [
              "object"
            ],
            "properties": {
              "object": {
                "type": "object",
                "description": "האובייקט המלא — CheckoutSession, Payment או Subscription, כמו ב-GET"
              },
              "previous": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "באירועי עדכון — רק השדות שהשתנו"
              }
            }
          }
        }
      },
      "EventList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Document": {
        "type": "object",
        "description": "מסמך חשבונאי של תשלום שעבר דרך ה-API. קריאה בלבד — אין יצירת מסמך בלי תשלום.",
        "required": [
          "object",
          "id",
          "type",
          "number",
          "status",
          "pdf_url",
          "amount_agorot",
          "vat_rate",
          "vat_agorot",
          "pre_vat_agorot",
          "allocation_number",
          "is_credit",
          "payment_id",
          "created_at",
          "livemode"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "document"
            ]
          },
          "id": {
            "type": "string",
            "description": "doc_… · במצב בדיקה: doc_test_…"
          },
          "type": {
            "type": "string",
            "description": "receipt / tax_invoice_receipt / tax_invoice / credit_invoice … · במצב בדיקה: test_receipt (בלי תוקף)"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "issued",
              "cancelling",
              "cancelled"
            ]
          },
          "pdf_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "הקישור הקבוע שלנו ל-PDF של המסמך. null כשהקובץ עוד לא אצלנו או במסמך בדיקה."
          },
          "amount_agorot": {
            "type": "integer",
            "description": "שלילי במסמך זיכוי"
          },
          "vat_rate": {
            "type": "number",
            "description": "אחוז המע\"מ של העסק בזמן ההפקה (עוסק פטור: 0)"
          },
          "vat_agorot": {
            "type": "integer"
          },
          "pre_vat_agorot": {
            "type": "integer"
          },
          "allocation_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_credit": {
            "type": "boolean"
          },
          "payment_id": {
            "type": "string"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "livemode": {
            "type": "boolean"
          }
        }
      },
      "DocumentPdf": {
        "type": "object",
        "required": [
          "object",
          "document_id",
          "url",
          "expires_at"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "document_pdf"
            ]
          },
          "document_id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "קישור חתום — תקף 15 דקות. אל תשמרו אותו; בקשו חדש כשצריך."
          },
          "expires_at": {
            "type": "string"
          }
        }
      },
      "Customer": {
        "type": "object",
        "description": "כרטיס לקוח של העסק — אותו כרטיס באפליקציה ובאתר. מוחזרים רק השדות המתועדים כאן.",
        "required": [
          "object",
          "id",
          "name",
          "phone",
          "email",
          "company_name",
          "tax_id",
          "address",
          "marketing_consent",
          "created_at",
          "livemode"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "customer"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "E.164, למשל +972501234567"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "street",
              "city",
              "zip"
            ],
            "properties": {
              "street": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "zip": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "marketing_consent": {
            "type": "boolean"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "livemode": {
            "type": "boolean",
            "description": "false ⇒ לקוח ארגז-חול של מצב בדיקה — לא מופיע באפליקציה"
          }
        }
      },
      "CustomerList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Customer"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Subscription": {
        "type": "object",
        "description": "מנוי שנוצר דרך ה-API. פרטי הכרטיס לא נחשפים — רק has_payment_method.",
        "required": [
          "object",
          "id",
          "status",
          "past_due_reason",
          "name",
          "amount_agorot",
          "currency",
          "interval",
          "customer",
          "setup_url",
          "has_payment_method",
          "start_date",
          "next_charge_date",
          "max_charges",
          "charges_count",
          "failed_attempts",
          "total_charged_agorot",
          "last_charge_at",
          "latest_document",
          "paused_at",
          "canceled_at",
          "reference",
          "metadata",
          "created_at",
          "livemode"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "subscription"
            ]
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_payment_method",
              "active",
              "past_due",
              "paused",
              "completed",
              "canceled"
            ]
          },
          "past_due_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "payment_failed",
              "card_declined",
              "payment_method_invalid",
              null
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount_agorot": {
            "type": "integer"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ILS"
            ]
          },
          "interval": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "week",
              "month",
              "year",
              "day",
              null
            ]
          },
          "customer": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string"
              }
            }
          },
          "setup_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "דף קאליו שבו הלקוח מזין כרטיס (רק ב-pending_payment_method). במצב בדיקה: null — משתמשים ב-test/activate"
          },
          "has_payment_method": {
            "type": "boolean"
          },
          "start_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_charge_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "max_charges": {
            "type": [
              "integer",
              "null"
            ]
          },
          "charges_count": {
            "type": "integer"
          },
          "failed_attempts": {
            "type": "integer"
          },
          "total_charged_agorot": {
            "type": "integer"
          },
          "last_charge_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "latest_document": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PaymentDocument"
              },
              {
                "type": "null"
              }
            ],
            "description": "הקבלה של החיוב המוצלח האחרון."
          },
          "paused_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "canceled_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "livemode": {
            "type": "boolean"
          }
        }
      },
      "SubscriptionList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Subscription"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SubscriptionCharge": {
        "type": "object",
        "required": [
          "object",
          "id",
          "status",
          "amount_agorot",
          "charge_number",
          "failure_reason",
          "payment_id",
          "created_at"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "subscription_charge"
            ]
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "succeeded",
              "failed",
              "pending"
            ]
          },
          "amount_agorot": {
            "type": "integer"
          },
          "charge_number": {
            "type": [
              "integer",
              "null"
            ]
          },
          "failure_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "payment_failed",
              "card_declined",
              null
            ]
          },
          "payment_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SubscriptionChargeList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionCharge"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PaymentMethodUpdateLink": {
        "type": "object",
        "required": [
          "object",
          "subscription_id",
          "url",
          "expires_at"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "payment_method_update_link"
            ]
          },
          "subscription_id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "לשלוח ללקוח. תקף 72 שעות"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OrderDetails": {
        "type": "object",
        "description": "מה שהאתר שלח ב-order (הד)",
        "required": [
          "fulfillment",
          "shipping_address",
          "shipping_method_name",
          "shipping_fee_agorot",
          "discount",
          "requested_date",
          "time_slot",
          "note",
          "extra_fields"
        ],
        "properties": {
          "fulfillment": {
            "type": "string",
            "enum": [
              "shipping",
              "pickup",
              "none"
            ]
          },
          "shipping_address": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "city",
              "street",
              "house_number",
              "apartment",
              "floor",
              "zip"
            ],
            "properties": {
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "house_number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "apartment": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "floor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "zip": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "shipping_method_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipping_fee_agorot": {
            "type": "integer"
          },
          "discount": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "amount_agorot",
              "label"
            ],
            "properties": {
              "amount_agorot": {
                "type": "integer"
              },
              "label": {
                "type": "string"
              }
            }
          },
          "requested_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "YYYY-MM-DD"
          },
          "time_slot": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "start",
              "end"
            ],
            "properties": {
              "start": {
                "type": "string"
              },
              "end": {
                "type": "string"
              }
            }
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "extra_fields": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "value"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Order": {
        "type": "object",
        "description": "הזמנה בערוץ האתר — מופיעה במסך ההזמנות של קאליו וזזה במחזור הטיפול הרגיל",
        "required": [
          "object",
          "id",
          "livemode",
          "order_number",
          "status",
          "payment_status",
          "payment_id",
          "payment_method",
          "payment_note",
          "reference",
          "customer",
          "lines",
          "fulfillment",
          "shipping_address",
          "shipping_method_name",
          "amounts",
          "discount_label",
          "requested_date",
          "time_slot",
          "note",
          "extra_fields",
          "status_history",
          "documents",
          "created"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "order"
            ]
          },
          "id": {
            "type": "string",
            "description": "ord_api_…"
          },
          "livemode": {
            "type": "boolean"
          },
          "order_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "shipped",
              "delivered",
              "canceled"
            ],
            "description": "pending — ממתינה לאישור בעל העסק (הזמנה בלי תשלום) · approved — אושרה / שולמה · shipped · delivered · canceled"
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "paid",
              "pending",
              "refunded"
            ]
          },
          "payment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "pay_… — הזמנה ששולמה בדף התשלום"
          },
          "payment_method": {
            "type": "string",
            "enum": [
              "online_checkout",
              "cash_on_delivery",
              "pay_at_pickup",
              "bank_transfer",
              "other"
            ]
          },
          "payment_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer": {
            "type": "object",
            "required": [
              "id",
              "name",
              "phone",
              "email"
            ],
            "properties": {
              "id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "cus_…"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type",
                "product_id",
                "name",
                "quantity",
                "unit_price_agorot",
                "total_agorot",
                "variant"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "product",
                    "service",
                    "custom"
                  ]
                },
                "product_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unit_price_agorot": {
                  "type": "integer"
                },
                "total_agorot": {
                  "type": "integer"
                },
                "variant": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "additionalProperties": {
                    "type": [
                      "string",
                      "array"
                    ]
                  }
                }
              }
            }
          },
          "fulfillment": {
            "type": "string",
            "enum": [
              "shipping",
              "pickup",
              "none"
            ]
          },
          "shipping_address": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "city",
              "street",
              "house_number",
              "apartment",
              "floor",
              "zip"
            ],
            "properties": {
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "house_number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "apartment": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "floor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "zip": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "shipping_method_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "amounts": {
            "type": "object",
            "required": [
              "subtotal_agorot",
              "shipping_fee_agorot",
              "discount_agorot",
              "total_agorot"
            ],
            "properties": {
              "subtotal_agorot": {
                "type": "integer",
                "description": "המוצרים"
              },
              "shipping_fee_agorot": {
                "type": "integer"
              },
              "discount_agorot": {
                "type": "integer"
              },
              "total_agorot": {
                "type": "integer",
                "description": "מה שהקונה משלם (כולל עמלה אם העסק מגלגל)"
              }
            }
          },
          "discount_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "requested_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "YYYY-MM-DD"
          },
          "time_slot": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "start",
              "end"
            ],
            "properties": {
              "start": {
                "type": "string"
              },
              "end": {
                "type": "string"
              }
            }
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "extra_fields": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "value"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "status_history": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "status",
                "at"
              ],
              "properties": {
                "status": {
                  "type": "string"
                },
                "at": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentDocument"
            },
            "description": "המסמכים החשבונאיים של ההזמנה, כשהיא שולמה."
          },
          "created": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OrderList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  },
  "paths": {
    "/v1/account": {
      "get": {
        "operationId": "account.get",
        "summary": "פרטי החיבור — לאיזה עסק המפתח שייך ומה מותר לו",
        "description": "הקריאה הראשונה בכל אינטגרציה: מאשרת שהמפתח עובד, במצב test או live, ומחזירה את ההרשאות שלו. readiness עונה האם דף תשלום live יתקבל עכשיו — גם במפתח test.",
        "x-calio-capability": "account:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [],
        "responses": {
          "200": {
            "description": "המפתח תקין",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                },
                "example": {
                  "object": "account",
                  "livemode": true,
                  "business": {
                    "name": "סטודיו דנה"
                  },
                  "api_key": {
                    "id": "a4F2k9QwErTyUiOp1234",
                    "display": "calio_sk_live_a4F2…••••3d91",
                    "name": "אתר ראשי",
                    "capabilities": [
                      "account:read",
                      "catalog:read",
                      "checkout:write"
                    ]
                  },
                  "readiness": {
                    "can_accept_live_payments": true,
                    "live_blocker": null,
                    "max_installments": 6,
                    "minimum_agorot": 100,
                    "maximum_agorot": null,
                    "custom_lines_enabled": true,
                    "return_domains": [
                      "shop.co.il",
                      "www.shop.co.il"
                    ]
                  },
                  "request_ip": "203.0.113.10"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY"
      }
    },
    "/v1/checkout_sessions": {
      "post": {
        "operationId": "checkout_sessions.create",
        "summary": "יצירת דף תשלום",
        "description": "מקבל מוצרים מהקטלוג (המחיר מהשרת) ושורות חופשיות, ומחזיר כתובת לדף התשלום של קאליו. את הקונה מפנים ל-url. אישור התשלום מגיע ב-webhook (payment.succeeded) — לא לפי החזרה לדפדפן. עם order — אחרי התשלום נוצרת הזמנה במסך ההזמנות של העסק (order_id).",
        "x-calio-capability": "checkout:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "product_not_found",
          "product_unavailable",
          "product_out_of_stock",
          "invalid_variant",
          "invalid_quantity",
          "custom_lines_disabled",
          "price_changed",
          "amount_below_minimum",
          "amount_above_business_limit",
          "installments_not_allowed",
          "url_domain_not_allowed",
          "business_cannot_accept_payments",
          "business_cannot_issue_documents",
          "plan_quota_reached",
          "provider_not_supported_yet",
          "customer_not_found",
          "shipping_fee_not_allowed",
          "discount_not_allowed"
        ],
        "responses": {
          "201": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSession"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "CHECKOUT_CREATE"
      },
      "get": {
        "operationId": "checkout_sessions.list",
        "summary": "רשימת דפי תשלום",
        "description": "החדשים קודם. עימוד בסמן: starting_after = ה-id האחרון שקיבלתם.",
        "x-calio-capability": "checkout:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSessionList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "LIST_QUERY"
      }
    },
    "/v1/checkout_sessions/{id}": {
      "get": {
        "operationId": "checkout_sessions.get",
        "summary": "דף תשלום",
        "description": "מצב עדכני של דף תשלום. 404 גם לדף של עסק אחר.",
        "x-calio-capability": "checkout:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSession"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/checkout_sessions/{id}/expire": {
      "post": {
        "operationId": "checkout_sessions.expire",
        "summary": "ביטול דף תשלום פתוח",
        "description": "דף שכבר שולם, פג או בוטל — 409. אם הקונה פתח את דף התשלום ב-3 הדקות האחרונות — 409 עם Retry-After.",
        "x-calio-capability": "checkout:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "resource_not_found",
          "checkout_session_not_open",
          "checkout_session_in_payment"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutSession"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/payments": {
      "get": {
        "operationId": "payments.list",
        "summary": "רשימת תשלומים",
        "description": "תשלומים שהתקבלו דרך ה-API, החדשים קודם.",
        "x-calio-capability": "payments:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "LIST_QUERY"
      }
    },
    "/v1/payments/{id}": {
      "get": {
        "operationId": "payments.get",
        "summary": "תשלום",
        "description": "שלושה צירים נפרדים: status (הכסף), document_status (המסמך), requires_attention + issues (מה העסק צריך לטפל).",
        "x-calio-capability": "payments:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/payments/{id}/test/refund": {
      "post": {
        "operationId": "payments.test_refund",
        "summary": "בדיקה: זיכוי מדומה",
        "description": "מצב בדיקה בלבד. זיכוי אמיתי נעשה רק באפליקציה של קאליו, על ידי אדם — ולתשלום בדיקה אין שם מכירה לזכות. הקריאה מגדילה את הסכום שזוכה בתשלום הבדיקה, ואחריה נשלח האירוע הרגיל: payment.partially_refunded או payment.refunded. לא זז כסף, לא נוצרת מכירה ולא מופק מסמך זיכוי. בלי amount_agorot — כל מה שעוד לא זוכה.",
        "x-calio-capability": "checkout:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "resource_not_found",
          "invalid_parameter"
        ],
        "responses": {
          "200": {
            "description": "הצלחה — התשלום אחרי הזיכוי",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "PAYMENT_TEST_REFUND",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/products": {
      "get": {
        "operationId": "products.list",
        "summary": "מוצרים ושירותים",
        "description": "כל מה שהעסק לא הסתיר מה-API. מחירים באגורות — אותו מחיר שדף התשלום יגבה. סינון: type, category. עימוד בסמן.",
        "x-calio-capability": "catalog:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [],
        "x-calio-request-schema-ref": "PRODUCTS_QUERY",
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/{id}": {
      "get": {
        "operationId": "products.get",
        "summary": "מוצר או שירות",
        "description": "כולל וריאנטים, כללי כמות ומלאי זמין.",
        "x-calio-capability": "catalog:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "x-calio-request-schema-ref": "EMPTY",
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/categories": {
      "get": {
        "operationId": "categories.list",
        "summary": "קטגוריות",
        "description": "הקטגוריות של קטלוג העסק.",
        "x-calio-capability": "catalog:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [],
        "x-calio-request-schema-ref": "EMPTY",
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "events.list",
        "summary": "אירועים",
        "description": "30 הימים האחרונים, החדשים קודם. לשחזור webhooks שלא הגיעו — סנכרון לילי. סינון לפי type.",
        "x-calio-capability": "events:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [],
        "x-calio-request-schema-ref": "EVENTS_QUERY",
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/{id}": {
      "get": {
        "operationId": "events.get",
        "summary": "אירוע",
        "description": "אותו גוף בדיוק שנשלח ב-webhook.",
        "x-calio-capability": "events:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "x-calio-request-schema-ref": "EMPTY",
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/documents/{id}": {
      "get": {
        "operationId": "documents.get",
        "summary": "מסמך",
        "description": "מסמך של תשלום API: סוג, מספר, סכום, מע\"מ, מספר הקצאה והתשלום המקושר. מסמך שאינו של תשלום API נראה כמו מזהה שלא קיים.",
        "x-calio-capability": "documents:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/documents/{id}/pdf": {
      "get": {
        "operationId": "documents.pdf",
        "summary": "PDF של מסמך",
        "description": "קישור חתום ל-15 דקות, להורדה של הקובץ. הקישור הקבוע נמצא ב-pdf_url של המסמך. מסמך בדיקה — אין PDF.",
        "x-calio-capability": "documents:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found",
          "document_pdf_unavailable"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentPdf"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/customers": {
      "post": {
        "operationId": "customers.create",
        "summary": "יצירת לקוח",
        "description": "יוצר כרטיס לקוח של העסק. טלפון/מייל שכבר קיימים ⇒ 409 customer_exists עם מזהה הלקוח הקיים (אין כפילות שקטה ואין דריסה). במצב בדיקה — לקוח ארגז-חול שלא מופיע באפליקציה.",
        "x-calio-capability": "customers:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "customer_exists"
        ],
        "responses": {
          "201": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "CUSTOMER_CREATE"
      },
      "get": {
        "operationId": "customers.list",
        "summary": "חיפוש / רשימת לקוחות",
        "description": "?phone= או ?email= — התאמה מדויקת (customers:read). בלי פרמטר חיפוש — כל הרשימה בעימוד (דורש גם customers:list). כל רשומה שנקראת נספרת: עד 1,000 בשעה; קריאת יותר ממחצית הלקוחות ביממה עוצרת את הרשימה עד אישור בעל העסק.",
        "x-calio-capability": "customers:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "capability_denied",
          "customers_list_disabled",
          "customers_list_blocked"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "CUSTOMERS_QUERY"
      }
    },
    "/v1/customers/{id}": {
      "get": {
        "operationId": "customers.get",
        "summary": "לקוח",
        "description": "כרטיס הלקוח.",
        "x-calio-capability": "customers:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "customers.update",
        "summary": "עדכון לקוח",
        "description": "שולחים רק את מה שמשתנה; null מוחק שדה. טלפון/מייל של לקוח אחר ⇒ 409 customer_exists. מחיקת לקוח — רק באפליקציה.",
        "x-calio-capability": "customers:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "resource_not_found",
          "customer_exists"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "CUSTOMER_UPDATE",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/customers/{id}/payments": {
      "get": {
        "operationId": "customers.payments",
        "summary": "תשלומי לקוח",
        "description": "תשלומי ה-API של הלקוח, מהחדש לישן.",
        "x-calio-capability": "payments:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "LIST_QUERY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/subscriptions": {
      "post": {
        "operationId": "subscriptions.create",
        "summary": "יצירת מנוי",
        "description": "יוצר מנוי ומחזיר setup_url — דף קאליו שבו הלקוח מזין כרטיס (לא נגבה כסף בדף). החיוב הראשון ביום ההזנה (או ב-start_date), ואז כל interval; כל חיוב = עסקה עם קבלה. האתר לעולם לא מחייב כרטיס בעצמו. עסק שהסליקה שלו עדיין לא תומכת במנויים מהאתר מקבל provider_not_supported_yet.",
        "x-calio-capability": "subscriptions:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "customer_not_found",
          "customer_exists",
          "amount_below_minimum",
          "amount_above_business_limit",
          "url_domain_not_allowed",
          "business_cannot_accept_payments",
          "business_cannot_issue_documents",
          "plan_quota_reached",
          "provider_not_supported_yet"
        ],
        "responses": {
          "201": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "SUBSCRIPTION_CREATE"
      },
      "get": {
        "operationId": "subscriptions.list",
        "summary": "רשימת מנויים",
        "description": "מנויים שנוצרו דרך ה-API. ?status= ו-?customer_id= לסינון.",
        "x-calio-capability": "subscriptions:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "SUBSCRIPTIONS_QUERY"
      }
    },
    "/v1/subscriptions/{id}": {
      "get": {
        "operationId": "subscriptions.get",
        "summary": "מנוי",
        "description": "כולל next_charge_date, charges_count, past_due_reason.",
        "x-calio-capability": "subscriptions:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "subscriptions.update",
        "summary": "שינוי סכום מנוי",
        "description": "🔴 דורש subscriptions:amount.",
        "x-calio-capability": "subscriptions:amount",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "subscription_invalid_state",
          "subscription_changed",
          "resource_not_found",
          "amount_below_minimum",
          "amount_above_business_limit",
          "subscription_amount_locked",
          "subscription_increase_too_large",
          "subscription_increase_too_soon"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "SUBSCRIPTION_UPDATE",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/subscriptions/{id}/charges": {
      "get": {
        "operationId": "subscriptions.charges",
        "summary": "חיובי מנוי",
        "description": "כל ניסיון חיוב של המנוי, מהחדש לישן.",
        "x-calio-capability": "subscriptions:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChargeList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/subscriptions/{id}/pause": {
      "post": {
        "operationId": "subscriptions.pause",
        "summary": "השהיית מנוי",
        "description": "רק ממנוי active. אין חיובים עד חידוש.",
        "x-calio-capability": "subscriptions:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "subscription_invalid_state",
          "subscription_changed",
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "SUBSCRIPTION_REASON",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/subscriptions/{id}/resume": {
      "post": {
        "operationId": "subscriptions.resume",
        "summary": "חידוש מנוי",
        "description": "רק ממנוי paused. החיוב הבא בהרצה הקרובה (08:00). מנוי בפיגור צריך כרטיס חדש — payment_method_update_link.",
        "x-calio-capability": "subscriptions:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "subscription_invalid_state",
          "subscription_changed",
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/subscriptions/{id}/cancel": {
      "post": {
        "operationId": "subscriptions.cancel",
        "summary": "ביטול מנוי",
        "description": "מכל מצב שאינו canceled/completed. אין חיובים נוספים.",
        "x-calio-capability": "subscriptions:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "subscription_invalid_state",
          "subscription_changed",
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "SUBSCRIPTION_REASON",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/subscriptions/{id}/payment_method_update_link": {
      "post": {
        "operationId": "subscriptions.payment_method_update_link",
        "summary": "קישור לעדכון כרטיס",
        "description": "קישור (72 שעות) לדף שבו הלקוח מחליף כרטיס. אחרי החלפה ממצב פיגור — חיוב מיידי.",
        "x-calio-capability": "subscriptions:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "subscription_invalid_state",
          "subscription_changed",
          "resource_not_found",
          "url_domain_not_allowed",
          "test_mode_unsupported"
        ],
        "responses": {
          "201": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethodUpdateLink"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "SUBSCRIPTION_LINK",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/subscriptions/{id}/test/activate": {
      "post": {
        "operationId": "subscriptions.test_activate",
        "summary": "בדיקה: הלקוח הזין כרטיס",
        "description": "מצב בדיקה בלבד — מדמה הזנת כרטיס בדף המנוי (גם החלפת כרטיס ממצב פיגור). שולח את אותם אירועים.",
        "x-calio-capability": "subscriptions:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "subscription_invalid_state",
          "subscription_changed",
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/subscriptions/{id}/test/charge": {
      "post": {
        "operationId": "subscriptions.test_charge",
        "summary": "בדיקה: חיוב מחזור",
        "description": "מצב בדיקה בלבד — מריץ את אותו כלל מצבים של מנוע החיובים: succeeded / declined (ניסיון חוזר) / card_declined (פיגור).",
        "x-calio-capability": "subscriptions:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "subscription_invalid_state",
          "subscription_changed",
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "SUBSCRIPTION_TEST_CHARGE",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/orders": {
      "post": {
        "operationId": "orders.create",
        "summary": "הזמנה בלי תשלום",
        "description": "מזומן לשליח / תשלום באיסוף / העברה. רק אם בעל העסק אישר, עם מפתח שיש לו orders:create_unpaid, ועד 50 ביום. ההזמנה נכנסת כ-pending (ממתינה לתשלום); המלאי והקבלה — כשבעל העסק מסמן שולם (order.paid).",
        "x-calio-capability": "orders:create_unpaid",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "unpaid_orders_not_allowed",
          "shipping_fee_not_allowed",
          "discount_not_allowed",
          "product_not_found",
          "product_unavailable",
          "product_out_of_stock",
          "invalid_variant",
          "invalid_quantity",
          "custom_lines_disabled",
          "price_changed",
          "amount_below_minimum",
          "customer_not_found"
        ],
        "responses": {
          "201": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "ORDER_CREATE"
      },
      "get": {
        "operationId": "orders.list",
        "summary": "רשימת הזמנות",
        "description": "הזמנות ערוץ האתר בלבד. ?status= ו-?payment_status= לסינון.",
        "x-calio-capability": "orders:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderList"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "ORDERS_QUERY"
      }
    },
    "/v1/orders/{id}": {
      "get": {
        "operationId": "orders.get",
        "summary": "הזמנה",
        "description": "הזמנה של ערוץ האתר.",
        "x-calio-capability": "orders:read",
        "x-calio-rate-class": "read",
        "x-calio-errors": [
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/orders/{id}/status": {
      "post": {
        "operationId": "orders.status",
        "summary": "עדכון: נשלחה / נמסרה",
        "description": "האתר מסמן shipped או delivered (למשל מחברת השליחויות). ביטול — רק באפליקציה (הוא מזכה את הלקוח).",
        "x-calio-capability": "orders:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "order_invalid_state",
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "ORDER_STATUS_UPDATE",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/orders/{id}/test/advance": {
      "post": {
        "operationId": "orders.test_advance",
        "summary": "בדיקה: שינוי סטטוס",
        "description": "מצב בדיקה בלבד — מדמה את בעל העסק: shipped / delivered / canceled (הזמנה ממתינה מאושרת קודם).",
        "x-calio-capability": "orders:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "order_invalid_state",
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "ORDER_TEST_ADVANCE",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/orders/{id}/test/mark_paid": {
      "post": {
        "operationId": "orders.test_mark_paid",
        "summary": "בדיקה: סומנה כשולמה",
        "description": "מצב בדיקה בלבד — הזמנה בלי תשלום מסומנת שולמה (order.paid).",
        "x-calio-capability": "orders:write",
        "x-calio-rate-class": "write",
        "x-calio-errors": [
          "order_invalid_state",
          "resource_not_found"
        ],
        "responses": {
          "200": {
            "description": "הצלחה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "default": {
            "description": "שגיאה",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-calio-request-schema-ref": "EMPTY",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  }
}
