Calio API2026-10-18 Postman

Calio API

חיבור אתר חיצוני לעסק בקאליו: דפי תשלום, קטלוג ומלאי, מנויים, לקוחות, מסמכים ו-webhooks.

כתובת בסיסhttps://api.calio-app.com/v1
מצב בדיקהcalio_sk_test_…מסוף הבדיקה של קאליו · כל חיוב ₪2 · לקוחות ומנויים בארגז חול
מצב אמתcalio_sk_live_…תשלומים אמיתיים במסוף של העסק

אותה כתובת לשני המצבים — המפתח שבבקשה קובע אם זו בדיקה או אמת.

AI

התחלה מהירה עם בינה מלאכותית

עובדים עם Claude, ChatGPT או Cursor? תנו למודל את כל התיעוד בקובץ אחד, והוא יכתוב את החיבור לפי הכללים.

  1. הקובץ למודלhttps://calio-app.com/developers/llms.txt
  2. הודעת פתיחהמדביקים אותה כהודעה הראשונה — עם הכללים שהמודל חייב לשמור.
  3. מפתח בדיקהכמשתנה הסביבה CALIO_SECRET_KEY בשרת — לא בצ'אט.
הסבר לכל כלי, ותוספות מוכנות לדף תשלום, הזמנות ומנויים ←

גרסה 2026-10-18 · נוצר אוטומטית מהמקור שהשרת אוכף. אם משהו כאן לא נכון — זה באג אצלנו.

מה אפשר לעשות עם ה-API

ה-API של קאליו לאתרים חיצוניים: דפי תשלום, קטלוג ומלאי, מנויים, לקוחות ומסמכים. כל קריאה היא שרת-מול-שרת עם מפתח סודי.

  • דף תשלום של קאליו לעגלה מהאתר — המחיר נלקח מהקטלוג בשרת, לא ממה שהגולש שולח. כל תשלום נרשם כעסקה עם קבלה ומוריד מלאי.
  • קטלוג ומלאי: מוצרים, שירותים, וריאציות ומלאי לפי מידה — לקריאה, כדי שהאתר יציג בדיוק את מה שבאפליקציה.
  • מנויים: חיוב חוזר שבועי / חודשי / שנתי. הלקוח מזין כרטיס בדף של קאליו; כל חיוב — עסקה עם קבלה.
  • לקוחות: אותו כרטיס לקוח כמו באפליקציה של העסק.
  • מסמכים: קריאה של קבלות וחשבוניות של תשלומים שעברו דרכנו, ו-PDF בקישור חתום.
  • Webhooks: קאליו מודיעה לשרת של האתר על כל שינוי — חתום, עם ניסיונות חוזרים.
כל קריאה היא שרת-מול-שרת עם מפתח סודי. לעולם לא מקוד שרץ אצל הגולש ולא מאפליקציה בטלפון — מפתח שנשלח משם נחסם (secret_key_from_browser).

התחלה מהירה — תשלום ראשון ב-5 צעדים

  • מקבלים מפתח בדיקה: בעל העסק יוצר אותו באפליקציה (הגדרות ← חיבור לאתר (API) ← מפתחות ← מפתח בדיקה), או שקאליו שולחת לכם אותו.
  • בעל העסק מוסיף את הדומיין של האתר תחת "דומיינים והגדרות תשלום" (אחרת כתובת החזרה תידחה).
  • יוצרים דף תשלום (POST /v1/checkout_sessions) ומפנים את הקונה ל-url שחזר.
  • הקונה משלם בכרטיס בדיקה — במצב בדיקה כל חיוב הוא ₪2 בדיוק, בלי עסקה ובלי מסמך אמיתי.
  • מקבלים payment.succeeded ב-webhook, מאמתים את החתימה — ורק אז שולחים את הסחורה / פותחים את השירות.
