{"openapi":"3.1.0","info":{"title":"SBA public API","version":"1.0.0","description":"Documents in, ledgers out. Errors are stable codes with parameters; mutating endpoints require Idempotency-Key."},"components":{"schemas":{},"parameters":{}},"paths":{"/v1/auth/login":{"post":{"tags":["auth"],"summary":"Sign in with email and password","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":1}},"required":["email","password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/auth/signup":{"post":{"tags":["auth"],"summary":"Create a user account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8},"locale":{"type":["string","null"]}},"required":["name","email","password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/auth/logout":{"post":{"tags":["auth"],"summary":"Sign out","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/auth/me":{"get":{"tags":["auth"],"summary":"Current user and organizations","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"patch":{"tags":["auth"],"summary":"Update the user's language","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":["string","null"]}},"required":["locale"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/orgs":{"post":{"tags":["orgs"],"summary":"Create an organization (guided setup)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"countryPack":{"type":"string"},"baseCurrency":{"type":["string","null"],"minLength":3,"maxLength":3},"defaultLanguage":{"type":["string","null"]},"industryTemplate":{"type":["string","null"]},"taxId":{"type":["string","null"]},"currencies":{"type":"array","items":{"type":"string","minLength":3,"maxLength":3},"default":[]}},"required":["name","countryPack"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/org":{"get":{"tags":["orgs"],"summary":"Current organization with features and role","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"patch":{"tags":["orgs"],"summary":"Update organization profile","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"legalName":{"type":["string","null"]},"taxId":{"type":["string","null"]},"timezone":{"type":"string"},"defaultLanguage":{"type":"string"},"address":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/practice":{"get":{"tags":["orgs"],"summary":"Advisor practice view across client organizations","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/meta/packs":{"get":{"tags":["meta"],"summary":"Country packs, templates (with descriptions), accounting standards and tax categories","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/parties":{"get":{"tags":["master"],"summary":"List parties","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"role","in":"query"},{"schema":{"type":"string"},"required":false,"name":"type","in":"query"},{"schema":{"type":["integer","null"],"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["master"],"summary":"Create a party","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"roles":{"type":"array","items":{"type":"string","enum":["customer","supplier","lead","contact","employee"]},"minItems":1},"kind":{"type":"string","enum":["company","person"],"default":"company"},"taxId":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"]},"language":{"type":["string","null"]},"currency":{"type":["string","null"]},"address":{"type":"object","additionalProperties":{"type":"string"},"default":{}},"relatedOrgId":{"type":["string","null"],"format":"uuid"},"paymentTermsDays":{"type":["integer","null"],"minimum":0},"creditLimit":{"type":["string","null"],"pattern":"^\\d+(\\.\\d+)?$"}},"required":["code","name","roles"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/parties/{id}":{"get":{"tags":["master"],"summary":"Get a party","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"put":{"tags":["master"],"summary":"Update a party","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"roles":{"type":"array","items":{"type":"string","enum":["customer","supplier","lead","contact","employee"]},"minItems":1},"kind":{"type":"string","enum":["company","person"],"default":"company"},"taxId":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"]},"language":{"type":["string","null"]},"currency":{"type":["string","null"]},"address":{"type":"object","additionalProperties":{"type":"string"},"default":{}},"relatedOrgId":{"type":["string","null"],"format":"uuid"},"paymentTermsDays":{"type":["integer","null"],"minimum":0},"creditLimit":{"type":["string","null"],"pattern":"^\\d+(\\.\\d+)?$"}},"required":["code","name","roles"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/items":{"get":{"tags":["master"],"summary":"List items with stock on hand","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"role","in":"query"},{"schema":{"type":"string"},"required":false,"name":"type","in":"query"},{"schema":{"type":["integer","null"],"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["master"],"summary":"Create an item","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"type":{"type":"string","enum":["stock","non_stock","service"]},"uom":{"type":"string","minLength":1},"uomConversions":{"type":"array","items":{"type":"object","properties":{"uom":{"type":"string"},"factor":{"type":"string"}},"required":["uom","factor"]},"default":[]},"name":{"type":"object","additionalProperties":{"type":"string"}},"description":{"type":"object","additionalProperties":{"type":"string"},"default":{}},"taxCategory":{"type":"string","minLength":1},"reorderPoint":{"type":["string","null"]}},"required":["code","type","uom","name","taxCategory"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/items/{id}":{"put":{"tags":["master"],"summary":"Update an item","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"type":{"type":"string","enum":["stock","non_stock","service"]},"uom":{"type":"string","minLength":1},"uomConversions":{"type":"array","items":{"type":"object","properties":{"uom":{"type":"string"},"factor":{"type":"string"}},"required":["uom","factor"]},"default":[]},"name":{"type":"object","additionalProperties":{"type":"string"}},"description":{"type":"object","additionalProperties":{"type":"string"},"default":{}},"taxCategory":{"type":"string","minLength":1},"reorderPoint":{"type":["string","null"]}},"required":["code","type","uom","name","taxCategory"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/locations":{"get":{"tags":["master"],"summary":"List locations","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["master"],"summary":"Create a location","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"type":{"type":"string","enum":["branch","warehouse","outlet"]},"name":{"type":"object","additionalProperties":{"type":"string"}},"branch":{"type":["string","null"]}},"required":["code","type","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/employees":{"get":{"tags":["master"],"summary":"List employees","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["master"],"summary":"Create an employee","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"userId":{"type":["string","null"],"format":"uuid"},"department":{"type":["string","null"]},"costRate":{"type":["string","null"],"pattern":"^\\d+(\\.\\d+)?$"},"costCurrency":{"type":["string","null"]},"externalRef":{"type":["string","null"]},"partyId":{"type":["string","null"],"format":"uuid"},"managerId":{"type":["string","null"],"format":"uuid"},"position":{"type":["string","null"]},"workLocationId":{"type":["string","null"],"format":"uuid"},"startDate":{"type":["string","null"]},"endDate":{"type":["string","null"]},"active":{"type":"boolean"}},"required":["code","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/employees/{id}":{"put":{"tags":["master"],"summary":"Update an employee","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"userId":{"type":["string","null"],"format":"uuid"},"department":{"type":["string","null"]},"costRate":{"type":["string","null"],"pattern":"^\\d+(\\.\\d+)?$"},"costCurrency":{"type":["string","null"]},"externalRef":{"type":["string","null"]},"partyId":{"type":["string","null"],"format":"uuid"},"managerId":{"type":["string","null"],"format":"uuid"},"position":{"type":["string","null"]},"workLocationId":{"type":["string","null"],"format":"uuid"},"startDate":{"type":["string","null"]},"endDate":{"type":["string","null"]},"active":{"type":"boolean"}},"required":["code","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/accounts":{"get":{"tags":["master"],"summary":"Chart of accounts with balances and roles","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["master"],"summary":"Create an account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"object","additionalProperties":{"type":"string"}},"type":{"type":"string","enum":["asset","liability","equity","income","expense"]},"subtype":{"type":"string"},"postable":{"type":"boolean","default":true},"currency":{"type":["string","null"]},"groupAccountCode":{"type":["string","null"]}},"required":["code","name","type","subtype"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/accounts/{id}":{"put":{"tags":["master"],"summary":"Update an account","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"object","additionalProperties":{"type":"string"}},"type":{"type":"string","enum":["asset","liability","equity","income","expense"]},"subtype":{"type":"string"},"postable":{"type":"boolean","default":true},"currency":{"type":["string","null"]},"groupAccountCode":{"type":["string","null"]}},"required":["code","name","type","subtype"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/account-roles/{role}":{"put":{"tags":["master"],"summary":"Map an account role to an account","parameters":[{"schema":{"type":"string"},"required":true,"name":"role","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"}},"required":["accountId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/dimensions":{"get":{"tags":["master"],"summary":"Dimensions and their values","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["master"],"summary":"Define a custom dimension","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z_]+$"},"name":{"type":"object","additionalProperties":{"type":"string"}}},"required":["code","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/dimensions/{code}/values":{"post":{"tags":["master"],"summary":"Add a dimension value","parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"object","additionalProperties":{"type":"string"}}},"required":["code","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/currencies":{"get":{"tags":["currency"],"summary":"All currencies and which are active","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/currencies/{code}/activate":{"post":{"tags":["currency"],"summary":"Activate a currency","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":3},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/rates":{"get":{"tags":["currency"],"summary":"Exchange rates","parameters":[{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"type","in":"query"},{"schema":{"type":["number","null"]},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["currency"],"summary":"Record an exchange rate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","minLength":3,"maxLength":3},"to":{"type":"string","minLength":3,"maxLength":3},"rateType":{"type":"string","enum":["accounting","tax","closing","average"]},"rateDate":{"type":"string"},"rate":{"type":"string","pattern":"^\\d+(\\.\\d+)?$"}},"required":["from","to","rateType","rateDate","rate"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-accounts":{"get":{"tags":["money"],"summary":"Bank accounts with balances in both currencies","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["money"],"summary":"Create a bank account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[A-Za-z0-9_-]+$"},"name":{"type":"string","minLength":1},"bank":{"type":"string","minLength":1},"accountNumber":{"type":["string","null"]},"currency":{"type":"string","minLength":3,"maxLength":3},"glCode":{"type":["string","null"]}},"required":["code","name","bank","currency"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/members":{"get":{"tags":["orgs"],"summary":"Organization members","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["orgs"],"summary":"Add a member (advisor, staff, read-only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string","minLength":1},"role":{"type":"string"}},"required":["email","name","role"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/tax-categories":{"get":{"tags":["meta"],"summary":"Tax categories and withholding kinds of the org's pack","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/rates/suggest":{"get":{"tags":["currency"],"summary":"Suggest an exchange rate for a document date","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":3},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":3},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["accounting","tax"],"default":"accounting"},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"date","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/rates/fetch":{"post":{"tags":["currency"],"summary":"Fetch and store the accounting rate for every active currency","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/rates/tax-periods":{"get":{"tags":["currency"],"summary":"Weekly tax exchange-rate periods (Kurs Pajak)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["currency"],"summary":"Record a weekly tax exchange rate (KMK Kurs Pajak)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"validFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"validTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"rate":{"type":"string","pattern":"^\\d+(\\.\\d+)?$"},"reference":{"type":"string","minLength":1,"maxLength":120}},"required":["currency","validFrom","validTo","rate","reference"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/document-types":{"get":{"tags":["documents"],"summary":"Registered document types","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents":{"get":{"tags":["documents"],"summary":"List documents","parameters":[{"schema":{"type":"string"},"required":false,"name":"type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"partyId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","enum":["json","csv"]},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}":{"get":{"tags":["documents"],"summary":"Get a document with its ledgers, links and audit trail","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"patch":{"tags":["documents"],"summary":"Edit a draft","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"docDate":{"type":"string"},"partyId":{"type":["string","null"],"format":"uuid"},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"dimensions":{"type":"object","additionalProperties":{"type":"string"}},"body":{"type":"object","additionalProperties":{}},"reference":{"type":["string","null"]},"memo":{"type":["string","null"]},"rate":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{type}":{"post":{"tags":["documents"],"summary":"Create a document (optionally post it in one step)","parameters":[{"schema":{"type":"string"},"required":true,"name":"type","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"docDate":{"type":"string"},"partyId":{"type":["string","null"],"format":"uuid"},"currency":{"type":["string","null"],"minLength":3,"maxLength":3},"dimensions":{"type":"object","additionalProperties":{"type":"string"}},"body":{"type":"object","additionalProperties":{}},"reference":{"type":["string","null"]},"memo":{"type":["string","null"]},"rate":{"type":["string","null"]},"sourceIds":{"type":"array","items":{"type":"string","format":"uuid"}},"post":{"type":"boolean"}},"required":["docDate","body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/submit":{"post":{"tags":["documents"],"summary":"Lifecycle: submit","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/approve":{"post":{"tags":["documents"],"summary":"Lifecycle: approve","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/reject":{"post":{"tags":["documents"],"summary":"Lifecycle: reject","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/post":{"post":{"tags":["documents"],"summary":"Lifecycle: post","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/cancel":{"post":{"tags":["documents"],"summary":"Lifecycle: cancel","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/comments":{"post":{"tags":["documents"],"summary":"Comment on a document","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1}},"required":["body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/audit":{"get":{"tags":["documents"],"summary":"Audit trail","parameters":[{"schema":{"type":["number","null"]},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/dashboard":{"get":{"tags":["reports"],"summary":"Headline numbers","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"date","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/trial-balance":{"get":{"tags":["reports"],"summary":"Trial balance","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dimensions","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/profit-loss":{"get":{"tags":["reports"],"summary":"Profit and loss","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dimensions","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/balance-sheet":{"get":{"tags":["reports"],"summary":"Balance sheet","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"asOf","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dimensions","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/aging":{"get":{"tags":["reports"],"summary":"AR / AP aging","parameters":[{"schema":{"type":"string","enum":["receivable","payable"]},"required":true,"name":"role","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"asOf","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/statement/{id}":{"get":{"tags":["reports"],"summary":"Party statement in the party's currency","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/cash":{"get":{"tags":["reports"],"summary":"Cash position","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"asOf","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/general-ledger/{id}":{"get":{"tags":["reports"],"summary":"General ledger for one account (optionally filtered by dimensions, paginated with limit/offset)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dimensions","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":5000},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/stock":{"get":{"tags":["reports"],"summary":"Stock on hand and value by item and location","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/project/{code}":{"get":{"tags":["reports"],"summary":"Project cost and profit","parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/parties/{id}/open-items":{"get":{"tags":["reports"],"summary":"Open items of a party","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/sales/price":{"get":{"tags":["sales"],"summary":"Price for an item, party, currency and date","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"itemId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"partyId","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":3},"required":true,"name":"currency","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"date","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/items/{id}/availability":{"get":{"tags":["goods"],"summary":"Availability per location","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/tickets/{id}/sla":{"get":{"tags":["service"],"summary":"SLA due times","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/recurring/{id}/next":{"get":{"tags":["money"],"summary":"Next run date of a recurring template","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/sales/orders/{id}/deliver":{"post":{"tags":["commands"],"summary":"Deliver open stock lines of a sales order","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"locationId":{"type":"string","format":"uuid"},"supplierInvoiceNo":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/sales/orders/{id}/invoice":{"post":{"tags":["commands"],"summary":"Invoice service lines of a sales order","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"locationId":{"type":"string","format":"uuid"},"supplierInvoiceNo":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/sales/deliveries/{id}/invoice":{"post":{"tags":["commands"],"summary":"Invoice a delivery at order prices","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"locationId":{"type":"string","format":"uuid"},"supplierInvoiceNo":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/goods/receipts/{id}/bill":{"post":{"tags":["commands"],"summary":"Bill a goods receipt (three-way match)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"locationId":{"type":"string","format":"uuid"},"supplierInvoiceNo":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/customers/leads/{id}/convert":{"post":{"tags":["commands"],"summary":"Convert a lead into a customer","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"locationId":{"type":"string","format":"uuid"},"supplierInvoiceNo":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/customers/opportunities/{id}/quote":{"post":{"tags":["commands"],"summary":"Create a quote from an opportunity","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"locationId":{"type":"string","format":"uuid"},"supplierInvoiceNo":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/sales/quotes/{id}/order":{"post":{"tags":["commands"],"summary":"Create a sales order from a quote","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"locationId":{"type":"string","format":"uuid"},"supplierInvoiceNo":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/work/projects/{code}/invoice-time":{"post":{"tags":["commands"],"summary":"Invoice unbilled time (T&M)","parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-accounts/{id}/statements":{"post":{"tags":["money"],"summary":"Import a bank statement (CSV: date,description,amount,reference)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"csv":{"type":"string","minLength":1}},"required":["csv"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-accounts/{id}/statement-lines":{"get":{"tags":["money"],"summary":"Statement lines with match state","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/statement-lines/{id}/match":{"post":{"tags":["money"],"summary":"Match a statement line to a posted document","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid"}},"required":["documentId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/statement-lines/{id}/unmatch":{"post":{"tags":["money"],"summary":"Undo a match","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/periods":{"get":{"tags":["ledger"],"summary":"Fiscal periods","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/periods/{period}/lock":{"post":{"tags":["ledger"],"summary":"Lock a period and snapshot its trial balance","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"period","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/periods/{period}/reopen":{"post":{"tags":["ledger"],"summary":"Reopen a locked period","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"period","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/processes/fx-revaluation":{"post":{"tags":["processes"],"summary":"Run period-end FX revaluation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},"required":["period"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/processes/recurring":{"post":{"tags":["processes"],"summary":"Run due recurring invoices","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/tax/export":{"get":{"tags":["tax"],"summary":"Export tax documents for a period (Coretax stub)","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"period","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/parameters":{"get":{"tags":["settings"],"summary":"Parameter registry with resolved and stored values","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/parameters/{key}":{"put":{"tags":["settings"],"summary":"Set a parameter value (audited)","parameters":[{"schema":{"type":"string"},"required":true,"name":"key","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{},"scope":{"type":"string","enum":["org","branch","user"]},"scopeRef":{"type":"string"},"effectiveFrom":{"type":["string","null"]},"reason":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/parameters/audit":{"get":{"tags":["settings"],"summary":"Parameter change history","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/pdf":{"get":{"tags":["documents"],"summary":"Render a document as PDF in the party's language","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"lang","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/kwitansi.pdf":{"get":{"tags":["documents"],"summary":"Receipt (kwitansi) PDF for a posted incoming payment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"lang","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/statement/{id}/pdf":{"get":{"tags":["reports"],"summary":"Party statement PDF in the party's currency and language","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"currency","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/meta":{"get":{"tags":["people"],"summary":"Pack reference data for People: tax statuses, regions with minimum wage, bank file formats, bank codes","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/employees":{"get":{"tags":["people"],"summary":"Employee directory (non-sensitive fields)","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"active","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["people"],"summary":"Create an employee with party and profile","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"department":{"type":["string","null"]},"position":{"type":["string","null"]},"managerId":{"type":["string","null"],"format":"uuid"},"workLocationId":{"type":["string","null"],"format":"uuid"},"userId":{"type":["string","null"],"format":"uuid"},"startDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"externalRef":{"type":["string","null"]},"active":{"type":"boolean"},"profile":{"type":"object","properties":{"employmentType":{"type":"string","enum":["permanent","fixed_term","probation","part_time"]},"startDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"probationEnd":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"payCalendar":{"type":"string"},"region":{"type":["string","null"]},"language":{"type":["string","null"]},"attributes":{"type":"object","additionalProperties":{"type":"string"}},"birthDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"gender":{"type":["string","null"]},"marital":{"type":["string","null"]},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"emergencyContact":{"type":["string","null"]},"nik":{"type":["string","null"]},"npwp":{"type":["string","null"]},"bpjsKes":{"type":["string","null"]},"bpjsTk":{"type":["string","null"]},"taxStatus":{"type":["string","null"]},"bank":{"type":["object","null"],"properties":{"bankCode":{"type":"string","minLength":1},"accountNumber":{"type":"string","minLength":1},"holder":{"type":"string","minLength":1}},"required":["bankCode","accountNumber","holder"]}}}},"required":["code","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/employees/{id}":{"get":{"tags":["people"],"summary":"Employee with profile (sensitive fields masked)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"put":{"tags":["people"],"summary":"Update an employee and profile","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"department":{"type":["string","null"]},"position":{"type":["string","null"]},"managerId":{"type":["string","null"],"format":"uuid"},"workLocationId":{"type":["string","null"],"format":"uuid"},"userId":{"type":["string","null"],"format":"uuid"},"startDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"externalRef":{"type":["string","null"]},"active":{"type":"boolean"},"profile":{"type":"object","properties":{"employmentType":{"type":"string","enum":["permanent","fixed_term","probation","part_time"]},"startDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"probationEnd":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"payCalendar":{"type":"string"},"region":{"type":["string","null"]},"language":{"type":["string","null"]},"attributes":{"type":"object","additionalProperties":{"type":"string"}},"birthDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"gender":{"type":["string","null"]},"marital":{"type":["string","null"]},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"emergencyContact":{"type":["string","null"]},"nik":{"type":["string","null"]},"npwp":{"type":["string","null"]},"bpjsKes":{"type":["string","null"]},"bpjsTk":{"type":["string","null"]},"taxStatus":{"type":["string","null"]},"bank":{"type":["object","null"],"properties":{"bankCode":{"type":"string","minLength":1},"accountNumber":{"type":"string","minLength":1},"holder":{"type":"string","minLength":1}},"required":["bankCode","accountNumber","holder"]}}}},"required":["code","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/employees/{id}/reveal":{"post":{"tags":["people"],"summary":"Reveal sensitive profile fields (audited)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string","enum":["birthDate","gender","marital","address","phone","email","emergencyContact","nik","npwp","bpjsKes","bpjsTk","taxStatus","bank"]},"minItems":1},"purpose":{"type":"string","minLength":1}},"required":["fields","purpose"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/employees/{id}/compensation":{"get":{"tags":["people"],"summary":"Compensation history (audited)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/employees/{id}/leave":{"get":{"tags":["people"],"summary":"Leave balances and requests","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/pay-items":{"get":{"tags":["people"],"summary":"Pay items (statutory ones from the pack)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"put":{"tags":["people"],"summary":"Create or update an organization pay item","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z0-9_]+$"},"name":{"type":"object","additionalProperties":{"type":"string"}},"classification":{"type":"string","enum":["earning","deduction","employer_contribution","tax"]},"taxable":{"type":"boolean","default":false},"contributable":{"type":"boolean","default":false},"role":{"type":["string","null"]},"liabilityRole":{"type":["string","null"]},"method":{"type":"string","enum":["fixed","input","formula","unpaid_leave_deduction","thr"]},"formula":{"type":["string","null"]},"sort":{"type":"integer"},"active":{"type":"boolean"}},"required":["code","name","classification","method"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/pay-calendars":{"get":{"tags":["people"],"summary":"Pay calendars","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"put":{"tags":["people"],"summary":"Create or update a pay calendar","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z0-9_]+$"},"name":{"type":"object","additionalProperties":{"type":"string"}},"frequency":{"type":"string","enum":["monthly","weekly","biweekly"],"default":"monthly"},"payDay":{"type":"integer","minimum":1,"maximum":31,"default":25},"cutoffDay":{"type":"integer","minimum":1,"maximum":31,"default":20},"proration":{"type":"string","enum":["calendar_days","working_days","none"]},"bankAccountId":{"type":["string","null"],"format":"uuid"},"active":{"type":"boolean"}},"required":["code","name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/leave-types":{"get":{"tags":["people"],"summary":"Leave types","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"put":{"tags":["people"],"summary":"Create or update a leave type","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"pattern":"^[a-z0-9_]+$"},"name":{"type":"object","additionalProperties":{"type":"string"}},"paid":{"type":"boolean","default":true},"tracksBalance":{"type":"boolean","default":true},"annualDays":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$","default":"0"},"accrual":{"type":"string","enum":["yearly_upfront","monthly"],"default":"yearly_upfront"},"carryOverMax":{"type":["string","null"],"pattern":"^-?\\d+(\\.\\d+)?$"},"active":{"type":"boolean"}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/pay-runs/{id}/inputs":{"put":{"tags":["people"],"summary":"Set period inputs of a draft pay run (encrypted)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"inputs":{"type":"array","items":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid"},"item":{"type":"string","minLength":1},"amount":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"note":{"type":["string","null"]}},"required":["employeeId","item","amount"]}}},"required":["inputs"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/pay-runs/{id}/recalculate":{"post":{"tags":["people"],"summary":"Recalculate a draft pay run","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/pay-runs/{id}/preview":{"get":{"tags":["people"],"summary":"Preview of the calculated pay run","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/pay-runs/{id}/payslips/{file}":{"get":{"tags":["people"],"summary":"Payslip PDF ({employeeId}.pdf) in the employee's language","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^[0-9a-f-]{36}\\.pdf$/i"},"required":true,"name":"file","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/reports/payroll":{"get":{"tags":["people"],"summary":"Monthly payroll summary by item and employee (statutory style)","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"period","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/reports/payroll.csv":{"get":{"tags":["people"],"summary":"Monthly payroll summary as CSV","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"period","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/leave-calendar":{"get":{"tags":["people"],"summary":"Who is away (leave type only with people.leave.approve)","parameters":[{"schema":{"type":"string"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/leave/accrue":{"post":{"tags":["people"],"summary":"Run the yearly leave accrual (idempotent)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"year":{"type":"integer","minimum":2000,"maximum":2100}},"required":["year"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/profile-requests":{"get":{"tags":["people"],"summary":"Pending profile change requests","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/people/profile-requests/{id}/decide":{"post":{"tags":["people"],"summary":"Approve or reject a profile change request","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approved","rejected"]}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/money/payment-batches/{id}/bank-file":{"get":{"tags":["money"],"summary":"Bank transfer file for a payment batch (pack format)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/me/employee":{"get":{"tags":["me"],"summary":"My employee record (sensitive fields masked)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/me/payslips":{"get":{"tags":["me"],"summary":"My payslips","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/me/payslips/{file}":{"get":{"tags":["me"],"summary":"My payslip PDF ({runId}.pdf)","parameters":[{"schema":{"type":"string","pattern":"^[0-9a-f-]{36}\\.pdf$/i"},"required":true,"name":"file","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/me/leave":{"get":{"tags":["me"],"summary":"My leave balances and requests","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/me/leave-requests":{"post":{"tags":["me"],"summary":"Submit a leave request (goes to approval)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leaveType":{"type":"string","minLength":1},"dates":{"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minItems":1},"days":{"type":"string","pattern":"^\\d+(\\.\\d+)?$"},"reason":{"type":["string","null"]}},"required":["leaveType","dates","days"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/me/profile-requests":{"post":{"tags":["me"],"summary":"Request a profile change (HR approves)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","additionalProperties":{}}},"required":["changes"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/tax/summary":{"get":{"tags":["tax"],"summary":"Output vs input tax and withholding for a period (from the GL)","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"period","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/items/{id}/movements":{"get":{"tags":["goods"],"summary":"Recent stock movements of an item","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":["integer","null"],"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/items/{id}/prices":{"get":{"tags":["goods"],"summary":"Prices of an item on posted price lists","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/projects/{id}/overview":{"get":{"tags":["work"],"summary":"Project with cost, time, milestones and tasks","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/projects":{"get":{"tags":["work"],"summary":"Projects with hours, cost, revenue","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/pipeline":{"get":{"tags":["customers"],"summary":"Open opportunities plus those closed in the last 90 days","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/meta/currencies":{"get":{"tags":["meta"],"summary":"All currencies (for onboarding)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/financial-statements":{"get":{"tags":["reports"],"summary":"Financial statements for an accounting standard (SAK EP, SAK EMKM, SAK Umum, IFRS for SMEs)","parameters":[{"schema":{"type":"string"},"required":false,"name":"standard","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dimensions","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/cash-flow":{"get":{"tags":["reports"],"summary":"Statement of cash flows (indirect method)","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dimensions","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/reports/equity-changes":{"get":{"tags":["reports"],"summary":"Statement of changes in equity","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dimensions","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/tax/withholding":{"get":{"tags":["tax"],"summary":"Withholding register (Bukti Potong) for a period; format=csv gives the Bupot Unifikasi upload file","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"period","in":"query"},{"schema":{"type":"string","enum":["json","csv"]},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/tax/ppn":{"get":{"tags":["tax"],"summary":"PPN summary for a period: output, input, kurang/lebih bayar, DPP and tax invoices to export","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":true,"name":"period","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/compliance/calendar":{"get":{"tags":["tax"],"summary":"Tax and social-security deadlines with the organization's status","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/meta/accounting-standards":{"get":{"tags":["meta"],"summary":"Accounting standards the organization's country pack offers, and the one in use","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/routines":{"get":{"tags":["routines"],"summary":"Monthly routines for a period: steps with due dates, automatic checks, persisted marks and progress","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":false,"name":"period","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/routines/year-end":{"get":{"tags":["routines"],"summary":"Year-end routines for a fiscal year, with the corporate income tax estimate (Indonesia)","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}$"},"required":false,"name":"year","in":"query"},{"schema":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"required":false,"name":"fiscalAdjustments","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/routines/{routine}/{period}/steps/{step}":{"post":{"tags":["routines"],"summary":"Mark a routine step done, skipped or open again","parameters":[{"schema":{"type":"string","pattern":"^[a-z_]+$"},"required":true,"name":"routine","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}(-\\d{2})?$"},"required":true,"name":"period","in":"path"},{"schema":{"type":"string","pattern":"^[a-z0-9_]+$"},"required":true,"name":"step","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","done","skipped"]},"note":{"type":"string","maxLength":2000}},"required":["status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-feeds":{"get":{"tags":["bank"],"summary":"Feed state per bank account (provider, last sync, unmatched lines) and which providers are available","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-accounts/{id}/feed":{"get":{"tags":["bank"],"summary":"The bank account's feed (credentials never returned)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["bank"],"summary":"Connect (or switch) the bank account's feed: csv upload, simulated demo feed or Brick","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["csv","simulated","brick"]},"credentials":{"type":"object","additionalProperties":{}}},"required":["provider"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-accounts/{id}/feed/disconnect":{"post":{"tags":["bank"],"summary":"Disconnect the feed and drop its stored credentials","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-accounts/{id}/feed/sync":{"post":{"tags":["bank"],"summary":"Fetch new statement lines now (idempotent by external id)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-feeds/brick/widget":{"get":{"tags":["bank"],"summary":"Brick widget URL for linking a bank (needs BRICK_CLIENT_ID/SECRET)","parameters":[{"schema":{"type":"string","format":"uri"},"required":true,"name":"redirectUrl","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-accounts/{id}/statements/upload":{"post":{"tags":["bank"],"summary":"Upload a bank export (BCA, Mandiri, BNI, BRI, generic CSV, MT940, OFX). commit=false returns the detected format and a preview; commit=true imports new lines","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":5000000},"filename":{"type":["string","null"],"maxLength":255},"format":{"type":["string","null"],"enum":["bca","mandiri","bni","bri","generic","mt940","ofx",null]},"commit":{"type":"boolean","default":false}},"required":["content"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-accounts/{id}/lines":{"get":{"tags":["bank"],"summary":"Statement lines (unmatched first) with match state, rule hits and the top three suggestions","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["unmatched","matched","all"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-accounts/{id}/code":{"post":{"tags":["bank"],"summary":"Cash coding: post bank transactions for statement lines and match them, in one transaction","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid"},"accountRole":{"type":["string","null"],"minLength":1},"partyId":{"type":["string","null"],"format":"uuid"},"taxCategory":{"type":["string","null"]},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}},"description":{"type":["string","null"],"maxLength":500},"ruleId":{"type":["string","null"],"format":"uuid"},"toBankAccountId":{"type":["string","null"],"format":"uuid"}},"required":["lineId"]},"minItems":1,"maxItems":200}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/statement-lines/{id}/transfer":{"post":{"tags":["bank"],"summary":"Record a statement line as a transfer between own bank accounts (matches the mirror line too)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"toBankAccountId":{"type":["string","null"],"format":"uuid"},"counterpartLineId":{"type":["string","null"],"format":"uuid"},"toAmount":{"type":["string","null"],"pattern":"^\\d+(\\.\\d+)?$"},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/statement-lines/{id}/settle":{"post":{"tags":["bank"],"summary":"Receive or pay an open invoice/bill from a statement line (creates, posts and matches the payment)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid"},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["documentId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-rules":{"get":{"tags":["bank"],"summary":"Bank rules by priority","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["bank"],"summary":"Create a bank rule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"match":{"type":"object","properties":{"direction":{"type":"string","enum":["any","in","out"],"default":"any"},"bankAccountId":{"type":["string","null"],"format":"uuid"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["description","reference","amount"]},"op":{"type":"string","enum":["contains","equals","regex","between"]},"value":{"type":"string","minLength":1,"maxLength":200},"to":{"type":["string","null"],"maxLength":40}},"required":["field","op","value"]},"minItems":1,"maxItems":10}},"required":["conditions"]},"apply":{"type":"object","properties":{"kind":{"type":["string","null"],"enum":["spend","receive","transfer",null]},"accountRole":{"type":["string","null"],"minLength":1},"partyId":{"type":["string","null"],"format":"uuid"},"taxCategory":{"type":["string","null"]},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}},"description":{"type":["string","null"],"maxLength":500},"toBankAccountId":{"type":["string","null"],"format":"uuid"}}},"priority":{"type":"integer","minimum":0,"maximum":10000,"default":100},"active":{"type":"boolean","default":true}},"required":["name","match","apply"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-rules/{id}":{"put":{"tags":["bank"],"summary":"Update a bank rule","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"match":{"type":"object","properties":{"direction":{"type":"string","enum":["any","in","out"],"default":"any"},"bankAccountId":{"type":["string","null"],"format":"uuid"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["description","reference","amount"]},"op":{"type":"string","enum":["contains","equals","regex","between"]},"value":{"type":"string","minLength":1,"maxLength":200},"to":{"type":["string","null"],"maxLength":40}},"required":["field","op","value"]},"minItems":1,"maxItems":10}},"required":["conditions"]},"apply":{"type":"object","properties":{"kind":{"type":["string","null"],"enum":["spend","receive","transfer",null]},"accountRole":{"type":["string","null"],"minLength":1},"partyId":{"type":["string","null"],"format":"uuid"},"taxCategory":{"type":["string","null"]},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}},"description":{"type":["string","null"],"maxLength":500},"toBankAccountId":{"type":["string","null"],"format":"uuid"}}},"priority":{"type":"integer","minimum":0,"maximum":10000,"default":100},"active":{"type":"boolean","default":true}},"required":["name","match","apply"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"delete":{"tags":["bank"],"summary":"Delete a bank rule","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/bank-rules/test":{"post":{"tags":["bank"],"summary":"Which unmatched statement lines a rule would match (dry run, writes nothing)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"match":{"type":"object","properties":{"direction":{"type":"string","enum":["any","in","out"],"default":"any"},"bankAccountId":{"type":["string","null"],"format":"uuid"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["description","reference","amount"]},"op":{"type":"string","enum":["contains","equals","regex","between"]},"value":{"type":"string","minLength":1,"maxLength":200},"to":{"type":["string","null"],"maxLength":40}},"required":["field","op","value"]},"minItems":1,"maxItems":10}},"required":["conditions"]}},"required":["match"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/suppliers":{"get":{"tags":["suppliers"],"summary":"Suppliers with open payable, overdue, last bill, YTD purchases and bill count","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/suppliers/open-bills":{"get":{"tags":["suppliers"],"summary":"Open bills across suppliers, optionally due on or before a date","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"dueBefore","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"partyId","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/suppliers/pay/preview":{"post":{"tags":["suppliers"],"summary":"Preview a supplier payment run: withholding and net transfer per supplier (writes nothing)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","format":"uuid"},"docDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"lines":{"type":"array","items":{"type":"object","properties":{"billId":{"type":"string","format":"uuid"},"amount":{"type":"string","pattern":"^\\d+(\\.\\d+)?$"}},"required":["billId","amount"]},"minItems":1},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}},"memo":{"type":["string","null"],"maxLength":200}},"required":["bankAccountId","docDate","lines"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/suppliers/pay":{"post":{"tags":["suppliers"],"summary":"Pay bills: one payment per supplier with the supplier's default withholding, or one payment batch when several suppliers and no withholding","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","format":"uuid"},"docDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"lines":{"type":"array","items":{"type":"object","properties":{"billId":{"type":"string","format":"uuid"},"amount":{"type":"string","pattern":"^\\d+(\\.\\d+)?$"}},"required":["billId","amount"]},"minItems":1},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}},"memo":{"type":["string","null"],"maxLength":200}},"required":["bankAccountId","docDate","lines"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/suppliers/bank-file":{"get":{"tags":["suppliers"],"summary":"Bank transfer file (pack format) for supplier payments or a supplier payment batch","parameters":[{"schema":{"type":"string","minLength":36},"required":true,"name":"documents","in":"query"},{"schema":{"type":"string"},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/suppliers/{id}":{"get":{"tags":["suppliers"],"summary":"Supplier profile, settings, open bills, orders, payments, withholding history and statement","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/suppliers/{id}/settings":{"put":{"tags":["suppliers"],"summary":"Supplier defaults: terms, withholding, expense account, bank details","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supplierTermsDays":{"type":["integer","null"],"minimum":0,"maximum":365},"defaultWithholdingKind":{"type":["string","null"],"minLength":1},"defaultExpenseRole":{"type":["string","null"],"minLength":1},"bankName":{"type":["string","null"],"maxLength":120},"bankCode":{"type":["string","null"],"maxLength":20},"bankAccountNumber":{"type":["string","null"],"pattern":"^[0-9 -]{4,40}$"},"bankAccountHolder":{"type":["string","null"],"maxLength":160}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/suppliers/{id}/statement":{"get":{"tags":["suppliers"],"summary":"Supplier statement in the supplier's currency (PDF: /v1/reports/statement/{id}/pdf)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/charge":{"get":{"tags":["collect"],"summary":"Charge status, pay link and open amount of an invoice","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["collect"],"summary":"Create (or return) the VA/QRIS charge and pay link of a posted invoice","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/charge/simulate":{"post":{"tags":["collect"],"summary":"Simulated provider only: pay the live charge as if the customer had transferred","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string","pattern":"^\\d+(\\.\\d+)?$"},"channel":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/send":{"post":{"tags":["collect"],"summary":"Send a posted document by email (Resend) or prepare a WhatsApp link, with the pay link","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["email","whatsapp"]},"to":{"type":["string","null"],"maxLength":200},"message":{"type":["string","null"],"maxLength":4000}},"required":["channel"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/sends":{"get":{"tags":["collect"],"summary":"Send history of a document","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/documents/{id}/record-payment":{"post":{"tags":["collect"],"summary":"Record and post a payment allocated to this invoice or bill","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","format":"uuid"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amount":{"type":"string","pattern":"^\\d+(\\.\\d+)?$"},"bankFee":{"type":["string","null"],"pattern":"^\\d+(\\.\\d+)?$"},"withholding":{"type":["object","null"],"properties":{"kind":{"type":"string"},"base":{"type":"string","pattern":"^\\d+(\\.\\d+)?$"}},"required":["kind","base"]},"reference":{"type":["string","null"],"maxLength":100},"memo":{"type":["string","null"],"maxLength":500}},"required":["bankAccountId","amount"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/capture":{"post":{"tags":["capture"],"summary":"Upload a bill, receipt or Faktur Pajak (image or PDF, ≤ 8 MB; JSON {filename, contentType, dataBase64} or multipart field `file`) and extract it","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"get":{"tags":["capture"],"summary":"Recent captures and whether capture is available","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/capture/{id}":{"get":{"tags":["capture"],"summary":"A capture with its draft bill, supplier match and warnings","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/capture/{id}/file":{"get":{"tags":["capture"],"summary":"The uploaded file","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/capture/{id}/retry":{"post":{"tags":["capture"],"summary":"Run the extraction again (after a failure)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/capture/{id}/totals":{"post":{"tags":["capture"],"summary":"Recompute subtotal, DPP, PPN and total for edited lines (read-only)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"docDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"type":"string","minLength":3,"maxLength":3},"supplierTaxId":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"qty":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"unitPrice":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"discountPct":{"type":["string","null"],"pattern":"^-?\\d+(\\.\\d+)?$"},"taxCategory":{"type":"string","minLength":1}},"required":["qty","unitPrice","taxCategory"]}}},"required":["docDate","currency","lines"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/capture/{id}/convert":{"post":{"tags":["capture"],"summary":"Create the bill from a reviewed capture (draft, or posted with `post: true`)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supplier":{"anyOf":[{"type":"object","properties":{"partyId":{"type":"string","format":"uuid"}},"required":["partyId"]},{"type":"object","properties":{"create":{"type":"object","properties":{"name":{"type":"string","minLength":1},"taxId":{"type":["string","null"]},"address":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"]}},"required":["name"]}},"required":["create"]}]},"docDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"type":"string","minLength":3,"maxLength":3},"invoiceNumber":{"type":["string","null"]},"fakturPajakNumber":{"type":["string","null"]},"notes":{"type":["string","null"]},"dimensions":{"type":"object","additionalProperties":{"type":"string"},"default":{}},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1},"qty":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"unitPrice":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"discountPct":{"type":["string","null"],"pattern":"^-?\\d+(\\.\\d+)?$"},"taxCategory":{"type":"string","minLength":1},"accountRole":{"type":["string","null"]}},"required":["description","qty","unitPrice","taxCategory"]},"minItems":1},"post":{"type":"boolean","default":false}},"required":["supplier","docDate","currency","lines"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/assets/categories":{"get":{"tags":["assets"],"summary":"Asset categories and fiscal depreciation groups of the organization's country pack","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/assets/suggestions":{"get":{"tags":["assets"],"summary":"Posted bill and journal lines on fixed-asset accounts not yet in the register","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/assets/depreciation-runs":{"get":{"tags":["assets"],"summary":"Posted and cancelled depreciation runs","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["assets"],"summary":"Post the depreciation run for a period (skips assets already depreciated or fully depreciated)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"assetIds":{"type":["array","null"],"items":{"type":"string","format":"uuid"}}},"required":["period"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/assets/depreciation-runs/preview":{"get":{"tags":["assets"],"summary":"What a depreciation run for the period would post, per asset","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":false,"name":"period","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/assets":{"get":{"tags":["assets"],"summary":"Fixed-asset register as of a date, reconciled to the general ledger","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"asOf","in":"query"},{"schema":{"type":"string","enum":["active","disposed","all"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["assets"],"summary":"Register an asset (posts an asset_acquisition; posts the cost only when creditRole is given)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":["string","null"],"minLength":1,"maxLength":40},"name":{"type":"object","additionalProperties":{"type":"string"}},"category":{"type":["string","null"]},"fiscalGroup":{"type":["string","null"]},"acquisitionDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"depreciationStart":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"cost":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"},"salvage":{"type":["string","null"],"pattern":"^-?\\d+(\\.\\d+)?$"},"usefulLifeMonths":{"type":["integer","null"],"minimum":1,"maximum":1200},"method":{"type":["string","null"],"enum":["straight_line","declining_balance",null]},"ratePct":{"type":["string","null"],"pattern":"^-?\\d+(\\.\\d+)?$"},"assetAccountId":{"type":["string","null"],"format":"uuid"},"accumulatedAccountId":{"type":["string","null"],"format":"uuid"},"expenseAccountId":{"type":["string","null"],"format":"uuid"},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}},"source":{"type":["object","null"],"properties":{"documentId":{"type":"string","format":"uuid"},"line":{"type":["integer","null"],"minimum":0}},"required":["documentId"]},"creditRole":{"type":["string","null"]},"openingAccumulated":{"type":["string","null"],"pattern":"^-?\\d+(\\.\\d+)?$"},"openingThrough":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}$"},"registrationDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"post":{"type":"boolean","default":true}},"required":["name","acquisitionDate","cost"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/assets/{id}":{"get":{"tags":["assets"],"summary":"Asset with accounts, schedules and history","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/assets/{id}/schedule":{"get":{"tags":["assets"],"summary":"Commercial and fiscal depreciation schedules with the yearly difference","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/assets/{id}/dispose":{"post":{"tags":["assets"],"summary":"Dispose of an asset: remove cost and accumulated depreciation, book proceeds and the gain or loss","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"proceeds":{"type":["string","null"],"pattern":"^-?\\d+(\\.\\d+)?$"},"proceedsRole":{"type":["string","null"]},"reason":{"type":["string","null"],"maxLength":500}},"required":["date"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/budgets":{"get":{"tags":["budgets"],"summary":"Budgets with their size and total","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["budgets"],"summary":"Create a budget for a fiscal year (optionally for a dimension slice)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"fiscalYear":{"type":"integer","minimum":2000,"maximum":2100},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["name","fiscalYear"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/budgets/{id}":{"get":{"tags":["budgets"],"summary":"Budget grid: every income and expense account × the fiscal year's months","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"put":{"tags":["budgets"],"summary":"Rename a budget or change its year or dimensions","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"fiscalYear":{"type":"integer","minimum":2000,"maximum":2100},"dimensions":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["name","fiscalYear"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"delete":{"tags":["budgets"],"summary":"Delete a budget and its lines","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/budgets/{id}/lines":{"put":{"tags":["budgets"],"summary":"Set budget amounts per account and month (replace all, or upsert the given cells)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"replace":{"type":"boolean","default":false},"lines":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"period":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"amount":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}},"required":["accountId","period","amount"]},"maxItems":5000}},"required":["lines"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/budgets/{id}/report":{"get":{"tags":["budgets"],"summary":"Budget vs actual per account per month, with variance, variance % and year to date","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dimensions","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/budgets/{id}/lines.csv":{"get":{"tags":["budgets"],"summary":"Export the budget as CSV: account code, name and twelve months","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["budgets"],"summary":"Import budget lines from CSV or a tab-separated paste (account code, optional name, twelve months)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"csv":{"type":"string","maxLength":2000000},"replace":{"type":"boolean"}},"required":["csv"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/budgets/{id}/copy-actuals":{"post":{"tags":["budgets"],"summary":"Fill the budget from last year's actuals, optionally with an uplift percentage","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"upliftPct":{"type":["string","null"],"pattern":"^-?\\d+(\\.\\d+)?$"},"fromYear":{"type":["integer","null"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/import/templates/{entity}":{"get":{"tags":["import"],"summary":"Download an import template (Indonesian headers and an example row)","parameters":[{"schema":{"type":"string","enum":["accounts","contacts","items","opening_balances","invoices","bills","fixed_assets","employees"]},"required":true,"name":"entity","in":"path"},{"schema":{"type":"string","enum":["csv","xlsx"]},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/import/jobs":{"post":{"tags":["import"],"summary":"Upload one file: detect source and entity, preview 20 rows, suggest a column mapping","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":200},"dataBase64":{"type":"string","minLength":1},"source":{"type":["string","null"],"enum":["jurnal","accurate","template",null]},"entity":{"type":["string","null"],"enum":["accounts","contacts","items","opening_balances","invoices","bills","fixed_assets","employees",null]},"options":{"type":"object","properties":{"conversionDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"onlyValid":{"type":"boolean"},"defaultRole":{"type":["string","null"],"enum":["customer","supplier","both",null]},"skipControlAccounts":{"type":"boolean"},"createMissingContacts":{"type":"boolean"}}}},"required":["filename","dataBase64"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}},"get":{"tags":["import"],"summary":"Import job history with post-import checks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/import/jobs/{id}/mapping":{"put":{"tags":["import"],"summary":"Set the column mapping (and optionally entity, source, options)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}},"entity":{"type":"string","enum":["accounts","contacts","items","opening_balances","invoices","bills","fixed_assets","employees"]},"source":{"type":"string","enum":["jurnal","accurate","template"]},"options":{"type":"object","properties":{"conversionDate":{"type":["string","null"],"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"onlyValid":{"type":"boolean"},"defaultRole":{"type":["string","null"],"enum":["customer","supplier","both",null]},"skipControlAccounts":{"type":"boolean"},"createMissingContacts":{"type":"boolean"}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/import/jobs/{id}/validate":{"post":{"tags":["import"],"summary":"Validate every row; returns counts and the first 200 rows with issues","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/import/jobs/{id}/run":{"post":{"tags":["import"],"summary":"Import the job in one transaction (idempotent by source reference)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/import/jobs/{id}":{"get":{"tags":["import"],"summary":"One import job with a page of its rows","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","enum":["0","1"]},"required":false,"name":"issues","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error with a stable code","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"webhooks":{}}