{"openapi":"3.1.0","info":{"title":"Lancer API","version":"1.0.0","description":"The Lancer public REST API. Authenticate with an organization API key (Settings → API & Webhooks) as `Authorization: Bearer lk_…` or `X-Api-Key`. Every key has scopes; each operation names the one it needs. Money is integer agorot (1 ₪ = 100). Lists are paginated with `page` and `pageSize` (max 100)."},"servers":[{"url":"https://api.lancer-erp.com/api"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"lk_…"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key"}}},"tags":[{"name":"Leads"},{"name":"Clients"},{"name":"Projects"},{"name":"Payment requests"},{"name":"Payments"}],"paths":{"/v1/leads":{"post":{"operationId":"postVLeads","summary":"Create a lead (website forms, n8n, Make)","description":"Requires the `leads:write` scope (יצירת לידים).","tags":["Leads"],"x-lancer-scope":"leads:write","parameters":[],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"company":{"type":["string","null"]},"taxId":{"default":null,"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"source":{"type":"string","enum":["website","api","whatsapp","sms","referral","manual","meta_ads","google_ads","booking"]},"stage":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"},"color":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","color","position"],"additionalProperties":false},"expectedValueAgorot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"followUpAt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"status":{"type":"string","enum":["open","won","lost"]},"lostReason":{"type":["string","null"]},"wonAt":{"type":["string","null"]},"lostAt":{"type":["string","null"]},"convertedClientId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sourceDetail":{"default":null,"type":["string","null"]},"score":{"default":0,"type":"integer","minimum":0,"maximum":100},"scoreBand":{"default":"cold","type":"string","enum":["hot","warm","cold"]},"wonReasonCode":{"default":null,"anyOf":[{"type":"string","enum":["price","quality","portfolio","referral","speed","relationship","other"]},{"type":"null"}]},"wonReason":{"default":null,"type":["string","null"]},"lostReasonCode":{"default":null,"anyOf":[{"type":"string","enum":["price","budget","competitor","timing","no_response","not_fit","other"]},{"type":"null"}]},"customFields":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","company","taxId","phone","email","source","stage","expectedValueAgorot","followUpAt","owner","notes","status","lostReason","wonAt","lostAt","convertedClientId","sourceDetail","score","scoreBand","wonReasonCode","wonReason","lostReasonCode","customFields","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"company":{"type":"string","maxLength":200},"phone":{"type":"string","maxLength":40},"email":{"type":"string"},"source":{"default":"api","type":"string","enum":["website","api","whatsapp","sms","referral","manual","meta_ads","google_ads","booking"]},"expectedValueAgorot":{"type":"integer","minimum":0,"maximum":9007199254740991},"followUpAt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","const":""}]},"notes":{"type":"string","maxLength":5000},"stage":{"type":"string","maxLength":60},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":["string","number","boolean","null"]}}},"required":["name"]}}}}}},"/v1/clients":{"get":{"operationId":"getVClients","summary":"List clients","description":"Requires the `clients:read` scope (קריאת לקוחות).","tags":["Clients"],"x-lancer-scope":"clients:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"includeArchived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","enum":["company","individual"]},"name":{"type":"string"},"taxId":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"source":{"type":"string","enum":["website","api","whatsapp","sms","referral","manual","meta_ads","google_ads","booking"]},"tags":{"type":"array","items":{"type":"string"}},"ownerId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"title":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"isPrimary":{"type":"boolean"}},"required":["name","title","email","phone","isPrimary"],"additionalProperties":false}},"customFields":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"archived":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","name","taxId","phone","email","website","address","source","tags","ownerId","contacts","customFields","archived","createdAt","updatedAt"],"additionalProperties":false}},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"pageSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["items","total","page","pageSize"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"postVClients","summary":"Create a client","description":"Requires the `clients:write` scope (יצירת לקוחות).","tags":["Clients"],"x-lancer-scope":"clients:write","parameters":[],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","enum":["company","individual"]},"name":{"type":"string"},"taxId":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"source":{"type":"string","enum":["website","api","whatsapp","sms","referral","manual","meta_ads","google_ads","booking"]},"tags":{"type":"array","items":{"type":"string"}},"ownerId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"title":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"isPrimary":{"type":"boolean"}},"required":["name","title","email","phone","isPrimary"],"additionalProperties":false}},"customFields":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"archived":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","name","taxId","phone","email","website","address","source","tags","ownerId","contacts","customFields","archived","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"default":"company","type":"string","enum":["company","individual"]},"name":{"type":"string","minLength":1,"maxLength":200},"taxId":{"type":"string","maxLength":20},"phone":{"type":"string","maxLength":40},"email":{"type":"string"},"website":{"type":"string"},"address":{"type":"string","maxLength":300},"source":{"default":"api","type":"string","enum":["website","api","whatsapp","sms","referral","manual","meta_ads","google_ads","booking"]},"tags":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"contacts":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"title":{"type":"string","maxLength":120},"email":{"type":"string"},"phone":{"type":"string","maxLength":40}},"required":["name"]}},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":["string","number","boolean","null"]}}},"required":["name"]}}}}}},"/v1/clients/{id}":{"get":{"operationId":"getVClientsId","summary":"Get a client","description":"Requires the `clients:read` scope (קריאת לקוחות).","tags":["Clients"],"x-lancer-scope":"clients:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","enum":["company","individual"]},"name":{"type":"string"},"taxId":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"source":{"type":"string","enum":["website","api","whatsapp","sms","referral","manual","meta_ads","google_ads","booking"]},"tags":{"type":"array","items":{"type":"string"}},"ownerId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"title":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"isPrimary":{"type":"boolean"}},"required":["name","title","email","phone","isPrimary"],"additionalProperties":false}},"customFields":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"archived":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","name","taxId","phone","email","website","address","source","tags","ownerId","contacts","customFields","archived","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects":{"get":{"operationId":"getVProjects","summary":"List projects","description":"Requires the `projects:read` scope (קריאת פרויקטים).","tags":["Projects"],"x-lancer-scope":"projects:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","active","on_hold","completed","cancelled"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"clientName":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","active","on_hold","completed","cancelled"]},"billingType":{"type":"string","enum":["one_time","retainer","hours_bank","mixed"]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"budgetAgorot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"retainerAmountAgorot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"packageId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"ownerId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"customFields":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","clientId","clientName","title","status","billingType","startDate","dueDate","budgetAgorot","retainerAmountAgorot","packageId","quoteId","ownerId","customFields","createdAt","updatedAt"],"additionalProperties":false}},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"pageSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["items","total","page","pageSize"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects/{id}":{"get":{"operationId":"getVProjectsId","summary":"Get a project","description":"Requires the `projects:read` scope (קריאת פרויקטים).","tags":["Projects"],"x-lancer-scope":"projects:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"clientName":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","active","on_hold","completed","cancelled"]},"billingType":{"type":"string","enum":["one_time","retainer","hours_bank","mixed"]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"budgetAgorot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"retainerAmountAgorot":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"packageId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"ownerId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"customFields":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","clientId","clientName","title","status","billingType","startDate","dueDate","budgetAgorot","retainerAmountAgorot","packageId","quoteId","ownerId","customFields","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/payment-requests":{"get":{"operationId":"getVPaymentRequests","summary":"List payment requests","description":"Requires the `payment_requests:read` scope (קריאת דרישות תשלום).","tags":["Payment requests"],"x-lancer-scope":"payment_requests:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["not_sent","sent","partially_paid","paid","overdue","cancelled"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"projectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"title":{"type":"string"},"amountAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditedAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"status":{"type":"string","enum":["not_sent","sent","partially_paid","paid","overdue","cancelled"]},"sentAt":{"type":["string","null"]},"payUrl":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","clientId","projectId","title","amountAgorot","paidAgorot","creditedAgorot","dueDate","status","sentAt","payUrl","createdAt","updatedAt"],"additionalProperties":false}},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"pageSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["items","total","page","pageSize"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"postVPaymentRequests","summary":"Create a payment request, optionally with a pay link","description":"Requires the `payment_requests:write` scope (יצירת דרישות תשלום).","tags":["Payment requests"],"x-lancer-scope":"payment_requests:write","parameters":[],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"projectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"title":{"type":"string"},"amountAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditedAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"status":{"type":"string","enum":["not_sent","sent","partially_paid","paid","overdue","cancelled"]},"sentAt":{"type":["string","null"]},"payUrl":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","clientId","projectId","title","amountAgorot","paidAgorot","creditedAgorot","dueDate","status","sentAt","payUrl","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","minLength":1},"projectId":{"type":"string","maxLength":64},"title":{"type":"string","minLength":1,"maxLength":200},"amountAgorot":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","const":""}]},"createLink":{"default":false,"type":"boolean"}},"required":["clientId","title","amountAgorot"]}}}}}},"/v1/payment-requests/{id}":{"get":{"operationId":"getVPaymentRequestsId","summary":"Get a payment request","description":"Requires the `payment_requests:read` scope (קריאת דרישות תשלום).","tags":["Payment requests"],"x-lancer-scope":"payment_requests:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"projectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"title":{"type":"string"},"amountAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditedAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"status":{"type":"string","enum":["not_sent","sent","partially_paid","paid","overdue","cancelled"]},"sentAt":{"type":["string","null"]},"payUrl":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","clientId","projectId","title","amountAgorot","paidAgorot","creditedAgorot","dueDate","status","sentAt","payUrl","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/payments":{"get":{"operationId":"getVPayments","summary":"List payments","description":"Requires the `payments:read` scope (קריאת תשלומים).","tags":["Payments"],"x-lancer-scope":"payments:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"paymentRequestId","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","const":""}]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"paymentRequestId":{"type":"string","minLength":1},"amountAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedAgorot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"method":{"type":"string","enum":["card","bit","bank_transfer","cash","cheque","other"]},"installments":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"paidAt":{"type":"string"},"documentNumber":{"type":["string","null"]}},"required":["id","clientId","paymentRequestId","amountAgorot","refundedAgorot","method","installments","paidAt","documentNumber"],"additionalProperties":false}},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"pageSize":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["items","total","page","pageSize"],"additionalProperties":false}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing, unknown or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"The key lacks the scope (code INSUFFICIENT_SCOPE)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Not found in this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}}}}