const res = await fetch('https://api.calio-app.com/v1/checkout_sessions', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    "lines": [
      {
        "product_id": "prd_shirt1",
        "quantity": 2,
        "variant": {
          "מידה": "M"
        }
      },
      {
        "name": "דמי משלוח",
        "quantity": 1,
        "unit_price_agorot": 2500
      }
    ],
    "customer": {
      "name": "דנה כהן",
      "phone": "0501234567",
      "email": "dana@example.co.il"
    },
    "reference": "ORDER-1042",
    "success_url": "https://shop.co.il/thanks",
    "cancel_url": "https://shop.co.il/cart"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
החזרה של הקונה לאתר (success_url) אינה הוכחה לתשלום — היא רק נוחות. ההוכחה היא אירוע payment.succeeded חתום, או GET /v1/payments/{id}.

התחלה מהירה עם בינה מלאכותית

עובדים עם Claude, ChatGPT, Cursor או כלי קוד אחר? כל התיעוד נמצא בקובץ אחד שמודלים קוראים בקלות — llms.txt. נותנים אותו למודל, מדביקים הודעת פתיחה, והוא כותב את החיבור לפי הכללים.

1. נותנים למודל את התיעוד

  • בצ'אט (Claude, ChatGPT): מדביקים את הקישור https://calio-app.com/developers/llms.txt יחד עם הודעת הפתיחה. כלי שלא פותח קישורים — מורידים את הקובץ ומצרפים אותו.
  • בכלי קוד (Cursor, Claude Code, Copilot): שומרים את הקובץ בתיקיית הפרויקט (למשל docs/calio-api.md), או מוסיפים את הקישור כמקור תיעוד — ומפנים אליו בהודעה.
BASH
curl -o docs/calio-api.md https://calio-app.com/developers/llms.txt

2. הודעת הפתיחה

הודעת פתיחה
אני מחבר את האתר שלי ל-API של Calio (קאליו). כל התיעוד נמצא בקובץ אחד:
https://calio-app.com/developers/llms.txt
קרא אותו לפני שאתה כותב קוד, ועבוד רק לפיו: אל תנחש שמות שדות, נקודות קצה, אירועים או קודי שגיאה. אם משהו לא כתוב שם — שאל אותי.

כללים שחייבים להישמר:
- הקריאות ל-API יוצאות רק מהשרת שלי. המפתח הסודי נקרא ממשתנה הסביבה CALIO_SECRET_KEY — לעולם לא בקוד שרץ בדפדפן, לא באפליקציה ולא במאגר הקוד.
- עובדים קודם במצב בדיקה (מפתח calio_sk_test_…). שם כל חיוב הוא ₪2 בכרטיס בדיקה.
- כל בקשת כתיבה נשלחת עם כותרת Idempotency-Key ייחודית, וניסיון חוזר של אותה פעולה — עם אותו ערך.
- סכומים הם תמיד באגורות (שדות *_agorot).
- תשלום נחשב שבוצע רק לפי אירוע payment.succeeded ב-webhook שהחתימה שלו (כותרת Calio-Signature) אומתה, או לפי GET /v1/payments/{id}. חזרה של הקונה ל-success_url אינה הוכחה לתשלום.
- אותו אירוע webhook יכול להגיע יותר מפעם אחת — מזהים אותו לפי ה-id שלו ומטפלים בו פעם אחת.
- success_url ו-cancel_url — https בלבד, בדומיין שהעסק אישר מראש.
- מטפלים בשגיאות לפי error.code ו-error.retryable שבתיעוד.

מה אני צריך: <כתבו כאן — או הדביקו אחת מהתוספות שבתיעוד>

3. תוספת לפי מה שבונים

מדביקים במקום השורה האחרונה בהודעת הפתיחה:

דף תשלום
מה אני צריך — דף תשלום לעגלה:
1. נקודת קצה בשרת שמקבלת את העגלה, יוצרת דף תשלום (POST /v1/checkout_sessions) עם השורות, פרטי הלקוח, reference (מספר ההזמנה שלנו), success_url ו-cancel_url — ומפנה את הקונה ל-url שחזר.
2. נקודת קצה ל-webhook שמאמתת את Calio-Signature, ובאירוע payment.succeeded מסמנת את ההזמנה שלנו כשולמה (לפי reference).
3. עמוד תודה ב-success_url שמציג "התשלום מתעדכן" עד שה-webhook הגיע.
הזמנות חנות
מה אני צריך — הזמנות מהחנות שלנו, כמו הזמנה מחנות קאליו:
1. ביצירת דף התשלום (POST /v1/checkout_sessions) לשלוח גם order: fulfillment (shipping / pickup / none), shipping_address במשלוח, shipping_method_name ו-shipping_fee_agorot, discount, requested_date ו-time_slot אם יש, ו-note.
2. דמי משלוח והנחה עובדים רק אם בעל העסק אישר אותם — השגיאות shipping_fee_not_allowed / discount_not_allowed אומרות שלא.
3. ב-webhook לטפל ב-order.created וב-order.status_changed ולעדכן את מצב ההזמנה אצלנו.
4. כשאנחנו שולחים את החבילה — לעדכן עם POST /v1/orders/{id}/status (status: shipped).
5. במצב בדיקה לדמות את בעל העסק עם POST /v1/orders/{id}/test/advance.
מנויים
מה אני צריך — מנוי בחיוב חוזר:
1. נקודת קצה שיוצרת מנוי (POST /v1/subscriptions) עם name, amount_agorot, interval ופרטי הלקוח, ומפנה את הלקוח ל-setup_url להזנת כרטיס. האתר לעולם לא מחייב כרטיס בעצמו.
2. ב-webhook לטפל ב-subscription.activated, subscription.payment_succeeded, subscription.payment_failed, subscription.past_due ו-subscription.canceled, ולפתוח / לסגור את הגישה של הלקוח באתר.
3. במצב בדיקה אין דף כרטיס: מפעילים עם POST /v1/subscriptions/{id}/test/activate ומדמים חיוב עם POST /v1/subscriptions/{id}/test/charge.
המודל לא צריך את המפתח הסודי כדי לכתוב את הקוד. לא מדביקים מפתח בצ'אט — גם לא מפתח בדיקה. שמים אותו כמשתנה הסביבה CALIO_SECRET_KEY בשרת.

לפני שעולים לאוויר — לבדוק במה שהמודל כתב

  • אין מפתח calio_sk_ בשום קובץ שמגיע לדפדפן או למאגר הקוד.
  • ה-webhook מאמת את Calio-Signature ומסרב לבקשה בלי חתימה תקינה.
  • הזמנה מסומנת כשולמה רק מ-payment.succeeded (או GET /v1/payments/{id}) — לא מהחזרה ל-success_url.
  • ניסיון חוזר של בקשה נשלח עם אותו Idempotency-Key.
  • כל התרחיש עבר במצב בדיקה: תשלום של ₪2 בכרטיס בדיקה, ואירוע webhook שהגיע ואומת.

אימות ומפתחות

כל בקשה נושאת את המפתח בכותרת Authorization:

HTTP
Authorization: Bearer calio_sk_test_…
  • calio_sk_test_… — מצב בדיקה. calio_sk_live_… — תשלומים אמיתיים (נוצר רק אחרי התחברות מחדש של בעל העסק, והוא מקבל התראה).
  • המפתח מוצג לבעל העסק פעם אחת. אם הלך לאיבוד — מבטלים ויוצרים חדש. עד 2 מפתחות פעילים מכל סוג (להחלפה בלי השבתה).
  • בעל העסק יכול לבטל מפתח, לעצור את כל החיבור, או לכבות את שליפת רשימת הלקוחות — מהאפליקציה, בכל רגע.
  • לפי בקשה, קאליו יכולה להגביל מפתח לכתובות IP מסוימות ולקבוע לו תאריך תפוגה. מפתח אמיתי שמופיע מכתובת חדשה מתריע לבעל העסק.
  • תשלומים חשודים שעברו (למשל הרבה תשלומים קטנים בכרטיסים שונים) משעים את כל המפתחות של העסק מיד, ומתריעים לבעל העסק ולקאליו. פתיחות חריגות של דפי תשלום רק מתריעות, כי כל מבקר יכול לייצר אותן.
  • קישור תשלום נחסם אחרי 10 פתיחות, ואחרי 5 כרטיסים שנדחו ברצף הקונה חוזר לדף הכישלון.

יכולות (capabilities)

יכולתמה מאפשרתברירת מחדל
account:readפרטי החיבורכן
catalog:readקריאת מוצרים ושירותיםכן
checkout:writeיצירת דפי תשלוםכן
checkout:readקריאת דפי תשלוםכן
payments:readקריאת תשלומיםכן
customers:readקריאת לקוח וחיפושכן
customers:listרשימת כל הלקוחותכן
customers:writeיצירה ועדכון של לקוחותכן
subscriptions:readקריאת מנוייםכן
subscriptions:writeיצירה וניהול מנוייםכן
subscriptions:amountשינוי סכום מנוי🔴 רק אם בעל העסק הפעיל
documents:readקריאת מסמכיםכן
events:readקריאת אירועיםכן
orders:readקריאת הזמנותכן
orders:writeעדכון הזמנה ל"נשלחה" / "נמסרה"כן
orders:create_unpaidהזמנות בלי תשלום (מזומן / תשלום באיסוף)🔴 רק אם בעל העסק הפעיל

מצב בדיקה

  • מפתח בדיקה עובד מול מסוף הבדיקה של קאליו — גם לפני שהעסק חיבר סליקה.
  • 🔴 כל חיוב במצב בדיקה הוא ₪2 בדיוק, לא משנה מה סכום העגלה. כרטיס אמיתי נדחה במסוף הבדיקה.
  • תשלום בדיקה לא יוצר עסקה, לקוח, מלאי או מסמך חשבונאי. המסמך שחוזר הוא test_receipt — בלי תוקף.
  • לקוחות ומנויים במצב בדיקה הם ארגז-חול נפרד — מפתח בדיקה לעולם לא רואה לקוח אמיתי של העסק.
  • מנויים במצב בדיקה: אין דף כרטיס — מפעילים ומדמים חיובים עם POST /v1/subscriptions/{id}/test/activate ו-…/test/charge.
פרטי כרטיסי הבדיקה יפורסמו כאן עם פתיחת מסוף הבדיקה. עד אז — בקשו אותם מקאליו.

בקשות, עימוד וגרסאות

  • כתובת בסיס: https://api.calio-app.com. גוף JSON בלבד (Content-Type: application/json), עד 64KB.
  • כל בקשת כתיבה (POST / PATCH) חייבת Idempotency-Key ייחודי. אותה בקשה עם אותו מפתח ⇒ אותה תשובה בדיוק, בלי פעולה כפולה. אותו מפתח עם גוף אחר ⇒ 409 idempotency_key_reused.
  • שדה לא מוכר בבקשה ⇒ 400 unknown_parameter (כדי ששגיאת כתיב לא "תעבור בשקט").
  • סכומים — תמיד באגורות שלמות (12900 = ₪129).
  • רשימות: limit (1–100), starting_after=<id>; בתשובה has_more ו-next_cursor.
  • גרסה: Calio-Api-Version: 2026-10-18 (אופציונלי; בלי — הגרסה הנוכחית). כל תשובה מחזירה Calio-Request-Id — שלחו אותו לתמיכה.
  • מזהים: cs_ דף תשלום · pay_ תשלום · prd_ מוצר · cus_ לקוח · sub_ מנוי · doc_ מסמך · evt_ אירוע.
  • Postman: מייבאים את postman_collection.json (בראש העמוד), שמים מפתח בדיקה במשתנה secret_key ומריצים. מאפליקציית Postman למחשב — בקשה מגרסת הדפדפן של Postman נחסמת, כמו כל בקשה עם מפתח סודי מדפדפן.

שגיאות

כל שגיאה באותה מעטפה. code יציב — עליו בונים לוגיקה; message בעברית — אפשר להציג למשתמש; developer_message — לכם.

JSON
{
  "error": {
    "type": "invalid_request",
    "code": "product_out_of_stock",
    "message": "המוצר אזל מהמלאי",
    "developer_message": "prd_shirt1: requested 2, available 1",
    "param": "lines[0]",
    "retryable": false,
    "retry_after_seconds": null,
    "doc_url": "https://calio-app.com/developers/#error-product_out_of_stock",
    "request_id": "req_…"
  }
}
codeHTTPלנסות שובהודעהמתימה לעשות
invalid_api_key401לאמפתח ה-API אינו תקיןThe Authorization header is missing, malformed, or the key does not exist / the secret does not match.Send 'Authorization: Bearer calio_sk_…'. Check you copied the whole key.
api_key_revoked401לאמפתח ה-API בוטלThe key was revoked by the business owner.Create a new key in the Calio app (חיבור לאתר → מפתחות).
api_key_expired401לאתוקף מפתח ה-API פגThe key passed its expiry (rotation window ended, or unused for 180 days).Create a new key in the Calio app.
api_key_ip_not_allowed403לאהמפתח הזה לא מקבל בקשות מהכתובת הזוThe key has an IP list and this request came from another address.Send it from an allowed server, or ask Calio to update the key's IP list.
key_suspended_security403לאמפתח ה-API הושעה מטעמי אבטחהCalio's protection engine suspended the key (suspected abuse).The business owner was notified. Reactivation is manual, from the Calio app, after review.
capability_denied403לאלמפתח הזה אין הרשאה לפעולהThe key's capabilities do not include the one this endpoint requires.The business owner can enable the capability for this key in the Calio app.
secret_key_from_browser403לאאין לשלוח את המפתח הסודי מהדפדפןThe request carried a browser Origin header — the secret key is being used from client-side code and is exposed to every visitor.Move the call to your server and rotate the key immediately.
auth_rate_limited429כןיותר מדי ניסיונות התחברות. נסו שוב מאוחר יותרToo many failed authentications from this IP.Wait for Retry-After. Check the key you are sending.
rate_limited429כןיותר מדי בקשות. נסו שוב בעוד רגעA per-key / per-business / platform request-rate limit was reached.Retry after Retry-After seconds with the same Idempotency-Key.
monthly_quota_exceeded429לאהגעתם למכסת הבקשות החודשיתThe business used its monthly API request quota.The quota resets at the start of the month (Retry-After). Contact Calio to raise it.
rate_limiter_unavailable503כןהשירות אינו זמין כרגע. נסו שוב בעוד רגעThe request-limit store is unreachable. Calio fails closed rather than unprotected.Retry with backoff and the same Idempotency-Key.
api_disabled403לאהחיבור לאתר אינו פעיל לעסק הזהThe API is switched off for this business (by the owner or by Calio).The business owner can switch it on in the Calio app.
api_unavailable503כןהשירות אינו זמין כרגע. נסו שוב בעוד רגעThe API is temporarily switched off platform-wide, or its configuration could not be read.Retry with backoff.
provider_not_supported_yet403לאאמצעי הסליקה של העסק עדיין לא נתמך בחיבור לאתרThe business clears online payments with a provider the API does not support yet.Contact Calio support.
api_version_invalid400לאגרסת ה-API אינה מוכרתThe Calio-Api-Version header names a version that does not exist.Omit the header or send a version listed in the docs.
invalid_json400לאגוף הבקשה אינו JSON תקיןThe request body could not be parsed as a JSON object.Send a JSON object with Content-Type: application/json.
unsupported_media_type415לאסוג התוכן אינו נתמךA request with a body was sent without Content-Type: application/json.Set Content-Type: application/json.
payload_too_large413לאהבקשה גדולה מדיThe request body exceeds 64KB.Reduce the number of lines or the metadata size.
missing_parameter400לאחסר שדה חובה בבקשהA required field is missing. 'param' names it.Add the field named in 'param'.
invalid_parameter400לאאחד השדות בבקשה אינו תקיןA field has the wrong type, format or range. 'param' names it, 'developer_message' says why.Fix the field named in 'param'.
unknown_parameter400לאהבקשה כוללת שדה לא מוכרThe body contains a field the endpoint does not accept (typo, or a field from another endpoint).Remove or rename the field named in 'param'.
method_not_allowed405לאהפעולה אינה נתמכת בכתובת הזוThe path exists but not with this HTTP method.Check the method in the docs.
route_not_found404לאהכתובת אינה קיימתNo endpoint matches the path.Check the path and the /v1 prefix.
resource_not_found404לאהפריט המבוקש לא נמצאThe id does not exist, or belongs to another business (Calio does not confirm which).Check the id.
idempotency_key_required400לאחסרה כותרת Idempotency-KeyEvery POST/PATCH must carry an Idempotency-Key header.Send a unique Idempotency-Key (e.g. a UUID) per logical operation, and reuse it on retries.
idempotency_key_invalid400לאכותרת Idempotency-Key אינה תקינהThe key is empty, longer than 255 characters, or contains characters outside printable ASCII.Use a UUID.
idempotency_key_reused409לאהבקשה כבר נשלחה עם תוכן אחרThe same Idempotency-Key was used with a different method, path or body within 24 hours.Use a new Idempotency-Key for a new operation.
idempotency_request_in_progress409כןהבקשה עדיין בטיפולA request with the same Idempotency-Key is still being processed.Retry after Retry-After seconds with the same key; you will get the original response.
internal_error500כןאירעה שגיאה. נסו שוב בעוד רגעAn unexpected error on Calio's side. Nothing partial is committed for idempotent requests.Retry with backoff and the same Idempotency-Key. If it persists, contact support with request_id.
product_not_found422לאהמוצר המבוקש לא נמצאproduct_id does not exist, was deleted, or the business hid it from the API.Read GET /v1/products for current ids.
product_unavailable422לאהמוצר אינו זמין כרגעThe product exists but is inactive, hidden, or has a price range instead of a single price.Remove the line, or ask the business to activate the product.
product_out_of_stock409לאהמוצר אזל מהמלאיRequested quantity (summed across the cart per variant) exceeds the shelf. error.available holds the current stock.Show the buyer the available quantity and let them change the cart.
invalid_variant422לאבחירת האפשרויות למוצר אינה תקינהA required variant group is missing, an option does not exist or is sold out, or a group's min/max was violated.Read the product's variant_groups and send a valid selection.
invalid_quantity422לאהכמות אינה תקינהQuantity is outside the product's min/max or not a multiple of its step. error.min_quantity/max_quantity/step tell the rule.Send a quantity that follows the rule.
custom_lines_disabled403לאהעסק לא מאפשר שורות בסכום חופשיA line without product_id was sent, but the business allows catalog products only.Use catalog products, or ask the business to allow custom lines.
price_changed409לאהמחיר השתנהexpected_total_agorot was sent and differs from the total computed from the current catalog. error.amount_total_agorot holds the current total.Show the buyer the new total and send again with the new expected_total_agorot.
amount_below_minimum422לאהסכום נמוך מהמינימום לתשלוםThe total is below the provider's minimum (₪1).Raise the amount.
amount_above_business_limit422לאהסכום גבוה מהמותר לעסק בתשלום יחידThe business set its own per-payment maximum in the app and the total exceeds it.Split the payment, or ask the business to raise its limit.
installments_not_allowed422לאמספר התשלומים גבוה מהמותר לעסקmax_installments exceeds what the business allows (its setting and its plan).Send a lower max_installments (error.allowed holds the maximum).
url_domain_not_allowed422לאכתובת החזרה אינה ברשימת הדומיינים של העסקsuccess_url / cancel_url is not https, or its domain is not in the business's allowed return domains.Use an https URL on a domain the business added in the app (חיבור לאתר → דומיינים).
business_cannot_accept_payments403לאהעסק אינו יכול לקבל תשלומים כרגעThe business has no active internet clearing terminal right now. Checked BEFORE the buyer sees a payment page.The business owner was notified. Try again later.
business_cannot_issue_documents403לאהעסק אינו יכול להפיק קבלות כרגעThe business is not connected to its documents provider. Checked BEFORE the buyer pays.The business owner was notified. Try again later.
plan_quota_reached403לאהעסק הגיע למכסת התשלומים במסלולThe business used the digital payments included in its plan this month.The business owner was notified.
checkout_session_not_open409לאדף התשלום כבר אינו פתוחExpire was requested for a session that is already paid, expired or canceled.GET the session for its current status.
checkout_session_in_payment409כןהלקוח נמצא באמצע תשלוםExpire was requested while the buyer has the payment page open (last 3 minutes).Retry after Retry-After, or let the session expire on its own.
customer_not_found404לאהלקוח לא נמצאcustomer_id does not exist in this business.Create the customer with POST /v1/customers, or send customer details inline.
document_pdf_unavailable409כןקובץ ה-PDF של המסמך עוד לא מוכןThe document exists but its PDF copy is not stored yet (it is copied a few seconds after issuing), or the file is missing.Retry in a minute. The document data itself (GET /v1/documents/{id}) is available now.
customer_exists409לאכבר קיים לקוח עם הטלפון או המייל האלהPOST/PATCH with a phone or email that another customer card of the business already has. extra.customer_id names it.Use the existing customer (extra.customer_id) — Calio never creates a silent duplicate or overwrites a card.
customers_list_disabled403לאבעל העסק כיבה את שליפת רשימת הלקוחותThe owner switched off reading the whole customer list. Exact search by phone/email still works.Search by phone or email, or ask the business owner to switch the list on in the Calio app.
customers_list_blocked403לאשליפת רשימת הלקוחות נעצרה להגנת העסקMore than half of the customers were read in 24 hours — the pattern of a leaked key. The owner was alerted.The business owner approves in the Calio app (חיבור לאתר) if it was a legitimate sync.
subscription_invalid_state409לאלא ניתן לבצע את הפעולה במצב הנוכחי של המנויFor example pause on a subscription that is not active, resume on one that is not paused, or any change on a canceled / completed one. extra.status is the current public status.GET the subscription and act on its current status. A past_due subscription needs a new card: POST …/payment_method_update_link.
subscription_changed409כןהמנוי השתנה בזמן הפעולהThe subscription changed status between the read and the write (for example the engine charged it, or the business changed it in the app).GET the subscription again and retry if still relevant.
subscription_increase_too_large422לאהעלאת הסכום גדולה מהמותר לעדכון מהאתרThe new amount is more than 1.5 times the current one. extra.maximum_agorot is the most this call can set.Raise it in steps of up to 50%, 30 days apart, or ask the business to change it in the app.
subscription_increase_too_soon409לאהסכום של המנוי הזה הועלה לאחרונהA site raised this subscription's amount in the last 30 days. Lowering it is always allowed.Try again after 30 days, or ask the business to change it in the app.
subscription_amount_locked409לאסכום המנוי הזה ננעל ביצירהThe business passes the processing fee to the customer on this subscription; its amount can be changed only in the Calio app.Ask the business to change it in the app.
test_mode_unsupported400לאהפעולה הזו אינה זמינה במצב בדיקהThe operation needs a real card page (for example payment_method_update_link).In test mode use the test helpers: POST /v1/subscriptions/{id}/test/activate and …/test/charge.
shipping_fee_not_allowed403לאהעסק לא מאפשר לאתר לקבוע דמי משלוחorder.shipping_fee_agorot was sent, but the business did not allow the site to set a shipping fee.Send the order without a shipping fee, or ask the business to allow it (Calio app → חיבור לאתר).
discount_not_allowed403לאהעסק לא מאפשר לאתר לתת הנחהorder.discount was sent, but the business did not allow the site to give order discounts.Send the order without a discount, or ask the business to allow it (Calio app → חיבור לאתר).
unpaid_orders_not_allowed403לאהעסק לא מאפשר הזמנות בלי תשלוםPOST /v1/orders was called, but the business did not allow orders without payment, or this key lacks orders:create_unpaid.Take the payment with a checkout session, or ask the business to allow orders without payment and to create a key with that capability.
order_invalid_state409לאלא ניתן לשנות את ההזמנה במצב הנוכחיFor example marking a canceled order as shipped, or delivered → shipped. extra.status is the current status.GET the order and act on its current status. A cancellation is done only by the business in the Calio app.

תקרות

מהתקרה
קריאות נתונים — למפתח600 בדקה · 20000 בשעה
כתיבות — למפתח120 בדקה · 5000 בשעה
יצירת דפי תשלום — לעסק30 בדקה · 10000 ביום
יצירת מנויים — לעסק30 בדקה · 2000 ביום
רשומות לקוחות שנקראות — לעסק1000 בשעה; קריאת יותר ממחצית הלקוחות ביממה עוצרת את הרשימה עד אישור בעל העסק
קריאות בחודש — לעסק100,000 (אפשר לבקש העלאה מהאפליקציה)

מעבר לתקרה ⇒ 429 עם Retry-After. בכל תשובה: X-RateLimit-Limit / X-RateLimit-Remaining.

הצפה מכתובת אחת נעצרת עוד לפני ה-API: התשובה היא 429 בלי גוף JSON ובלי Retry-After. ממתינים דקה ומנסים שוב. כתובת שמעבר לכך חסומה ל-10 דקות. לקוח שהשרת שלו צריך יותר — פונה לקאליו.

Webhooks — קאליו מודיעה לשרת של האתר

  • בעל העסק מגדיר את הכתובת באפליקציה (חיבור לאתר ← Webhooks) ומקבל סוד חתימה (whsec_…). כתובת לעולם לא משתנה דרך ה-API.
  • כל הודעה: POST JSON עם Calio-Event-Id, Calio-Api-Version ו-Calio-Signature: t=<unix>,v1=<hmac>.
  • לענות 2xx מהר (עד 10 שניות). כשל ⇒ ניסיון חוזר אחרי 1 דק', 5 דק', 30 דק', 2 שע', 6 שע', 24 שע'. 3 ימים בלי הצלחה ⇒ הכתובת מושבתת ובעל העסק מקבל התראה.
  • 🔴 בכתובת של האתר החי — דחו כל אירוע עם livemode: false (ובכתובת הבדיקה — עם livemode: true). אירוע בדיקה אינו תשלום אמיתי.
  • אותו אירוע יכול להגיע יותר מפעם אחת — שמרו את id והתעלמו מכפילות. הסדר אינו מובטח, ו-data.object הוא המצב ברגע האירוע — לא בהכרח העדכני. לפני פעולה שתלויה במצב (למשל סימון מנוי כ"בפיגור" אחרי שכבר בוטל), קראו את האובייקט מה-API.
  • פספסתם? GET /v1/events מחזיר את כל האירועים של 30 הימים האחרונים.

אימות חתימה

HMAC-SHA256 על "<t>.<הגוף הגולמי>" עם הסוד, ובדיקה ש-t בטווח של 5 דקות. בהחלפת סוד — 24 שעות שבהן ההודעה נושאת שתי חתימות v1.

// Node.js
const crypto = require('crypto');
function verifyCalio(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = crypto.createHmac('sha256', secret).update(t + '.' + rawBody, 'utf8').digest('hex');
  const want = Buffer.from(expected, 'hex');
  return header.split(',').filter((p) => /^v1=[0-9a-f]{64}$/.test(p)).some((p) => {
    const got = Buffer.from(p.slice(3), 'hex');
    return got.length === want.length && crypto.timingSafeEqual(got, want);
  });
}

האירועים

typeאובייקטמתימה לעשות
checkout.session.completedCheckoutSessionהקונה שילם, והכסף אומת מול חברת הסליקה.אפשר להציג 'ההזמנה התקבלה'. את השירות פותחים לפי payment.succeeded.
checkout.session.expiredCheckoutSessionדף התשלום פג בלי תשלום.לשחרר את העגלה / להציע ללקוח קישור חדש.
checkout.session.canceledCheckoutSessionהדף בוטל (ע"י האתר או העסק).—
payment.succeededPaymentהכסף התקבל. נשלח כשהעסקה נרשמה — או אם הרישום מתעכב, עם document_status: pending.🔴 לשלוח סחורה / לפתוח שירות — רק על האירוע הזה (ואחרי אימות חתימה).
payment.requires_attentionPaymentנפתח issue שהעסק צריך לטפל בו באפליקציה (למשל המסמך לא הופק).מידע בלבד — לא סיבה לעצור את הלקוח.
payment.attention_resolvedPaymentכל ה-issues הפתוחים נסגרו.—
payment.refundedPaymentהתשלום זוכה במלואו (באפליקציה).לבטל את ההזמנה / את השירות באתר.
payment.partially_refundedPaymentזיכוי חלקי (באפליקציה). refunded_amount_agorot מעודכן.לעדכן את ההזמנה באתר.
document.createdPaymentהופק מסמך חשבונאי על תשלום (גם מסמך שהופק מאוחר יותר באפליקציה).—
subscription.activatedSubscriptionהלקוח הזין כרטיס בדף המנוי והמנוי פעיל. החיוב הראשון — היום (או ב-start_date).לפתוח את השירות למנוי.
subscription.payment_succeededSubscriptionחיוב מחזור הצליח (נרשמה עסקה עם קבלה). charges_count עלה.להאריך את השירות לתקופה הבאה.
subscription.payment_failedSubscriptionחיוב מחזור נכשל. המנוע מנסה שוב כל יום (עד 5 ניסיונות) — אלא אם הכרטיס נדחה סופית.להציע ללקוח לעדכן כרטיס (payment_method_update_link).
subscription.past_dueSubscriptionהמנוי בפיגור: past_due_reason אומר למה (payment_failed / card_declined / payment_method_invalid).לשלוח ללקוח קישור לעדכון כרטיס. לא לחסום מיד — בכשל רך המנוע עוד מנסה.
subscription.recoveredSubscriptionמנוי שהיה בפיגור חזר להיות פעיל (חיוב הצליח או הוחלף כרטיס).להסיר הודעת פיגור באתר.
subscription.pausedSubscriptionהמנוי הושהה (דרך ה-API או באפליקציה). אין חיובים עד חידוש.להשהות את השירות.
subscription.resumedSubscriptionהמנוי חודש אחרי השהיה. החיוב הבא — בהרצה הקרובה (08:00).לחדש את השירות.
subscription.canceledSubscriptionהמנוי בוטל — דרך ה-API, באפליקציה, או אחרי 5 כשלונות רצופים.לסיים את השירות בסוף התקופה ששולמה.
subscription.completedSubscriptionהמנוי הגיע ל-max_charges והסתיים.—
subscription.updatedSubscriptionסכום המנוי שונה, או שהלקוח החליף כרטיס. previous אומר מה השתנה.—
order.createdOrderהזמנה נוצרה: הזמנה ששולמה בדף התשלום (checkout עם order), או הזמנה בלי תשלום (POST /v1/orders).לשמור את id ואת order_number. payment_status=paid ⇒ לספק; pending ⇒ לחכות ל-order.paid.
order.status_changedOrderסטטוס ההזמנה השתנה — ע"י בעל העסק באפליקציה (אושרה / נשלחה / נמסרה / בוטלה) או ע"י האתר (POST …/status). data.previous.status = הסטטוס הקודם.לעדכן את מצב ההזמנה באתר. canceled אחרי תשלום ⇒ גם payment.refunded (הזיכוי נעשה באפליקציה).
order.paidOrderהזמנה בלי תשלום (מזומן לשליח / תשלום באיסוף / העברה) סומנה "שולמה" באפליקציה.לסמן את ההזמנה כמשולמת באתר.

אובייקט התשלום — שלושה צירים נפרדים

  • status — הכסף: succeeded / partially_refunded / refunded.
  • document_status — המסמך: issued / pending / failed / not_required.
  • requires_attention + issues[] — מה בעל העסק צריך לטפל בו באפליקציה. אף פעם לא סיבה לעצור את הקונה: הכסף התקבל.

לדוגמה: תשלום שהצליח אבל הקבלה לא הופקה ⇒ status: succeeded · document_status: failed · requires_attention: true · issues: [document_generation_failed]. שולחים את ההזמנה; בעל העסק מפיק את הקבלה מהאפליקציה, ואז מגיע document.created.

issueחומרהמשמעות
document_generation_failedaction_requiredהתשלום התקבל אבל הקבלה לא הופקה. יש להפיק אותה מהאפליקציה.
document_amount_mismatchaction_requiredסכום המסמך אינו תואם לסכום ששולם. יש לבדוק באפליקציה.
missing_tax_invoiceaction_requiredחסרה חשבונית מס לעסקה.
missing_receiptaction_requiredחסרה קבלה לעסקה.
allocation_number_missingwarningהחשבונית הופקה בלי מספר הקצאה.
refund_incompleteaction_requiredזיכוי לא הושלם במלואו. יש לבדוק באפליקציה.
stock_shortfallwarningהמלאי ירד מתחת לאפס אחרי התשלום (שני קונים על אותה יחידה).
stock_reconcile_failedwarningעדכון המלאי לא הושלם. יש לבדוק את המלאי באפליקציה.
order_recording_delayedwarningהתשלום התקבל ורישום העסקה מתעכב. המערכת מנסה שוב.
order_recording_failedcriticalהתשלום התקבל אבל העסקה לא נרשמה. קאליו קיבלה התראה.
paid_after_expirywarningהתשלום התקבל אחרי שדף התשלום פג.
duplicate_paymentaction_requiredהלקוח שילם פעמיים על אותו דף תשלום. יש לזכות את התשלום הכפול מהאפליקציה.
amount_mismatchcriticalהסכום שהתקבל שונה מהסכום שנדרש. קאליו קיבלה התראה.
business_cannot_issue_documentsaction_requiredהתשלום התקבל אבל העסק אינו מחובר להפקת מסמכים.

הזמנות — כמו הזמנה מחנות קאליו

חנות שמחוברת ל-API יכולה לשלוח יחד עם דף התשלום אובייקט order: שיטת משלוח, כתובת, דמי משלוח, תאריך וחלון שעות, הערה ושדות נוספים. אחרי התשלום נוצרת הזמנה במסך ההזמנות של בעל העסק — לצד הזמנות החנות שלו — והוא מטפל בה כרגיל: אושרה ← נשלחה ← נמסרה, או ביטול שמזכה את הלקוח.

  • בלי order — דף התשלום נרשם כעסקה בלבד, כמו תמיד.
  • fulfillment: shipping (חובה shipping_address) / pickup / none.
  • דמי משלוח והנחה (discount: amount_agorot + label) — רק אם בעל העסק אישר זאת לאתר במסך החיבור. בלי אישור ⇒ shipping_fee_not_allowed / discount_not_allowed. מחירי המוצרים — תמיד מהקטלוג.
  • requested_date — היום או מאוחר יותר (לפי שעון ישראל), עד שנה קדימה; time_slot רק יחד איתו. הכללים של האתר (אזורים, ימי משלוח) לא נבדקים מול קאליו — ההזמנה היא מה שהקונה בחר באתר.
  • אחרי התשלום: checkout_session.order_id ו-payment.order_id, האירוע order.created, ו-GET /v1/orders/{id}.
  • האתר יכול לסמן נשלחה / נמסרה (POST /v1/orders/{id}/status). ביטול — רק באפליקציה, כי הוא מזכה את הלקוח; מגיע לאתר כ-order.status_changed + payment.refunded.

הזמנה בלי תשלום

POST /v1/orders — מזומן לשליח / תשלום באיסוף / העברה. ההזמנה נכנסת כ-pending (ממתינה לתשלום), בלי עסקה ובלי קבלה. כשבעל העסק מסמן "שולם" באפליקציה נוצרות עסקה וקבלה, המלאי יורד, ומגיע order.paid.

ארבע הגנות, כי אין כאן תשלום שמסנן הזמנות מזויפות: בעל העסק מדליק את האפשרות במפורש · המפתח צריך את היכולת orders:create_unpaid (לא ניתנת כברירת מחדל) · עד 50 הזמנות כאלה ביום · המלאי לא נתפס עד "שולם".

מה במכוון לא קיים ב-API

  • זיכויים — רק באפליקציה, ע"י אדם מזוהה. זיכוי שנעשה שם מגיע לאתר כ-payment.refunded.
  • חיוב כרטיס שמור — אין. מנויים מחויבים ע"י מנוע החיובים של קאליו בלבד, אחרי שהלקוח עצמו הזין כרטיס בדף של קאליו.
  • הפקת מסמך בלי תשלום — אין. מסמך נוצר רק מתשלום אמיתי שעבר דרכנו.
  • מחיקת לקוח — רק באפליקציה.
  • מחיר שהאתר קובע למוצר מהקטלוג — אין. המחיר הוא מחיר הקטלוג; שורה חופשית (למשל משלוח) — רק אם בעל העסק אישר.
כך, גם אם מפתח דלף: אי אפשר להחזיר כסף, לחייב כרטיס של לקוח, או להפיק חשבונית.

מדריך נקודות הקצה

חשבון

GET /v1/account

פרטי החיבור — לאיזה עסק המפתח שייך ומה מותר לו

הקריאה הראשונה בכל אינטגרציה: מאשרת שהמפתח עובד, במצב test או live, ומחזירה את ההרשאות שלו. readiness עונה האם דף תשלום live יתקבל עכשיו — גם במפתח test.

יכולת account:readקצב read

const res = await fetch('https://api.calio-app.com/v1/account', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "account",
  "livemode": true,
  "business": {
    "name": "סטודיו דנה"
  },
  "api_key": {
    "id": "a4F2k9QwErTyUiOp1234",
    "display": "calio_sk_live_a4F2…••••3d91",
    "name": null,
    "capabilities": [
      "account:read"
    ]
  },
  "request_ip": "203.0.113.10",
  "readiness": {
    "can_accept_live_payments": true,
    "live_blocker": null,
    "max_installments": 12,
    "minimum_agorot": 100,
    "maximum_agorot": null,
    "custom_lines_enabled": true,
    "return_domains": [
      "shop.co.il"
    ]
  }
}

דפי תשלום

POST /v1/checkout_sessions

יצירת דף תשלום

מקבל מוצרים מהקטלוג (המחיר מהשרת) ושורות חופשיות, ומחזיר כתובת לדף התשלום של קאליו. את הקונה מפנים ל-url. אישור התשלום מגיע ב-webhook (payment.succeeded) — לא לפי החזרה לדפדפן. עם order — אחרי התשלום נוצרת הזמנה במסך ההזמנות של העסק (order_id).

יכולת checkout:writeקצב writeדורש Idempotency-Key

שדה בגוף
orderobjectרשות
order.fulfillmentstringחובה
משלוח / איסוף עצמי / ללא (שירות, מוצר דיגיטלי) — אחד מ: shipping, pickup, none
order.shipping_addressobjectרשות
חובה כש-fulfillment הוא shipping
order.shipping_method_namestringרשות
השם שהקונה בחר באתר, למשל "שליח עד הבית" — עד 60 תווים
order.shipping_fee_agorotintegerרשות
רק אם בעל העסק אישר לאתר לקבוע דמי משלוח — מינ' 0 · מקס' 10000000
order.discountobjectרשות
הנחה על ההזמנה — רק אם בעל העסק אישר לאתר לתת הנחות
order.requested_datestringרשות
YYYY-MM-DD — היום או מאוחר יותר, עד שנה קדימה
order.time_slotobjectרשות
HH:MM — רק יחד עם requested_date
order.notestringרשות
הערת הקונה — עד 500 תווים
order.extra_fieldsarray<object>רשות
שדות נוספים מהאתר (הקדשה, מספר טלפון לשליח…) — מוצגים בהזמנה — עד 10 פריטים
linesarray<object>חובה
עד 100 פריטים
lines[].product_idstringרשות
מוצר או שירות מהקטלוג — המחיר נלקח מהקטלוג
lines[].quantitynumberחובה
מינ' 0.001 · מקס' 100000
lines[].variantobjectרשות
שם קבוצה → אפשרות (או מערך לקבוצה מרובת-בחירה)
lines[].namestringרשות
שורה חופשית בלבד — עד 120 תווים
lines[].unit_price_agorotintegerרשות
שורה חופשית בלבד — מינ' 1 · מקס' 100000000
expected_total_agorotintegerרשות
מינ' 1
customerobjectרשות
customer.namestringחובה
עד 120 תווים
customer.phonestringרשות
תבנית ^\+?[0-9][0-9\- ]{7,18}$
customer.emailstringרשות
עד 254 תווים · תבנית ^[^@\s]+@[^@\s]+\.[^@\s]+$
customer.tax_idstringרשות
תבנית ^[0-9]{5,9}$
customer.company_namestringרשות
עד 120 תווים
customer_idstringרשות
תבנית ^cus_[A-Za-z0-9_-]{1,128}$
referencestringרשות
עד 64 תווים
metadataobjectרשות
success_urlstringרשות
https בלבד, בדומיין שאושר באפליקציה
cancel_urlstringרשות
https בלבד, בדומיין שאושר באפליקציה
max_installmentsintegerרשות
מינ' 1 · מקס' 12
expires_in_minutesintegerרשות
מינ' 10 · מקס' 120
const res = await fetch('https://api.calio-app.com/v1/checkout_sessions', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    "lines": [
      {
        "product_id": "prd_shirt1",
        "quantity": 2,
        "variant": {
          "מידה": "M"
        }
      },
      {
        "name": "דמי משלוח",
        "quantity": 1,
        "unit_price_agorot": 2500
      }
    ],
    "customer": {
      "name": "דנה כהן",
      "phone": "0501234567",
      "email": "dana@example.co.il"
    },
    "reference": "ORDER-1042",
    "success_url": "https://shop.co.il/thanks",
    "cancel_url": "https://shop.co.il/cart"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 201
JSON
{
  "object": "checkout_session",
  "id": "cs_ps_x",
  "livemode": true,
  "status": "open",
  "url": "https://calio-app.com/p/ps_x",
  "created": "2025-10-18T11:40:00.000Z",
  "expires_at": "2025-10-18T12:10:00.000Z",
  "reference": "ORDER-1042",
  "metadata": {
    "cart_id": "c_88"
  },
  "customer": {
    "id": null,
    "name": "דנה כהן",
    "phone": "0501234567",
    "email": "d@x.co.il"
  },
  "lines": [
    {
      "type": "service",
      "product_id": "prd_svc1",
      "name": "שיעור פרטי",
      "quantity": 1,
      "unit_price_agorot": 25900,
      "total_agorot": 25900,
      "variant": {
        "משך": "60"
      }
    },
    {
      "type": "custom",
      "product_id": null,
      "name": "דמי רישום",
      "quantity": 1,
      "unit_price_agorot": 3000,
      "total_agorot": 3000,
      "variant": null
    }
  ],
  "amount_total_agorot": 28900,
  "charged_amount_agorot": 28900,
  "currency": "ILS",
  "max_installments": 1,
  "success_url": "https://shop.co.il/thanks",
  "cancel_url": "https://shop.co.il/cart",
  "payment_id": null,
  "order": null,
  "order_id": null
}

GET /v1/checkout_sessions

רשימת דפי תשלום

החדשים קודם. עימוד בסמן: starting_after = ה-id האחרון שקיבלתם.

יכולת checkout:readקצב read

פרמטר
limitstringרשות
1–100, ברירת מחדל 20
starting_afterstringרשות
עד 140 תווים
const res = await fetch('https://api.calio-app.com/v1/checkout_sessions', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "object": "checkout_session",
      "id": "cs_ps_x",
      "livemode": true,
      "status": "open",
      "url": "https://calio-app.com/p/ps_x",
      "created": "2025-10-18T11:40:00.000Z",
      "expires_at": "2025-10-18T12:10:00.000Z",
      "reference": "ORDER-1042",
      "metadata": {
        "cart_id": "c_88"
      },
      "customer": {
        "id": null,
        "name": "דנה כהן",
        "phone": "0501234567",
        "email": "d@x.co.il"
      },
      "lines": [
        {
          "type": "service",
          "product_id": "prd_svc1",
          "name": "שיעור פרטי",
          "quantity": 1,
          "unit_price_agorot": 25900,
          "total_agorot": 25900,
          "variant": {
            "משך": "60"
          }
        },
        {
          "type": "custom",
          "product_id": null,
          "name": "דמי רישום",
          "quantity": 1,
          "unit_price_agorot": 3000,
          "total_agorot": 3000,
          "variant": null
        }
      ],
      "amount_total_agorot": 28900,
      "charged_amount_agorot": 28900,
      "currency": "ILS",
      "max_installments": 1,
      "success_url": "https://shop.co.il/thanks",
      "cancel_url": "https://shop.co.il/cart",
      "payment_id": null,
      "order": null,
      "order_id": null
    },
    {
      "object": "checkout_session",
      "id": "cs_ps_x",
      "livemode": true,
      "status": "complete",
      "url": null,
      "created": "2025-10-18T11:40:00.000Z",
      "expires_at": "2025-10-18T12:10:00.000Z",
      "reference": "ORDER-1042",
      "metadata": {
        "cart_id": "c_88"
      },
      "customer": {
        "id": null,
        "name": "דנה כהן",
        "phone": "0501234567",
        "email": "d@x.co.il"
      },
      "lines": [
        {
          "type": "service",
          "product_id": "prd_svc1",
          "name": "שיעור פרטי",
          "quantity": 1,
          "unit_price_agorot": 25900,
          "total_agorot": 25900,
          "variant": {
            "משך": "60"
          }
        },
        {
          "type": "custom",
          "product_id": null,
          "name": "דמי רישום",
          "quantity": 1,
          "unit_price_agorot": 3000,
          "total_agorot": 3000,
          "variant": null
        }
      ],
      "amount_total_agorot": 28900,
      "charged_amount_agorot": 28900,
      "currency": "ILS",
      "max_installments": 1,
      "success_url": "https://shop.co.il/thanks",
      "cancel_url": "https://shop.co.il/cart",
      "payment_id": "pay_ps_x",
      "order": null,
      "order_id": null
    }
  ],
  "has_more": false,
  "next_cursor": "cs_ps_x"
}

GET /v1/checkout_sessions/{id}

דף תשלום

מצב עדכני של דף תשלום. 404 גם לדף של עסק אחר.

יכולת checkout:readקצב read

שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/checkout_sessions/cs_ps_x', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "checkout_session",
  "id": "cs_ps_x",
  "livemode": true,
  "status": "complete",
  "url": null,
  "created": "2025-10-18T11:40:00.000Z",
  "expires_at": "2025-10-18T12:10:00.000Z",
  "reference": "ORDER-1042",
  "metadata": {
    "cart_id": "c_88"
  },
  "customer": {
    "id": null,
    "name": "דנה כהן",
    "phone": "0501234567",
    "email": "d@x.co.il"
  },
  "lines": [
    {
      "type": "service",
      "product_id": "prd_svc1",
      "name": "שיעור פרטי",
      "quantity": 1,
      "unit_price_agorot": 25900,
      "total_agorot": 25900,
      "variant": {
        "משך": "60"
      }
    },
    {
      "type": "custom",
      "product_id": null,
      "name": "דמי רישום",
      "quantity": 1,
      "unit_price_agorot": 3000,
      "total_agorot": 3000,
      "variant": null
    }
  ],
  "amount_total_agorot": 28900,
  "charged_amount_agorot": 28900,
  "currency": "ILS",
  "max_installments": 1,
  "success_url": "https://shop.co.il/thanks",
  "cancel_url": "https://shop.co.il/cart",
  "payment_id": "pay_ps_x",
  "order": null,
  "order_id": null
}

POST /v1/checkout_sessions/{id}/expire

ביטול דף תשלום פתוח

דף שכבר שולם, פג או בוטל — 409. אם הקונה פתח את דף התשלום ב-3 הדקות האחרונות — 409 עם Retry-After.

יכולת checkout:writeקצב writeדורש Idempotency-Key

const res = await fetch('https://api.calio-app.com/v1/checkout_sessions/cs_ps_x/expire', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "checkout_session",
  "id": "cs_ps_x",
  "livemode": true,
  "status": "canceled",
  "url": null,
  "created": "2025-10-18T11:40:00.000Z",
  "expires_at": null,
  "reference": "ORDER-1042",
  "metadata": {
    "cart_id": "c_88"
  },
  "customer": {
    "id": null,
    "name": "דנה כהן",
    "phone": "0501234567",
    "email": "d@x.co.il"
  },
  "lines": [
    {
      "type": "service",
      "product_id": "prd_svc1",
      "name": "שיעור פרטי",
      "quantity": 1,
      "unit_price_agorot": 25900,
      "total_agorot": 25900,
      "variant": {
        "משך": "60"
      }
    },
    {
      "type": "custom",
      "product_id": null,
      "name": "דמי רישום",
      "quantity": 1,
      "unit_price_agorot": 3000,
      "total_agorot": 3000,
      "variant": null
    }
  ],
  "amount_total_agorot": 28900,
  "charged_amount_agorot": 28900,
  "currency": "ILS",
  "max_installments": 1,
  "success_url": "https://shop.co.il/thanks",
  "cancel_url": "https://shop.co.il/cart",
  "payment_id": null,
  "order": null,
  "order_id": null
}

תשלומים

GET /v1/payments

רשימת תשלומים

תשלומים שהתקבלו דרך ה-API, החדשים קודם.

יכולת payments:readקצב read

פרמטר
limitstringרשות
1–100, ברירת מחדל 20
starting_afterstringרשות
עד 140 תווים
const res = await fetch('https://api.calio-app.com/v1/payments', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "object": "payment",
      "id": "pay_ps_x",
      "livemode": true,
      "status": "succeeded",
      "document_status": "failed",
      "requires_attention": true,
      "issues": [
        {
          "code": "stock_shortfall",
          "severity": "warning",
          "message": "המלאי ירד מתחת לאפס אחרי התשלום (שני קונים על אותה יחידה).",
          "created": "2025-10-18T11:41:02.000Z",
          "resolved": null
        },
        {
          "code": "document_generation_failed",
          "severity": "action_required",
          "message": "התשלום התקבל אבל הקבלה לא הופקה. יש להפיק אותה מהאפליקציה.",
          "created": null,
          "resolved": null
        }
      ],
      "checkout_session_id": "cs_ps_x",
      "reference": "ORDER-1042",
      "metadata": {
        "cart_id": "c_88"
      },
      "amount_total_agorot": 28900,
      "charged_amount_agorot": 28900,
      "refunded_amount_agorot": 0,
      "currency": "ILS",
      "paid_at": "2025-10-18T11:41:01.000Z",
      "payment_method": {
        "type": "card",
        "brand": "visa",
        "last4": "4242",
        "installments": 1
      },
      "customer": {
        "id": "cus_c7"
      },
      "lines": [
        {
          "type": "service",
          "product_id": "prd_svc1",
          "name": "שיעור פרטי",
          "quantity": 1,
          "unit_price_agorot": 25900,
          "total_agorot": 25900
        },
        {
          "type": "custom",
          "product_id": null,
          "name": "דמי רישום",
          "quantity": 1,
          "unit_price_agorot": 3000,
          "total_agorot": 3000
        }
      ],
      "documents": [],
      "order_id": null
    }
  ],
  "has_more": true,
  "next_cursor": "pay_ps_x"
}

GET /v1/payments/{id}

תשלום

שלושה צירים נפרדים: status (הכסף), document_status (המסמך), requires_attention + issues (מה העסק צריך לטפל).

יכולת payments:readקצב read

שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/payments/pay_ps_x', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "payment",
  "id": "pay_ps_x",
  "livemode": true,
  "status": "succeeded",
  "document_status": "failed",
  "requires_attention": true,
  "issues": [
    {
      "code": "stock_shortfall",
      "severity": "warning",
      "message": "המלאי ירד מתחת לאפס אחרי התשלום (שני קונים על אותה יחידה).",
      "created": "2025-10-18T11:41:02.000Z",
      "resolved": null
    },
    {
      "code": "document_generation_failed",
      "severity": "action_required",
      "message": "התשלום התקבל אבל הקבלה לא הופקה. יש להפיק אותה מהאפליקציה.",
      "created": null,
      "resolved": null
    }
  ],
  "checkout_session_id": "cs_ps_x",
  "reference": "ORDER-1042",
  "metadata": {
    "cart_id": "c_88"
  },
  "amount_total_agorot": 28900,
  "charged_amount_agorot": 28900,
  "refunded_amount_agorot": 0,
  "currency": "ILS",
  "paid_at": "2025-10-18T11:41:01.000Z",
  "payment_method": {
    "type": "card",
    "brand": "visa",
    "last4": "4242",
    "installments": 1
  },
  "customer": {
    "id": "cus_c7"
  },
  "lines": [
    {
      "type": "service",
      "product_id": "prd_svc1",
      "name": "שיעור פרטי",
      "quantity": 1,
      "unit_price_agorot": 25900,
      "total_agorot": 25900
    },
    {
      "type": "custom",
      "product_id": null,
      "name": "דמי רישום",
      "quantity": 1,
      "unit_price_agorot": 3000,
      "total_agorot": 3000
    }
  ],
  "documents": [],
  "order_id": null
}

POST /v1/payments/{id}/test/refund

בדיקה: זיכוי מדומה

מצב בדיקה בלבד. זיכוי אמיתי נעשה רק באפליקציה של קאליו, על ידי אדם — ולתשלום בדיקה אין שם מכירה לזכות. הקריאה מגדילה את הסכום שזוכה בתשלום הבדיקה, ואחריה נשלח האירוע הרגיל: payment.partially_refunded או payment.refunded. לא זז כסף, לא נוצרת מכירה ולא מופק מסמך זיכוי. בלי amount_agorot — כל מה שעוד לא זוכה.

יכולת checkout:writeקצב writeדורש Idempotency-Key

שדה בגוף
amount_agorotintegerרשות
מינ' 1 · מקס' 100000000
שגיאות אפשריותresource_not_foundinvalid_parameter
const res = await fetch('https://api.calio-app.com/v1/payments/pay_ps_x/test/refund', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "payment",
  "id": "pay_ps_x",
  "livemode": false,
  "status": "partially_refunded",
  "document_status": "issued",
  "requires_attention": true,
  "issues": [
    {
      "code": "stock_shortfall",
      "severity": "warning",
      "message": "המלאי ירד מתחת לאפס אחרי התשלום (שני קונים על אותה יחידה).",
      "created": "2025-10-18T11:41:02.000Z",
      "resolved": null
    }
  ],
  "checkout_session_id": "cs_ps_x",
  "reference": "ORDER-1042",
  "metadata": {
    "cart_id": "c_88"
  },
  "amount_total_agorot": 28900,
  "charged_amount_agorot": 28900,
  "refunded_amount_agorot": 1000,
  "currency": "ILS",
  "paid_at": "2025-10-18T11:41:01.000Z",
  "payment_method": {
    "type": "card",
    "brand": "visa",
    "last4": "4242",
    "installments": 1
  },
  "customer": {
    "id": "cus_c7"
  },
  "lines": [
    {
      "type": "service",
      "product_id": "prd_svc1",
      "name": "שיעור פרטי",
      "quantity": 1,
      "unit_price_agorot": 25900,
      "total_agorot": 25900
    },
    {
      "type": "custom",
      "product_id": null,
      "name": "דמי רישום",
      "quantity": 1,
      "unit_price_agorot": 3000,
      "total_agorot": 3000
    }
  ],
  "documents": [
    {
      "id": "doc_test_ps_x",
      "type": "test_receipt",
      "number": "TEST-123456",
      "status": "issued",
      "pdf_url": null,
      "allocation_number": null
    }
  ],
  "order_id": null
}

קטלוג

GET /v1/products

מוצרים ושירותים

כל מה שהעסק לא הסתיר מה-API. מחירים באגורות — אותו מחיר שדף התשלום יגבה. סינון: type, category. עימוד בסמן.

יכולת catalog:readקצב read

פרמטר
limitstringרשות
1–100, ברירת מחדל 20
starting_afterstringרשות
עד 140 תווים
typestringרשות
אחד מ: product, service
categorystringרשות
עד 128 תווים
const res = await fetch('https://api.calio-app.com/v1/products', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "object": "product",
      "id": "prd_shirt1",
      "type": "product",
      "name": "חולצה",
      "description": "כותנה",
      "price_agorot": 8000,
      "sale_price_agorot": 7200,
      "currency": "ILS",
      "duration_minutes": null,
      "images": [
        "https://x/a.jpg"
      ],
      "categories": [
        {
          "id": "c1",
          "name": "בגדים"
        }
      ],
      "variant_groups": [
        {
          "name": "מידה",
          "selection": "single",
          "min_select": null,
          "max_select": null,
          "options": [
            {
              "name": "M",
              "price_adjustment_agorot": 0,
              "sold_out": false
            },
            {
              "name": "XL",
              "price_adjustment_agorot": 1000,
              "sold_out": true
            }
          ]
        }
      ],
      "quantity": {
        "unit": "quantity",
        "step": 1,
        "min": 1,
        "max": 999,
        "default": 1
      },
      "stock": {
        "tracked": true,
        "available": 9,
        "status": "in_stock",
        "by_variant": {
          "מידה=M": 1
        }
      },
      "purchasable": true
    },
    {
      "object": "product",
      "id": "prd_svc1",
      "type": "service",
      "name": "שיעור",
      "description": null,
      "price_agorot": 25900,
      "sale_price_agorot": null,
      "currency": "ILS",
      "duration_minutes": 60,
      "images": [],
      "categories": [],
      "variant_groups": [],
      "quantity": {
        "unit": "quantity",
        "step": 1,
        "min": 1,
        "max": 999,
        "default": 1
      },
      "stock": {
        "tracked": false,
        "available": null,
        "status": null,
        "by_variant": null
      },
      "purchasable": true
    }
  ],
  "has_more": false,
  "next_cursor": "prd_svc1"
}

GET /v1/products/{id}

מוצר או שירות

כולל וריאנטים, כללי כמות ומלאי זמין.

יכולת catalog:readקצב read

שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/products/prd_shirt1', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "product",
  "id": "prd_shirt1",
  "type": "product",
  "name": "חולצה",
  "description": "כותנה",
  "price_agorot": 8000,
  "sale_price_agorot": 7200,
  "currency": "ILS",
  "duration_minutes": null,
  "images": [
    "https://x/a.jpg"
  ],
  "categories": [
    {
      "id": "c1",
      "name": "בגדים"
    }
  ],
  "variant_groups": [
    {
      "name": "מידה",
      "selection": "single",
      "min_select": null,
      "max_select": null,
      "options": [
        {
          "name": "M",
          "price_adjustment_agorot": 0,
          "sold_out": false
        },
        {
          "name": "XL",
          "price_adjustment_agorot": 1000,
          "sold_out": true
        }
      ]
    }
  ],
  "quantity": {
    "unit": "quantity",
    "step": 1,
    "min": 1,
    "max": 999,
    "default": 1
  },
  "stock": {
    "tracked": true,
    "available": 9,
    "status": "in_stock",
    "by_variant": {
      "מידה=M": 1
    }
  },
  "purchasable": true
}

GET /v1/categories

קטגוריות

הקטגוריות של קטלוג העסק.

יכולת catalog:readקצב read

const res = await fetch('https://api.calio-app.com/v1/categories', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "object": "category",
      "id": "c1",
      "name": "בגדים"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

לקוחות

POST /v1/customers

יצירת לקוח

יוצר כרטיס לקוח של העסק. טלפון/מייל שכבר קיימים ⇒ 409 customer_exists עם מזהה הלקוח הקיים (אין כפילות שקטה ואין דריסה). במצב בדיקה — לקוח ארגז-חול שלא מופיע באפליקציה.

יכולת customers:writeקצב writeדורש Idempotency-Key

שדה בגוף
namestringחובה
עד 120 תווים
phonestringרשות
נייד ישראלי — 05XXXXXXXX או +9725XXXXXXXX
emailstringרשות
עד 254 תווים · תבנית ^[^@\s]+@[^@\s]+\.[^@\s]+$
tax_idstringרשות
ח.פ. / ע.מ. — רק עם company_name
company_namestringרשות
עד 120 תווים
addressobject (או null)רשות
marketing_consentbooleanרשות
true רק אם הלקוח אישר דיוור באתר
שגיאות אפשריותcustomer_exists
const res = await fetch('https://api.calio-app.com/v1/customers', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    "name": "דנה כהן",
    "phone": "0501234567",
    "email": "dana@example.co.il",
    "marketing_consent": true
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 201 · כרטיס לקוח של העסק — אותו כרטיס באפליקציה ובאתר. מוחזרים רק השדות המתועדים כאן.
JSON
{
  "object": "customer",
  "id": "cus_c7",
  "name": "דנה כהן",
  "phone": "+972501234567",
  "email": "d@x.co.il",
  "company_name": null,
  "tax_id": null,
  "address": {
    "street": "הרצל 1",
    "city": "תל אביב",
    "zip": null
  },
  "marketing_consent": true,
  "created_at": "2025-10-18T11:40:00.000Z",
  "livemode": true
}

GET /v1/customers

חיפוש / רשימת לקוחות

?phone= או ?email= — התאמה מדויקת (customers:read). בלי פרמטר חיפוש — כל הרשימה בעימוד (דורש גם customers:list). כל רשומה שנקראת נספרת: עד 1,000 בשעה; קריאת יותר ממחצית הלקוחות ביממה עוצרת את הרשימה עד אישור בעל העסק.

יכולת customers:readקצב read

פרמטר
limitstringרשות
1–100, ברירת מחדל 20
starting_afterstringרשות
עד 140 תווים
phonestringרשות
עד 20 תווים
emailstringרשות
עד 254 תווים
const res = await fetch('https://api.calio-app.com/v1/customers', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "object": "customer",
      "id": "cus_c7",
      "name": "דנה כהן",
      "phone": "+972501234567",
      "email": "d@x.co.il",
      "company_name": null,
      "tax_id": null,
      "address": {
        "street": "הרצל 1",
        "city": "תל אביב",
        "zip": null
      },
      "marketing_consent": true,
      "created_at": "2025-10-18T11:40:00.000Z",
      "livemode": true
    },
    {
      "object": "customer",
      "id": "cus_c8",
      "name": "סטודיו",
      "phone": null,
      "email": null,
      "company_name": "סטודיו בע\"מ",
      "tax_id": "515555555",
      "address": null,
      "marketing_consent": false,
      "created_at": "1970-01-01T00:00:00.001Z",
      "livemode": true
    }
  ],
  "has_more": false,
  "next_cursor": "cus_c8"
}

GET /v1/customers/{id}

לקוח

כרטיס הלקוח.

יכולת customers:readקצב read

שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/customers/cus_c7', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · כרטיס לקוח של העסק — אותו כרטיס באפליקציה ובאתר. מוחזרים רק השדות המתועדים כאן.
JSON
{
  "object": "customer",
  "id": "cus_c7",
  "name": "דנה כהן",
  "phone": "+972501234567",
  "email": "d@x.co.il",
  "company_name": null,
  "tax_id": null,
  "address": {
    "street": "הרצל 1",
    "city": "תל אביב",
    "zip": null
  },
  "marketing_consent": true,
  "created_at": "2025-10-18T11:40:00.000Z",
  "livemode": true
}

PATCH /v1/customers/{id}

עדכון לקוח

שולחים רק את מה שמשתנה; null מוחק שדה. טלפון/מייל של לקוח אחר ⇒ 409 customer_exists. מחיקת לקוח — רק באפליקציה.

יכולת customers:writeקצב writeדורש Idempotency-Key

שדה בגוף
namestringרשות
עד 120 תווים
phonestring (או null)רשות
תבנית ^\+?[0-9][0-9\- ]{7,18}$
emailstring (או null)רשות
עד 254 תווים · תבנית ^[^@\s]+@[^@\s]+\.[^@\s]+$
tax_idstring (או null)רשות
תבנית ^[0-9]{5,9}$
company_namestring (או null)רשות
עד 120 תווים
addressobject (או null)רשות
marketing_consentbooleanרשות
true רק אם הלקוח אישר דיוור באתר
שגיאות אפשריותresource_not_foundcustomer_exists
const res = await fetch('https://api.calio-app.com/v1/customers/cus_c7', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    "email": "dana.c@example.co.il"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · כרטיס לקוח של העסק — אותו כרטיס באפליקציה ובאתר. מוחזרים רק השדות המתועדים כאן.
JSON
{
  "object": "customer",
  "id": "cus_c7",
  "name": "דנה כהן",
  "phone": "+972501234567",
  "email": "d@x.co.il",
  "company_name": null,
  "tax_id": null,
  "address": {
    "street": "הרצל 1",
    "city": "תל אביב",
    "zip": null
  },
  "marketing_consent": true,
  "created_at": "2025-10-18T11:40:00.000Z",
  "livemode": true
}

GET /v1/customers/{id}/payments

תשלומי לקוח

תשלומי ה-API של הלקוח, מהחדש לישן.

יכולת payments:readקצב read

פרמטר
limitstringרשות
1–100, ברירת מחדל 20
starting_afterstringרשות
עד 140 תווים
שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/customers/cus_c7/payments', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "object": "payment",
      "id": "pay_ps_x",
      "livemode": true,
      "status": "succeeded",
      "document_status": "failed",
      "requires_attention": true,
      "issues": [
        {
          "code": "stock_shortfall",
          "severity": "warning",
          "message": "המלאי ירד מתחת לאפס אחרי התשלום (שני קונים על אותה יחידה).",
          "created": "2025-10-18T11:41:02.000Z",
          "resolved": null
        },
        {
          "code": "document_generation_failed",
          "severity": "action_required",
          "message": "התשלום התקבל אבל הקבלה לא הופקה. יש להפיק אותה מהאפליקציה.",
          "created": null,
          "resolved": null
        }
      ],
      "checkout_session_id": "cs_ps_x",
      "reference": "ORDER-1042",
      "metadata": {
        "cart_id": "c_88"
      },
      "amount_total_agorot": 28900,
      "charged_amount_agorot": 28900,
      "refunded_amount_agorot": 0,
      "currency": "ILS",
      "paid_at": "2025-10-18T11:41:01.000Z",
      "payment_method": {
        "type": "card",
        "brand": "visa",
        "last4": "4242",
        "installments": 1
      },
      "customer": {
        "id": "cus_c7"
      },
      "lines": [
        {
          "type": "service",
          "product_id": "prd_svc1",
          "name": "שיעור פרטי",
          "quantity": 1,
          "unit_price_agorot": 25900,
          "total_agorot": 25900
        },
        {
          "type": "custom",
          "product_id": null,
          "name": "דמי רישום",
          "quantity": 1,
          "unit_price_agorot": 3000,
          "total_agorot": 3000
        }
      ],
      "documents": [],
      "order_id": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}

הזמנות

POST /v1/orders

הזמנה בלי תשלום

מזומן לשליח / תשלום באיסוף / העברה. רק אם בעל העסק אישר, עם מפתח שיש לו orders:create_unpaid, ועד 50 ביום. ההזמנה נכנסת כ-pending (ממתינה לתשלום); המלאי והקבלה — כשבעל העסק מסמן שולם (order.paid).

יכולת orders:create_unpaidקצב writeדורש Idempotency-Key

שדה בגוף
linesarray<object>חובה
עד 100 פריטים
lines[].product_idstringרשות
מוצר או שירות מהקטלוג — המחיר נלקח מהקטלוג
lines[].quantitynumberחובה
מינ' 0.001 · מקס' 100000
lines[].variantobjectרשות
שם קבוצה → אפשרות (או מערך לקבוצה מרובת-בחירה)
lines[].namestringרשות
שורה חופשית בלבד — עד 120 תווים
lines[].unit_price_agorotintegerרשות
שורה חופשית בלבד — מינ' 1 · מקס' 100000000
expected_total_agorotintegerרשות
מינ' 1
customerobjectרשות
customer.namestringחובה
עד 120 תווים
customer.phonestringרשות
תבנית ^\+?[0-9][0-9\- ]{7,18}$
customer.emailstringרשות
עד 254 תווים · תבנית ^[^@\s]+@[^@\s]+\.[^@\s]+$
customer.tax_idstringרשות
תבנית ^[0-9]{5,9}$
customer.company_namestringרשות
עד 120 תווים
customer_idstringרשות
תבנית ^cus_[A-Za-z0-9_-]{1,128}$
orderobjectחובה
order.fulfillmentstringחובה
משלוח / איסוף עצמי / ללא (שירות, מוצר דיגיטלי) — אחד מ: shipping, pickup, none
order.shipping_addressobjectרשות
חובה כש-fulfillment הוא shipping
order.shipping_method_namestringרשות
השם שהקונה בחר באתר, למשל "שליח עד הבית" — עד 60 תווים
order.shipping_fee_agorotintegerרשות
רק אם בעל העסק אישר לאתר לקבוע דמי משלוח — מינ' 0 · מקס' 10000000
order.discountobjectרשות
הנחה על ההזמנה — רק אם בעל העסק אישר לאתר לתת הנחות
order.requested_datestringרשות
YYYY-MM-DD — היום או מאוחר יותר, עד שנה קדימה
order.time_slotobjectרשות
HH:MM — רק יחד עם requested_date
order.notestringרשות
הערת הקונה — עד 500 תווים
order.extra_fieldsarray<object>רשות
שדות נוספים מהאתר (הקדשה, מספר טלפון לשליח…) — מוצגים בהזמנה — עד 10 פריטים
paymentobjectחובה
payment.methodstringחובה
אחד מ: cash_on_delivery, pay_at_pickup, bank_transfer, other
payment.notestringרשות
עד 200 תווים
referencestringרשות
עד 64 תווים
metadataobjectרשות
const res = await fetch('https://api.calio-app.com/v1/orders', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 201 · הזמנה בערוץ האתר — מופיעה במסך ההזמנות של קאליו וזזה במחזור הטיפול הרגיל
JSON
{
  "object": "order",
  "id": "ord_api_u1",
  "livemode": true,
  "order_number": "K7M2QX",
  "status": "pending",
  "payment_status": "pending",
  "payment_id": null,
  "payment_method": "cash_on_delivery",
  "payment_note": null,
  "reference": "WC-10293",
  "customer": {
    "id": "cus_c7",
    "name": "דנה כהן",
    "phone": "+972501234567",
    "email": "dana@example.com"
  },
  "lines": [
    {
      "type": "product",
      "product_id": "prd_shirt1",
      "name": "שמלה",
      "quantity": 1,
      "unit_price_agorot": 25000,
      "total_agorot": 25000,
      "variant": {
        "מידה": "M"
      }
    }
  ],
  "fulfillment": "shipping",
  "shipping_address": {
    "city": "תל אביב",
    "street": "דיזנגוף",
    "house_number": "100",
    "apartment": "4",
    "floor": null,
    "zip": "6433222"
  },
  "shipping_method_name": "שליח עד הבית",
  "amounts": {
    "subtotal_agorot": 25000,
    "shipping_fee_agorot": 3000,
    "discount_agorot": 1000,
    "total_agorot": 27000
  },
  "discount_label": "WELCOME10",
  "requested_date": "2026-10-22",
  "time_slot": {
    "start": "16:00",
    "end": "20:00"
  },
  "note": "להשאיר אצל השכן",
  "extra_fields": [
    {
      "label": "הקדשה",
      "value": "מזל טוב"
    }
  ],
  "status_history": [
    {
      "status": "pending",
      "at": "2026-10-18T10:00:00.000Z"
    }
  ],
  "documents": [],
  "created": "2026-10-18T10:00:00.000Z"
}

GET /v1/orders

רשימת הזמנות

הזמנות ערוץ האתר בלבד. ?status= ו-?payment_status= לסינון.

יכולת orders:readקצב read

פרמטר
limitstringרשות
1–100, ברירת מחדל 20
starting_afterstringרשות
עד 140 תווים
statusstringרשות
אחד מ: pending, approved, shipped, delivered, canceled
payment_statusstringרשות
אחד מ: paid, pending, refunded
const res = await fetch('https://api.calio-app.com/v1/orders', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "object": "order",
      "id": "ord_api_ps_x",
      "livemode": true,
      "order_number": "K7M2QX",
      "status": "approved",
      "payment_status": "paid",
      "payment_id": "pay_ps_x",
      "payment_method": "online_checkout",
      "payment_note": null,
      "reference": "WC-10293",
      "customer": {
        "id": "cus_c7",
        "name": "דנה כהן",
        "phone": "+972501234567",
        "email": "dana@example.com"
      },
      "lines": [
        {
          "type": "product",
          "product_id": "prd_shirt1",
          "name": "שמלה",
          "quantity": 1,
          "unit_price_agorot": 25000,
          "total_agorot": 25000,
          "variant": {
            "מידה": "M"
          }
        }
      ],
      "fulfillment": "shipping",
      "shipping_address": {
        "city": "תל אביב",
        "street": "דיזנגוף",
        "house_number": "100",
        "apartment": "4",
        "floor": null,
        "zip": "6433222"
      },
      "shipping_method_name": "שליח עד הבית",
      "amounts": {
        "subtotal_agorot": 25000,
        "shipping_fee_agorot": 3000,
        "discount_agorot": 1000,
        "total_agorot": 27000
      },
      "discount_label": "WELCOME10",
      "requested_date": "2026-10-22",
      "time_slot": {
        "start": "16:00",
        "end": "20:00"
      },
      "note": "להשאיר אצל השכן",
      "extra_fields": [
        {
          "label": "הקדשה",
          "value": "מזל טוב"
        }
      ],
      "status_history": [
        {
          "status": "approved",
          "at": "2026-10-18T10:00:00.000Z"
        }
      ],
      "documents": [],
      "created": "2026-10-18T10:00:00.000Z"
    },
    {
      "object": "order",
      "id": "ord_api_u1",
      "livemode": true,
      "order_number": "K7M2QX",
      "status": "pending",
      "payment_status": "pending",
      "payment_id": null,
      "payment_method": "cash_on_delivery",
      "payment_note": null,
      "reference": "WC-10293",
      "customer": {
        "id": "cus_c7",
        "name": "דנה כהן",
        "phone": "+972501234567",
        "email": "dana@example.com"
      },
      "lines": [
        {
          "type": "product",
          "product_id": "prd_shirt1",
          "name": "שמלה",
          "quantity": 1,
          "unit_price_agorot": 25000,
          "total_agorot": 25000,
          "variant": {
            "מידה": "M"
          }
        }
      ],
      "fulfillment": "shipping",
      "shipping_address": {
        "city": "תל אביב",
        "street": "דיזנגוף",
        "house_number": "100",
        "apartment": "4",
        "floor": null,
        "zip": "6433222"
      },
      "shipping_method_name": "שליח עד הבית",
      "amounts": {
        "subtotal_agorot": 25000,
        "shipping_fee_agorot": 3000,
        "discount_agorot": 1000,
        "total_agorot": 27000
      },
      "discount_label": "WELCOME10",
      "requested_date": "2026-10-22",
      "time_slot": {
        "start": "16:00",
        "end": "20:00"
      },
      "note": "להשאיר אצל השכן",
      "extra_fields": [
        {
          "label": "הקדשה",
          "value": "מזל טוב"
        }
      ],
      "status_history": [
        {
          "status": "pending",
          "at": "2026-10-18T10:00:00.000Z"
        }
      ],
      "documents": [],
      "created": "2026-10-18T10:00:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": "ord_api_u1"
}

GET /v1/orders/{id}

הזמנה

הזמנה של ערוץ האתר.

יכולת orders:readקצב read

שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/orders/x', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · הזמנה בערוץ האתר — מופיעה במסך ההזמנות של קאליו וזזה במחזור הטיפול הרגיל
JSON
{
  "object": "order",
  "id": "ord_api_ps_x",
  "livemode": true,
  "order_number": "K7M2QX",
  "status": "approved",
  "payment_status": "paid",
  "payment_id": "pay_ps_x",
  "payment_method": "online_checkout",
  "payment_note": null,
  "reference": "WC-10293",
  "customer": {
    "id": "cus_c7",
    "name": "דנה כהן",
    "phone": "+972501234567",
    "email": "dana@example.com"
  },
  "lines": [
    {
      "type": "product",
      "product_id": "prd_shirt1",
      "name": "שמלה",
      "quantity": 1,
      "unit_price_agorot": 25000,
      "total_agorot": 25000,
      "variant": {
        "מידה": "M"
      }
    }
  ],
  "fulfillment": "shipping",
  "shipping_address": {
    "city": "תל אביב",
    "street": "דיזנגוף",
    "house_number": "100",
    "apartment": "4",
    "floor": null,
    "zip": "6433222"
  },
  "shipping_method_name": "שליח עד הבית",
  "amounts": {
    "subtotal_agorot": 25000,
    "shipping_fee_agorot": 3000,
    "discount_agorot": 1000,
    "total_agorot": 27000
  },
  "discount_label": "WELCOME10",
  "requested_date": "2026-10-22",
  "time_slot": {
    "start": "16:00",
    "end": "20:00"
  },
  "note": "להשאיר אצל השכן",
  "extra_fields": [
    {
      "label": "הקדשה",
      "value": "מזל טוב"
    }
  ],
  "status_history": [
    {
      "status": "approved",
      "at": "2026-10-18T10:00:00.000Z"
    }
  ],
  "documents": [],
  "created": "2026-10-18T10:00:00.000Z"
}

POST /v1/orders/{id}/status

עדכון: נשלחה / נמסרה

האתר מסמן shipped או delivered (למשל מחברת השליחויות). ביטול — רק באפליקציה (הוא מזכה את הלקוח).

יכולת orders:writeקצב writeדורש Idempotency-Key

שדה בגוף
statusstringחובה
אחד מ: shipped, delivered
שגיאות אפשריותorder_invalid_stateresource_not_found
const res = await fetch('https://api.calio-app.com/v1/orders/x/status', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · הזמנה בערוץ האתר — מופיעה במסך ההזמנות של קאליו וזזה במחזור הטיפול הרגיל
JSON
{
  "object": "order",
  "id": "ord_api_ps_x",
  "livemode": true,
  "order_number": "K7M2QX",
  "status": "shipped",
  "payment_status": "paid",
  "payment_id": "pay_ps_x",
  "payment_method": "online_checkout",
  "payment_note": null,
  "reference": "WC-10293",
  "customer": {
    "id": "cus_c7",
    "name": "דנה כהן",
    "phone": "+972501234567",
    "email": "dana@example.com"
  },
  "lines": [
    {
      "type": "product",
      "product_id": "prd_shirt1",
      "name": "שמלה",
      "quantity": 1,
      "unit_price_agorot": 25000,
      "total_agorot": 25000,
      "variant": {
        "מידה": "M"
      }
    }
  ],
  "fulfillment": "shipping",
  "shipping_address": {
    "city": "תל אביב",
    "street": "דיזנגוף",
    "house_number": "100",
    "apartment": "4",
    "floor": null,
    "zip": "6433222"
  },
  "shipping_method_name": "שליח עד הבית",
  "amounts": {
    "subtotal_agorot": 25000,
    "shipping_fee_agorot": 3000,
    "discount_agorot": 1000,
    "total_agorot": 27000
  },
  "discount_label": "WELCOME10",
  "requested_date": "2026-10-22",
  "time_slot": {
    "start": "16:00",
    "end": "20:00"
  },
  "note": "להשאיר אצל השכן",
  "extra_fields": [
    {
      "label": "הקדשה",
      "value": "מזל טוב"
    }
  ],
  "status_history": [
    {
      "status": "approved",
      "at": "2026-10-18T10:00:00.000Z"
    },
    {
      "status": "shipped",
      "at": "2026-10-18T11:00:00.000Z"
    }
  ],
  "documents": [],
  "created": "2026-10-18T10:00:00.000Z"
}

POST /v1/orders/{id}/test/advance

בדיקה: שינוי סטטוס

מצב בדיקה בלבד — מדמה את בעל העסק: shipped / delivered / canceled (הזמנה ממתינה מאושרת קודם).

יכולת orders:writeקצב writeדורש Idempotency-Key

שדה בגוף
statusstringחובה
אחד מ: shipped, delivered, canceled
שגיאות אפשריותorder_invalid_stateresource_not_found
const res = await fetch('https://api.calio-app.com/v1/orders/x/test/advance', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · הזמנה בערוץ האתר — מופיעה במסך ההזמנות של קאליו וזזה במחזור הטיפול הרגיל
JSON
{
  "object": "order",
  "id": "ord_api_ps_x",
  "livemode": true,
  "order_number": "K7M2QX",
  "status": "shipped",
  "payment_status": "paid",
  "payment_id": "pay_ps_x",
  "payment_method": "online_checkout",
  "payment_note": null,
  "reference": "WC-10293",
  "customer": {
    "id": "cus_c7",
    "name": "דנה כהן",
    "phone": "+972501234567",
    "email": "dana@example.com"
  },
  "lines": [
    {
      "type": "product",
      "product_id": "prd_shirt1",
      "name": "שמלה",
      "quantity": 1,
      "unit_price_agorot": 25000,
      "total_agorot": 25000,
      "variant": {
        "מידה": "M"
      }
    }
  ],
  "fulfillment": "shipping",
  "shipping_address": {
    "city": "תל אביב",
    "street": "דיזנגוף",
    "house_number": "100",
    "apartment": "4",
    "floor": null,
    "zip": "6433222"
  },
  "shipping_method_name": "שליח עד הבית",
  "amounts": {
    "subtotal_agorot": 25000,
    "shipping_fee_agorot": 3000,
    "discount_agorot": 1000,
    "total_agorot": 27000
  },
  "discount_label": "WELCOME10",
  "requested_date": "2026-10-22",
  "time_slot": {
    "start": "16:00",
    "end": "20:00"
  },
  "note": "להשאיר אצל השכן",
  "extra_fields": [
    {
      "label": "הקדשה",
      "value": "מזל טוב"
    }
  ],
  "status_history": [
    {
      "status": "approved",
      "at": "2026-10-18T10:00:00.000Z"
    },
    {
      "status": "shipped",
      "at": "2026-10-18T11:00:00.000Z"
    }
  ],
  "documents": [],
  "created": "2026-10-18T10:00:00.000Z"
}

POST /v1/orders/{id}/test/mark_paid

בדיקה: סומנה כשולמה

מצב בדיקה בלבד — הזמנה בלי תשלום מסומנת שולמה (order.paid).

יכולת orders:writeקצב writeדורש Idempotency-Key

שגיאות אפשריותorder_invalid_stateresource_not_found
const res = await fetch('https://api.calio-app.com/v1/orders/x/test/mark_paid', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · הזמנה בערוץ האתר — מופיעה במסך ההזמנות של קאליו וזזה במחזור הטיפול הרגיל
JSON
{
  "object": "order",
  "id": "ord_api_u1",
  "livemode": true,
  "order_number": "K7M2QX",
  "status": "pending",
  "payment_status": "paid",
  "payment_id": null,
  "payment_method": "cash_on_delivery",
  "payment_note": null,
  "reference": "WC-10293",
  "customer": {
    "id": "cus_c7",
    "name": "דנה כהן",
    "phone": "+972501234567",
    "email": "dana@example.com"
  },
  "lines": [
    {
      "type": "product",
      "product_id": "prd_shirt1",
      "name": "שמלה",
      "quantity": 1,
      "unit_price_agorot": 25000,
      "total_agorot": 25000,
      "variant": {
        "מידה": "M"
      }
    }
  ],
  "fulfillment": "shipping",
  "shipping_address": {
    "city": "תל אביב",
    "street": "דיזנגוף",
    "house_number": "100",
    "apartment": "4",
    "floor": null,
    "zip": "6433222"
  },
  "shipping_method_name": "שליח עד הבית",
  "amounts": {
    "subtotal_agorot": 25000,
    "shipping_fee_agorot": 3000,
    "discount_agorot": 1000,
    "total_agorot": 27000
  },
  "discount_label": "WELCOME10",
  "requested_date": "2026-10-22",
  "time_slot": {
    "start": "16:00",
    "end": "20:00"
  },
  "note": "להשאיר אצל השכן",
  "extra_fields": [
    {
      "label": "הקדשה",
      "value": "מזל טוב"
    }
  ],
  "status_history": [
    {
      "status": "pending",
      "at": "2026-10-18T10:00:00.000Z"
    }
  ],
  "documents": [],
  "created": "2026-10-18T10:00:00.000Z"
}

מנויים

POST /v1/subscriptions

יצירת מנוי

יוצר מנוי ומחזיר setup_url — דף קאליו שבו הלקוח מזין כרטיס (לא נגבה כסף בדף). החיוב הראשון ביום ההזנה (או ב-start_date), ואז כל interval; כל חיוב = עסקה עם קבלה. האתר לעולם לא מחייב כרטיס בעצמו. עסק שהסליקה שלו עדיין לא תומכת במנויים מהאתר מקבל provider_not_supported_yet.

יכולת subscriptions:writeקצב writeדורש Idempotency-Key

שדה בגוף
customer_idstringרשות
תבנית ^cus_[A-Za-z0-9_-]{1,128}$
customerobjectרשות
customer.namestringחובה
עד 120 תווים
customer.phonestringרשות
נייד ישראלי — 05XXXXXXXX או +9725XXXXXXXX
customer.emailstringרשות
עד 254 תווים · תבנית ^[^@\s]+@[^@\s]+\.[^@\s]+$
customer.tax_idstringרשות
ח.פ. / ע.מ. — רק עם company_name
customer.company_namestringרשות
עד 120 תווים
customer.addressobject (או null)רשות
customer.marketing_consentbooleanרשות
true רק אם הלקוח אישר דיוור באתר
namestringחובה
מה הלקוח רואה בדף ובקבלה — עד 120 תווים
amount_agorotintegerחובה
מינ' 1 · מקס' 100000000
intervalstringחובה
אין מנוי יומי ב-API — אחד מ: week, month, year
start_datestringרשות
YYYY-MM-DD, עד שנה קדימה; חודשי/שנתי — יום 1–28. בלי ⇒ ביום שבו הלקוח מזין כרטיס
max_chargesintegerרשות
מינ' 1 · מקס' 1000
referencestringרשות
עד 64 תווים
metadataobjectרשות
success_urlstringרשות
https בלבד, בדומיין שאושר באפליקציה
cancel_urlstringרשות
https בלבד, בדומיין שאושר באפליקציה
const res = await fetch('https://api.calio-app.com/v1/subscriptions', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    "customer_id": "cus_c7",
    "name": "מנוי חודשי",
    "amount_agorot": 9900,
    "interval": "month",
    "reference": "MEMBER-7",
    "success_url": "https://shop.co.il/welcome"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 201 · מנוי שנוצר דרך ה-API. פרטי הכרטיס לא נחשפים — רק has_payment_method.
JSON
{
  "object": "subscription",
  "id": "sub_x",
  "status": "pending_payment_method",
  "past_due_reason": null,
  "name": "מנוי חודשי",
  "amount_agorot": 9900,
  "currency": "ILS",
  "interval": "month",
  "customer": {
    "id": "cus_c7"
  },
  "setup_url": "https://calio-app.com/s/sps_x",
  "has_payment_method": false,
  "start_date": "2025-10-18T11:40:00.000Z",
  "next_charge_date": null,
  "max_charges": 12,
  "charges_count": 0,
  "failed_attempts": 0,
  "total_charged_agorot": 9900,
  "last_charge_at": "2025-10-18T11:41:01.000Z",
  "latest_document": null,
  "paused_at": null,
  "canceled_at": null,
  "reference": "MEMBER-7",
  "metadata": {
    "plan": "gold"
  },
  "created_at": "2025-10-18T11:30:00.000Z",
  "livemode": true
}

GET /v1/subscriptions

רשימת מנויים

מנויים שנוצרו דרך ה-API. ?status= ו-?customer_id= לסינון.

יכולת subscriptions:readקצב read

פרמטר
limitstringרשות
1–100, ברירת מחדל 20
starting_afterstringרשות
עד 140 תווים
statusstringרשות
אחד מ: pending_payment_method, active, past_due, paused, completed, canceled
customer_idstringרשות
עד 140 תווים
const res = await fetch('https://api.calio-app.com/v1/subscriptions', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "object": "subscription",
      "id": "sub_x",
      "status": "active",
      "past_due_reason": null,
      "name": "מנוי חודשי",
      "amount_agorot": 9900,
      "currency": "ILS",
      "interval": "month",
      "customer": {
        "id": "cus_c7"
      },
      "setup_url": null,
      "has_payment_method": false,
      "start_date": "2025-10-18T11:40:00.000Z",
      "next_charge_date": "2025-11-18T11:40:00.000Z",
      "max_charges": 12,
      "charges_count": 1,
      "failed_attempts": 0,
      "total_charged_agorot": 9900,
      "last_charge_at": "2025-10-18T11:41:01.000Z",
      "latest_document": null,
      "paused_at": null,
      "canceled_at": null,
      "reference": "MEMBER-7",
      "metadata": {
        "plan": "gold"
      },
      "created_at": "2025-10-18T11:30:00.000Z",
      "livemode": true
    }
  ],
  "has_more": false,
  "next_cursor": null
}

GET /v1/subscriptions/{id}

מנוי

כולל next_charge_date, charges_count, past_due_reason.

יכולת subscriptions:readקצב read

שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/subscriptions/sub_x', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · מנוי שנוצר דרך ה-API. פרטי הכרטיס לא נחשפים — רק has_payment_method.
JSON
{
  "object": "subscription",
  "id": "sub_x",
  "status": "active",
  "past_due_reason": null,
  "name": "מנוי חודשי",
  "amount_agorot": 9900,
  "currency": "ILS",
  "interval": "month",
  "customer": {
    "id": "cus_c7"
  },
  "setup_url": null,
  "has_payment_method": false,
  "start_date": "2025-10-18T11:40:00.000Z",
  "next_charge_date": "2025-11-18T11:40:00.000Z",
  "max_charges": 12,
  "charges_count": 1,
  "failed_attempts": 0,
  "total_charged_agorot": 9900,
  "last_charge_at": "2025-10-18T11:41:01.000Z",
  "latest_document": null,
  "paused_at": null,
  "canceled_at": null,
  "reference": "MEMBER-7",
  "metadata": {
    "plan": "gold"
  },
  "created_at": "2025-10-18T11:30:00.000Z",
  "livemode": true
}

PATCH /v1/subscriptions/{id}

שינוי סכום מנוי

🔴 דורש subscriptions:amount.

יכולת subscriptions:amountקצב writeדורש Idempotency-Key

שדה בגוף
amount_agorotintegerחובה
מינ' 1 · מקס' 100000000
const res = await fetch('https://api.calio-app.com/v1/subscriptions/sub_x', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    "amount_agorot": 12900
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · מנוי שנוצר דרך ה-API. פרטי הכרטיס לא נחשפים — רק has_payment_method.
JSON
{
  "object": "subscription",
  "id": "sub_x",
  "status": "active",
  "past_due_reason": null,
  "name": "מנוי חודשי",
  "amount_agorot": 9900,
  "currency": "ILS",
  "interval": "month",
  "customer": {
    "id": "cus_c7"
  },
  "setup_url": null,
  "has_payment_method": false,
  "start_date": "2025-10-18T11:40:00.000Z",
  "next_charge_date": "2025-11-18T11:40:00.000Z",
  "max_charges": 12,
  "charges_count": 1,
  "failed_attempts": 0,
  "total_charged_agorot": 9900,
  "last_charge_at": "2025-10-18T11:41:01.000Z",
  "latest_document": null,
  "paused_at": null,
  "canceled_at": null,
  "reference": "MEMBER-7",
  "metadata": {
    "plan": "gold"
  },
  "created_at": "2025-10-18T11:30:00.000Z",
  "livemode": true
}

GET /v1/subscriptions/{id}/charges

חיובי מנוי

כל ניסיון חיוב של המנוי, מהחדש לישן.

יכולת subscriptions:readקצב read

שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/subscriptions/sub_x/charges', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "object": "subscription_charge",
      "id": "subch_sub_x_2",
      "status": "failed",
      "amount_agorot": 9900,
      "charge_number": 2,
      "failure_reason": "payment_failed",
      "payment_id": null,
      "created_at": "2025-10-18T11:41:02.000Z"
    },
    {
      "object": "subscription_charge",
      "id": "subch_sub_x_1",
      "status": "succeeded",
      "amount_agorot": 9900,
      "charge_number": 1,
      "failure_reason": null,
      "payment_id": null,
      "created_at": "2025-10-18T11:40:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

POST /v1/subscriptions/{id}/pause

השהיית מנוי

רק ממנוי active. אין חיובים עד חידוש.

יכולת subscriptions:writeקצב writeדורש Idempotency-Key

שדה בגוף
reasonstringרשות
עד 300 תווים
const res = await fetch('https://api.calio-app.com/v1/subscriptions/sub_x/pause', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    "reason": "חופשה"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · מנוי שנוצר דרך ה-API. פרטי הכרטיס לא נחשפים — רק has_payment_method.
JSON
{
  "object": "subscription",
  "id": "sub_x",
  "status": "active",
  "past_due_reason": null,
  "name": "מנוי חודשי",
  "amount_agorot": 9900,
  "currency": "ILS",
  "interval": "month",
  "customer": {
    "id": "cus_c7"
  },
  "setup_url": null,
  "has_payment_method": false,
  "start_date": "2025-10-18T11:40:00.000Z",
  "next_charge_date": "2025-11-18T11:40:00.000Z",
  "max_charges": 12,
  "charges_count": 1,
  "failed_attempts": 0,
  "total_charged_agorot": 9900,
  "last_charge_at": "2025-10-18T11:41:01.000Z",
  "latest_document": null,
  "paused_at": null,
  "canceled_at": null,
  "reference": "MEMBER-7",
  "metadata": {
    "plan": "gold"
  },
  "created_at": "2025-10-18T11:30:00.000Z",
  "livemode": true
}

POST /v1/subscriptions/{id}/resume

חידוש מנוי

רק ממנוי paused. החיוב הבא בהרצה הקרובה (08:00). מנוי בפיגור צריך כרטיס חדש — payment_method_update_link.

יכולת subscriptions:writeקצב writeדורש Idempotency-Key

const res = await fetch('https://api.calio-app.com/v1/subscriptions/sub_x/resume', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · מנוי שנוצר דרך ה-API. פרטי הכרטיס לא נחשפים — רק has_payment_method.
JSON
{
  "object": "subscription",
  "id": "sub_x",
  "status": "active",
  "past_due_reason": null,
  "name": "מנוי חודשי",
  "amount_agorot": 9900,
  "currency": "ILS",
  "interval": "month",
  "customer": {
    "id": "cus_c7"
  },
  "setup_url": null,
  "has_payment_method": false,
  "start_date": "2025-10-18T11:40:00.000Z",
  "next_charge_date": "2025-11-18T11:40:00.000Z",
  "max_charges": 12,
  "charges_count": 1,
  "failed_attempts": 0,
  "total_charged_agorot": 9900,
  "last_charge_at": "2025-10-18T11:41:01.000Z",
  "latest_document": null,
  "paused_at": null,
  "canceled_at": null,
  "reference": "MEMBER-7",
  "metadata": {
    "plan": "gold"
  },
  "created_at": "2025-10-18T11:30:00.000Z",
  "livemode": true
}

POST /v1/subscriptions/{id}/cancel

ביטול מנוי

מכל מצב שאינו canceled/completed. אין חיובים נוספים.

יכולת subscriptions:writeקצב writeדורש Idempotency-Key

שדה בגוף
reasonstringרשות
עד 300 תווים
const res = await fetch('https://api.calio-app.com/v1/subscriptions/sub_x/cancel', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    "reason": "הלקוח ביקש"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · מנוי שנוצר דרך ה-API. פרטי הכרטיס לא נחשפים — רק has_payment_method.
JSON
{
  "object": "subscription",
  "id": "sub_x",
  "status": "active",
  "past_due_reason": null,
  "name": "מנוי חודשי",
  "amount_agorot": 9900,
  "currency": "ILS",
  "interval": "month",
  "customer": {
    "id": "cus_c7"
  },
  "setup_url": null,
  "has_payment_method": false,
  "start_date": "2025-10-18T11:40:00.000Z",
  "next_charge_date": "2025-11-18T11:40:00.000Z",
  "max_charges": 12,
  "charges_count": 1,
  "failed_attempts": 0,
  "total_charged_agorot": 9900,
  "last_charge_at": "2025-10-18T11:41:01.000Z",
  "latest_document": null,
  "paused_at": null,
  "canceled_at": null,
  "reference": "MEMBER-7",
  "metadata": {
    "plan": "gold"
  },
  "created_at": "2025-10-18T11:30:00.000Z",
  "livemode": true
}

POST /v1/subscriptions/{id}/test/activate

בדיקה: הלקוח הזין כרטיס

מצב בדיקה בלבד — מדמה הזנת כרטיס בדף המנוי (גם החלפת כרטיס ממצב פיגור). שולח את אותם אירועים.

יכולת subscriptions:writeקצב writeדורש Idempotency-Key

const res = await fetch('https://api.calio-app.com/v1/subscriptions/sub_x/test/activate', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · מנוי שנוצר דרך ה-API. פרטי הכרטיס לא נחשפים — רק has_payment_method.
JSON
{
  "object": "subscription",
  "id": "sub_x",
  "status": "active",
  "past_due_reason": null,
  "name": "מנוי חודשי",
  "amount_agorot": 9900,
  "currency": "ILS",
  "interval": "month",
  "customer": {
    "id": "cus_c7"
  },
  "setup_url": null,
  "has_payment_method": false,
  "start_date": "2025-10-18T11:40:00.000Z",
  "next_charge_date": "2025-11-18T11:40:00.000Z",
  "max_charges": 12,
  "charges_count": 1,
  "failed_attempts": 0,
  "total_charged_agorot": 9900,
  "last_charge_at": "2025-10-18T11:41:01.000Z",
  "latest_document": null,
  "paused_at": null,
  "canceled_at": null,
  "reference": "MEMBER-7",
  "metadata": {
    "plan": "gold"
  },
  "created_at": "2025-10-18T11:30:00.000Z",
  "livemode": true
}

POST /v1/subscriptions/{id}/test/charge

בדיקה: חיוב מחזור

מצב בדיקה בלבד — מריץ את אותו כלל מצבים של מנוע החיובים: succeeded / declined (ניסיון חוזר) / card_declined (פיגור).

יכולת subscriptions:writeקצב writeדורש Idempotency-Key

שדה בגוף
outcomestringחובה
אחד מ: succeeded, declined, card_declined
const res = await fetch('https://api.calio-app.com/v1/subscriptions/sub_x/test/charge', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    "outcome": "declined"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · מנוי שנוצר דרך ה-API. פרטי הכרטיס לא נחשפים — רק has_payment_method.
JSON
{
  "object": "subscription",
  "id": "sub_x",
  "status": "active",
  "past_due_reason": null,
  "name": "מנוי חודשי",
  "amount_agorot": 9900,
  "currency": "ILS",
  "interval": "month",
  "customer": {
    "id": "cus_c7"
  },
  "setup_url": null,
  "has_payment_method": false,
  "start_date": "2025-10-18T11:40:00.000Z",
  "next_charge_date": "2025-11-18T11:40:00.000Z",
  "max_charges": 12,
  "charges_count": 1,
  "failed_attempts": 0,
  "total_charged_agorot": 9900,
  "last_charge_at": "2025-10-18T11:41:01.000Z",
  "latest_document": null,
  "paused_at": null,
  "canceled_at": null,
  "reference": "MEMBER-7",
  "metadata": {
    "plan": "gold"
  },
  "created_at": "2025-10-18T11:30:00.000Z",
  "livemode": true
}

מסמכים

GET /v1/documents/{id}

מסמך

מסמך של תשלום API: סוג, מספר, סכום, מע"מ, מספר הקצאה והתשלום המקושר. מסמך שאינו של תשלום API נראה כמו מזהה שלא קיים.

יכולת documents:readקצב read

שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/documents/doc_4417', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200 · מסמך חשבונאי של תשלום שעבר דרך ה-API. קריאה בלבד — אין יצירת מסמך בלי תשלום.
JSON
{
  "object": "document",
  "id": "doc_4417",
  "type": "taxInvoiceReceipt",
  "number": "10233",
  "status": "issued",
  "pdf_url": null,
  "amount_agorot": 28900,
  "vat_rate": 18,
  "vat_agorot": 4408,
  "pre_vat_agorot": 24492,
  "allocation_number": null,
  "is_credit": false,
  "payment_id": "pay_ps_x",
  "created_at": "2025-10-18T11:41:02.000Z",
  "livemode": true
}

GET /v1/documents/{id}/pdf

PDF של מסמך

קישור חתום ל-15 דקות, להורדה של הקובץ. הקישור הקבוע נמצא ב-pdf_url של המסמך. מסמך בדיקה — אין PDF.

יכולת documents:readקצב read

const res = await fetch('https://api.calio-app.com/v1/documents/doc_4417/pdf', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "document_pdf",
  "document_id": "doc_4417",
  "url": "https://storage.googleapis.com/signed?x=1",
  "expires_at": "2025-10-18T11:56:40.000Z"
}

אירועים

GET /v1/events

אירועים

30 הימים האחרונים, החדשים קודם. לשחזור webhooks שלא הגיעו — סנכרון לילי. סינון לפי type.

יכולת events:readקצב read

פרמטר
limitstringרשות
1–100, ברירת מחדל 20
starting_afterstringרשות
עד 420 תווים
typestringרשות
עד 64 תווים
const res = await fetch('https://api.calio-app.com/v1/events', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "object": "list",
  "data": [
    {
      "id": "evt_payment.succeeded_pay_ps_x_1",
      "type": "payment.succeeded",
      "created": "2025-10-18T11:41:02.000Z",
      "livemode": true,
      "api_version": "2026-10-18",
      "data": {
        "object": {
          "object": "payment",
          "id": "pay_ps_x",
          "livemode": true,
          "status": "succeeded",
          "document_status": "failed",
          "requires_attention": true,
          "issues": [
            {
              "code": "stock_shortfall",
              "severity": "warning",
              "message": "המלאי ירד מתחת לאפס אחרי התשלום (שני קונים על אותה יחידה).",
              "created": "2025-10-18T11:41:02.000Z",
              "resolved": null
            },
            {
              "code": "document_generation_failed",
              "severity": "action_required",
              "message": "התשלום התקבל אבל הקבלה לא הופקה. יש להפיק אותה מהאפליקציה.",
              "created": null,
              "resolved": null
            }
          ],
          "checkout_session_id": "cs_ps_x",
          "reference": "ORDER-1042",
          "metadata": {
            "cart_id": "c_88"
          },
          "amount_total_agorot": 28900,
          "charged_amount_agorot": 28900,
          "refunded_amount_agorot": 0,
          "currency": "ILS",
          "paid_at": "2025-10-18T11:41:01.000Z",
          "payment_method": {
            "type": "card",
            "brand": "visa",
            "last4": "4242",
            "installments": 1
          },
          "customer": {
            "id": "cus_c7"
          },
          "lines": [
            {
              "type": "service",
              "product_id": "prd_svc1",
              "name": "שיעור פרטי",
              "quantity": 1,
              "unit_price_agorot": 25900,
              "total_agorot": 25900
            },
            {
              "type": "custom",
              "product_id": null,
              "name": "דמי רישום",
              "quantity": 1,
              "unit_price_agorot": 3000,
              "total_agorot": 3000
            }
          ],
          "documents": [],
          "order_id": null
        }
      }
    }
  ],
  "has_more": false,
  "next_cursor": "evt_payment.succeeded_pay_ps_x_1"
}

GET /v1/events/{id}

אירוע

אותו גוף בדיוק שנשלח ב-webhook.

יכולת events:readקצב read

שגיאות אפשריותresource_not_found
const res = await fetch('https://api.calio-app.com/v1/events/evt_payment.succeeded_pay_ps_x_1', {
  headers: {
    Authorization: `Bearer ${process.env.CALIO_SECRET_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.developer_message}`);
תשובה 200
JSON
{
  "id": "evt_payment.succeeded_pay_ps_x_1",
  "type": "payment.succeeded",
  "created": "2025-10-18T11:41:02.000Z",
  "livemode": true,
  "api_version": "2026-10-18",
  "data": {
    "object": {
      "object": "payment",
      "id": "pay_ps_x",
      "livemode": true,
      "status": "succeeded",
      "document_status": "failed",
      "requires_attention": true,
      "issues": [
        {
          "code": "stock_shortfall",
          "severity": "warning",
          "message": "המלאי ירד מתחת לאפס אחרי התשלום (שני קונים על אותה יחידה).",
          "created": "2025-10-18T11:41:02.000Z",
          "resolved": null
        },
        {
          "code": "document_generation_failed",
          "severity": "action_required",
          "message": "התשלום התקבל אבל הקבלה לא הופקה. יש להפיק אותה מהאפליקציה.",
          "created": null,
          "resolved": null
        }
      ],
      "checkout_session_id": "cs_ps_x",
      "reference": "ORDER-1042",
      "metadata": {
        "cart_id": "c_88"
      },
      "amount_total_agorot": 28900,
      "charged_amount_agorot": 28900,
      "refunded_amount_agorot": 0,
      "currency": "ILS",
      "paid_at": "2025-10-18T11:41:01.000Z",
      "payment_method": {
        "type": "card",
        "brand": "visa",
        "last4": "4242",
        "installments": 1
      },
      "customer": {
        "id": "cus_c7"
      },
      "lines": [
        {
          "type": "service",
          "product_id": "prd_svc1",
          "name": "שיעור פרטי",
          "quantity": 1,
          "unit_price_agorot": 25900,
          "total_agorot": 25900
        },
        {
          "type": "custom",
          "product_id": null,
          "name": "דמי רישום",
          "quantity": 1,
          "unit_price_agorot": 3000,
          "total_agorot": 3000
        }
      ],
      "documents": [],
      "order_id": null
    }
  }
}