{"openapi":"3.0.3","info":{"title":"BizCARE Books Developer API","description":"Developer API for external integrations. Protected by organization API key (X-Api-Key).","version":"1.0.0"},"servers":[{"url":"https://api.bizcare.my","description":"Production"}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Organization API key (prefix: biz_)."}},"schemas":{}},"security":[{"apiKey":[]}],"paths":{"/healthz":{"get":{"operationId":"getHealthz"}},"/readyz":{"get":{"operationId":"getReadyz"}},"/internal/v1/malware-scan":{"post":{"summary":"Pilot HTTP malware scan (EICAR content gate)","tags":["Internal"],"operationId":"postInternalV1Malware-scan"}},"/mcp":{"get":{"operationId":"allMcp"},"post":{"operationId":"allMcp"},"put":{"operationId":"allMcp"},"delete":{"operationId":"allMcp"},"patch":{"operationId":"allMcp"},"head":{"operationId":"allMcp"},"options":{"operationId":"allMcp"},"trace":{"operationId":"allMcp"}},"/api/_jomcare/silent":{"get":{"operationId":"getApi_jomcareSilent"}},"/api/_jomcare/select-account":{"get":{"operationId":"getApi_jomcareSelect-account"}},"/api/_jomcare/reauth":{"get":{"operationId":"getApi_jomcareReauth"}},"/api/v1/health":{"get":{"summary":"Health check","tags":["Health"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"status":{"type":"string","const":"ok"}},"required":["status"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Health"}},"/api/v1/companies":{"get":{"summary":"Get company","description":"Returns the caller's company. `monthlyConsolidationDay` is returned as stored; a null value means the default, day 7 (the LHDN deadline), so monthly consolidation always runs: on that day of each month Books consolidates the previous month's pending-finalize invoices.","tags":["Companies"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tinCode":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"sstRegistrationNumber":{"type":["string","null"]},"tourismTaxRegistrationNumber":{"type":["string","null"]},"businessActivityDescription":{"type":["string","null"]},"msicCode":{"type":["string","null"]},"businessType":{"anyOf":[{"type":"string","enum":["retail","healthcare","education","technology","finance","manufacturing","services","other"]},{"type":"null"}]},"monthlyConsolidationDay":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"country":{"type":["string","null"]},"state":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"bankAccount":{"type":["string","null"]},"exporterCertifiedNumber":{"type":["string","null"]},"defaultTaxTypesAndRates":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"factorType":{"type":"string","enum":["percentage","ratePerUnit"]},"taxRate":{"type":"number"},"taxType":{"type":"string"}},"required":["factorType","taxRate","taxType"],"additionalProperties":false}},{"type":"null"}]},"setting":{"anyOf":[{"type":"object","properties":{"AUTO_SUBMIT_INVOICE":{"type":"boolean"},"INVOICE_PREFIX":{"type":"string"},"CREDIT_NOTE_PREFIX":{"type":"string"},"DEBIT_NOTE_PREFIX":{"type":"string"},"REFUND_NOTE_PREFIX":{"type":"string"},"PREFIX_DIGIT_COUNT":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"asBuyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string","enum":["LOCAL_INDIVIDUAL","LOCAL_EXEMPTED_ENTITY","LOCAL_BUSINESS_AGENT_DEALER_DISTRIBUTOR","FOREIGNER_BUSINESS","FOREIGNER_INDIVIDUAL"]},"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","sstRegistrationNumber","tin"],"additionalProperties":false},"asSupplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string","enum":["LOCAL_INDIVIDUAL","LOCAL_EXEMPTED_ENTITY","LOCAL_BUSINESS_AGENT_DEALER_DISTRIBUTOR","FOREIGNER_BUSINESS","FOREIGNER_INDIVIDUAL"]},"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"},"msic":{"type":"string"},"businessActivityDescription":{"type":"string"},"bankAccount":{"type":"string"},"exporterCertifiedNumber":{"type":"string"}},"required":["address","contactNumber","name","partyType","registrationNumber","registrationType","sstRegistrationNumber","tin","msic","businessActivityDescription"],"additionalProperties":false},"isCompanyReady":{"type":"boolean"},"activeEnvironment":{"type":"string","enum":["live","test"]},"hasActiveEnvironmentCredentials":{"type":"boolean"},"credentials":{"type":"object","properties":{"live":{"oneOf":[{"type":"object","properties":{"configured":{"type":"boolean","const":false},"expiresAt":{"type":"null"}},"required":["configured","expiresAt"],"additionalProperties":false},{"type":"object","properties":{"configured":{"type":"boolean","const":true},"expiresAt":{"type":["string","null"]}},"required":["configured","expiresAt"],"additionalProperties":false}]},"test":{"oneOf":[{"type":"object","properties":{"configured":{"type":"boolean","const":false},"expiresAt":{"type":"null"}},"required":["configured","expiresAt"],"additionalProperties":false},{"type":"object","properties":{"configured":{"type":"boolean","const":true},"expiresAt":{"type":["string","null"]}},"required":["configured","expiresAt"],"additionalProperties":false}]}},"required":["live","test"],"additionalProperties":false}},"required":["id","name","tinCode","registrationNumber","registrationType","sstRegistrationNumber","tourismTaxRegistrationNumber","businessActivityDescription","msicCode","businessType","monthlyConsolidationDay","country","state","zipCode","city","address","phone","email","bankAccount","exporterCertifiedNumber","defaultTaxTypesAndRates","setting","createdAt","updatedAt","asBuyer","asSupplier","isCompanyReady","activeEnvironment","hasActiveEnvironmentCredentials","credentials"],"additionalProperties":false},{"type":"null"}]},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Companies"},"put":{"summary":"Update company","tags":["Companies"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"address":{"type":"string"},"businessActivityDescription":{"type":"string"},"businessType":{"type":"string","enum":["retail","healthcare","education","technology","finance","manufacturing","services","other"]},"city":{"type":"string"},"preprodClientId":{"type":"string"},"preprodClientSecret":{"type":"string"},"prodClientId":{"type":"string"},"prodClientSecret":{"type":"string"},"country":{"type":"string"},"defaultTaxTypesAndRates":{"type":"array","items":{"type":"object","properties":{"factorType":{"type":"string","enum":["percentage","ratePerUnit"]},"taxRate":{"type":"number"},"taxType":{"type":"string"}},"required":["factorType","taxRate","taxType"],"additionalProperties":false}},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"monthlyConsolidationDay":{"type":"integer","minimum":1,"maximum":7},"msicCode":{"type":"string"},"name":{"type":"string","minLength":1},"phone":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"activeEnvironment":{"type":"string","enum":["live","test"]},"scope":{"type":"string"},"setting":{"type":"object","properties":{"AUTO_SUBMIT_INVOICE":{"type":"boolean"},"CONSOLIDATE_CREDIT_NOTE_PREFIX":{"type":"string"},"CONSOLIDATE_DEBIT_NOTE_PREFIX":{"type":"string"},"CONSOLIDATE_INVOICE_PREFIX":{"type":"string"},"CONSOLIDATE_REFUND_NOTE_PREFIX":{"type":"string"},"CREDIT_NOTE_PREFIX":{"type":"string"},"DEBIT_NOTE_PREFIX":{"type":"string"},"INVOICE_PREFIX":{"type":"string"},"PREFIX_DIGIT_COUNT":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"REFUND_NOTE_PREFIX":{"type":"string"},"SELF_BILLED_CREDIT_NOTE_PREFIX":{"type":"string"},"SELF_BILLED_DEBIT_NOTE_PREFIX":{"type":"string"},"SELF_BILLED_INVOICE_PREFIX":{"type":"string"},"SELF_BILLED_REFUND_NOTE_PREFIX":{"type":"string"}},"additionalProperties":false},"sstRegistrationNumber":{"type":"string"},"state":{"type":"string"},"tinCode":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"},"zipCode":{"type":"string"}},"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"address":{"type":"string"},"businessActivityDescription":{"type":"string"},"businessType":{"type":"string","enum":["retail","healthcare","education","technology","finance","manufacturing","services","other"]},"city":{"type":"string"},"preprodClientId":{"type":"string"},"preprodClientSecret":{"type":"string"},"prodClientId":{"type":"string"},"prodClientSecret":{"type":"string"},"country":{"type":"string"},"defaultTaxTypesAndRates":{"type":"array","items":{"type":"object","properties":{"factorType":{"type":"string","enum":["percentage","ratePerUnit"]},"taxRate":{"type":"number"},"taxType":{"type":"string"}},"required":["factorType","taxRate","taxType"],"additionalProperties":false}},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"monthlyConsolidationDay":{"type":"integer","minimum":1,"maximum":7},"msicCode":{"type":"string"},"name":{"type":"string","minLength":1},"phone":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"activeEnvironment":{"type":"string","enum":["live","test"]},"scope":{"type":"string"},"setting":{"type":"object","properties":{"AUTO_SUBMIT_INVOICE":{"type":"boolean"},"CONSOLIDATE_CREDIT_NOTE_PREFIX":{"type":"string"},"CONSOLIDATE_DEBIT_NOTE_PREFIX":{"type":"string"},"CONSOLIDATE_INVOICE_PREFIX":{"type":"string"},"CONSOLIDATE_REFUND_NOTE_PREFIX":{"type":"string"},"CREDIT_NOTE_PREFIX":{"type":"string"},"DEBIT_NOTE_PREFIX":{"type":"string"},"INVOICE_PREFIX":{"type":"string"},"PREFIX_DIGIT_COUNT":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"REFUND_NOTE_PREFIX":{"type":"string"},"SELF_BILLED_CREDIT_NOTE_PREFIX":{"type":"string"},"SELF_BILLED_DEBIT_NOTE_PREFIX":{"type":"string"},"SELF_BILLED_INVOICE_PREFIX":{"type":"string"},"SELF_BILLED_REFUND_NOTE_PREFIX":{"type":"string"}},"additionalProperties":false},"sstRegistrationNumber":{"type":"string"},"state":{"type":"string"},"tinCode":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"},"zipCode":{"type":"string"}},"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"address":{"type":"string"},"businessActivityDescription":{"type":"string"},"businessType":{"type":"string","enum":["retail","healthcare","education","technology","finance","manufacturing","services","other"]},"city":{"type":"string"},"preprodClientId":{"type":"string"},"preprodClientSecret":{"type":"string"},"prodClientId":{"type":"string"},"prodClientSecret":{"type":"string"},"country":{"type":"string"},"defaultTaxTypesAndRates":{"type":"array","items":{"type":"object","properties":{"factorType":{"type":"string","enum":["percentage","ratePerUnit"]},"taxRate":{"type":"number"},"taxType":{"type":"string"}},"required":["factorType","taxRate","taxType"],"additionalProperties":false}},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"monthlyConsolidationDay":{"type":"integer","minimum":1,"maximum":7},"msicCode":{"type":"string"},"name":{"type":"string","minLength":1},"phone":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"activeEnvironment":{"type":"string","enum":["live","test"]},"scope":{"type":"string"},"setting":{"type":"object","properties":{"AUTO_SUBMIT_INVOICE":{"type":"boolean"},"CONSOLIDATE_CREDIT_NOTE_PREFIX":{"type":"string"},"CONSOLIDATE_DEBIT_NOTE_PREFIX":{"type":"string"},"CONSOLIDATE_INVOICE_PREFIX":{"type":"string"},"CONSOLIDATE_REFUND_NOTE_PREFIX":{"type":"string"},"CREDIT_NOTE_PREFIX":{"type":"string"},"DEBIT_NOTE_PREFIX":{"type":"string"},"INVOICE_PREFIX":{"type":"string"},"PREFIX_DIGIT_COUNT":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"REFUND_NOTE_PREFIX":{"type":"string"},"SELF_BILLED_CREDIT_NOTE_PREFIX":{"type":"string"},"SELF_BILLED_DEBIT_NOTE_PREFIX":{"type":"string"},"SELF_BILLED_INVOICE_PREFIX":{"type":"string"},"SELF_BILLED_REFUND_NOTE_PREFIX":{"type":"string"}},"additionalProperties":false},"sstRegistrationNumber":{"type":"string"},"state":{"type":"string"},"tinCode":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"},"zipCode":{"type":"string"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tinCode":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"sstRegistrationNumber":{"type":["string","null"]},"tourismTaxRegistrationNumber":{"type":["string","null"]},"businessActivityDescription":{"type":["string","null"]},"msicCode":{"type":["string","null"]},"businessType":{"anyOf":[{"type":"string","enum":["retail","healthcare","education","technology","finance","manufacturing","services","other"]},{"type":"null"}]},"monthlyConsolidationDay":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"country":{"type":["string","null"]},"state":{"type":["string","null"]},"zipCode":{"type":["string","null"]},"city":{"type":["string","null"]},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"bankAccount":{"type":["string","null"]},"exporterCertifiedNumber":{"type":["string","null"]},"defaultTaxTypesAndRates":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"factorType":{"type":"string","enum":["percentage","ratePerUnit"]},"taxRate":{"type":"number"},"taxType":{"type":"string"}},"required":["factorType","taxRate","taxType"],"additionalProperties":false}},{"type":"null"}]},"setting":{"anyOf":[{"type":"object","properties":{"AUTO_SUBMIT_INVOICE":{"type":"boolean"},"INVOICE_PREFIX":{"type":"string"},"CREDIT_NOTE_PREFIX":{"type":"string"},"DEBIT_NOTE_PREFIX":{"type":"string"},"REFUND_NOTE_PREFIX":{"type":"string"},"PREFIX_DIGIT_COUNT":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"asBuyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string","enum":["LOCAL_INDIVIDUAL","LOCAL_EXEMPTED_ENTITY","LOCAL_BUSINESS_AGENT_DEALER_DISTRIBUTOR","FOREIGNER_BUSINESS","FOREIGNER_INDIVIDUAL"]},"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","sstRegistrationNumber","tin"],"additionalProperties":false},"asSupplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string","enum":["LOCAL_INDIVIDUAL","LOCAL_EXEMPTED_ENTITY","LOCAL_BUSINESS_AGENT_DEALER_DISTRIBUTOR","FOREIGNER_BUSINESS","FOREIGNER_INDIVIDUAL"]},"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"},"msic":{"type":"string"},"businessActivityDescription":{"type":"string"},"bankAccount":{"type":"string"},"exporterCertifiedNumber":{"type":"string"}},"required":["address","contactNumber","name","partyType","registrationNumber","registrationType","sstRegistrationNumber","tin","msic","businessActivityDescription"],"additionalProperties":false},"isCompanyReady":{"type":"boolean"},"activeEnvironment":{"type":"string","enum":["live","test"]},"hasActiveEnvironmentCredentials":{"type":"boolean"},"credentials":{"type":"object","properties":{"live":{"oneOf":[{"type":"object","properties":{"configured":{"type":"boolean","const":false},"expiresAt":{"type":"null"}},"required":["configured","expiresAt"],"additionalProperties":false},{"type":"object","properties":{"configured":{"type":"boolean","const":true},"expiresAt":{"type":["string","null"]}},"required":["configured","expiresAt"],"additionalProperties":false}]},"test":{"oneOf":[{"type":"object","properties":{"configured":{"type":"boolean","const":false},"expiresAt":{"type":"null"}},"required":["configured","expiresAt"],"additionalProperties":false},{"type":"object","properties":{"configured":{"type":"boolean","const":true},"expiresAt":{"type":["string","null"]}},"required":["configured","expiresAt"],"additionalProperties":false}]}},"required":["live","test"],"additionalProperties":false}},"required":["id","name","tinCode","registrationNumber","registrationType","sstRegistrationNumber","tourismTaxRegistrationNumber","businessActivityDescription","msicCode","businessType","monthlyConsolidationDay","country","state","zipCode","city","address","phone","email","bankAccount","exporterCertifiedNumber","defaultTaxTypesAndRates","setting","createdAt","updatedAt","asBuyer","asSupplier","isCompanyReady","activeEnvironment","hasActiveEnvironmentCredentials","credentials"],"additionalProperties":false},{"type":"null"}]},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"putApiV1Companies"}},"/api/v1/companies/credential-status":{"get":{"summary":"Per-environment credential completeness","tags":["Companies"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"activeEnvironment":{"type":"string","enum":["test","live"]},"test":{"type":"boolean"},"live":{"type":"boolean"}},"required":["activeEnvironment","test","live"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1CompaniesCredential-status"}},"/api/v1/companies/consolidate-now":{"post":{"summary":"Run monthly consolidation for the current company immediately (ops trigger)","tags":["Consolidated Invoices"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"companyId":{"type":"string"},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"submitted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errors":{"type":"array","items":{"type":"string"}}},"required":["companyId","created","submitted","skipped","errors"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1CompaniesConsolidate-now"}},"/api/v1/reference/msic":{"get":{"summary":"Search MSIC codes","tags":["Reference"],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"perPage","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"Code":{"type":"string"},"Description":{"type":"string"},"MSIC Category Reference":{"type":"string"}},"required":["Code","Description","MSIC Category Reference"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data","total","page","perPage"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1ReferenceMsic"}},"/api/v1/validation/tin":{"post":{"summary":"Validate TIN","tags":["Validation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"tin":{"type":"string"}},"required":["registrationType"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"tin":{"type":"string"}},"required":["registrationType"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"tin":{"type":"string"}},"required":["registrationType"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"valid":{"type":"boolean"}},"required":["valid"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"502":{"description":"Response for status 502","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1ValidationTin"}},"/api/v1/validation/onboarding-credentials":{"post":{"summary":"Validate onboarding credentials","tags":["Validation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"tin":{"type":"string"}},"required":["registrationType"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"tin":{"type":"string"}},"required":["registrationType"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"registrationNumber":{"type":"string"},"registrationType":{"type":"string","enum":["BRN","NRIC","PASSPORT","ARMY"]},"tin":{"type":"string"}},"required":["registrationType"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"valid":{"type":"boolean"}},"required":["valid"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1ValidationOnboarding-credentials"}},"/api/v1/validation/company-name":{"post":{"summary":"Check company name availability","tags":["Validation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"available":{"type":"boolean"}},"required":["available"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1ValidationCompany-name"}},"/api/v1/validation/invoice-code":{"post":{"summary":"Check invoice code availability","tags":["Validation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceId":{"type":"string"},"invoiceType":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]}},"required":["invoiceCode","invoiceType"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceId":{"type":"string"},"invoiceType":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]}},"required":["invoiceCode","invoiceType"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceId":{"type":"string"},"invoiceType":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]}},"required":["invoiceCode","invoiceType"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"available":{"type":"boolean"}},"required":["available"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1ValidationInvoice-code"}},"/api/v1/validation/adjustment-note-code":{"post":{"summary":"Check adjustment note code availability","tags":["Validation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"adjustmentNoteId":{"type":"string"},"adjustmentNoteType":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},"required":["adjustmentNoteCode","adjustmentNoteType"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"adjustmentNoteId":{"type":"string"},"adjustmentNoteType":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},"required":["adjustmentNoteCode","adjustmentNoteType"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"adjustmentNoteId":{"type":"string"},"adjustmentNoteType":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},"required":["adjustmentNoteCode","adjustmentNoteType"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"available":{"type":"boolean"}},"required":["available"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1ValidationAdjustment-note-code"}},"/api/v1/credentials/availability":{"get":{"summary":"Check pre-register credential availability","tags":["Credentials"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"available":{"type":"boolean"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["available","count"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1CredentialsAvailability"}},"/api/v1/usage":{"get":{"summary":"Get current usage and quota for the active plan","tags":["Usage"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"currentUsage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"planName":{"type":"string"},"allowed":{"type":"boolean"},"environment":{"type":"string","enum":["test","live"]}},"required":["currentUsage","limit","planName","allowed","environment"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Usage"}},"/api/v1/usage/event":{"post":{"summary":"Record a usage event","tags":["Usage"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"action":{"type":"string","enum":["CREATE_INVOICE","CREATE_ADJUSTMENT_NOTE","CANCEL_INVOICE"]}},"required":["action"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"action":{"type":"string","enum":["CREATE_INVOICE","CREATE_ADJUSTMENT_NOTE","CANCEL_INVOICE"]}},"required":["action"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"action":{"type":"string","enum":["CREATE_INVOICE","CREATE_ADJUSTMENT_NOTE","CANCEL_INVOICE"]}},"required":["action"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"recorded":{"type":"boolean"}},"required":["recorded"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1UsageEvent"}},"/api/v1/invoices":{"get":{"summary":"List invoices","description":"Newest first, in the API key's environment. Filters combine with AND; unknown query parameters are ignored. `status` matches the `status` field returned on each invoice; `date_from` / `date_to` are inclusive yyyy-mm-dd bounds on `invoiceDateTime.date`. Each invoice carries `latestSubmission` (LHDN uuid, long id, status and rejection reason), loaded in one batch for the page.","tags":["Invoices"],"parameters":[{"name":"page","in":"query","required":true,"schema":{"default":1,"description":"1-based page number","type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"per_page","in":"query","required":true,"schema":{"default":10,"description":"Page size (1-1000, default 10)","type":"integer","minimum":1,"maximum":1000}},{"name":"status","in":"query","required":false,"schema":{"description":"Exact match on the invoice `status` returned by the API: Draft, Pending (ready, never submitted), Submitted, Valid, Invalid, Cancelled, or AWAIT_SUBMISSION_TO_LHDN (folded into a consolidated invoice not yet submitted).","type":"string","enum":["Draft","Pending","Submitted","Valid","Invalid","Cancelled","AWAIT_SUBMISSION_TO_LHDN"]}},{"name":"type","in":"query","required":false,"schema":{"description":"Exact match on the invoice `type`.","type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE","CONSOLIDATED_INVOICE","CONSOLIDATED_SELF_BILLED_INVOICE"]}},{"name":"search","in":"query","required":false,"schema":{"description":"Case-insensitive substring match on the invoice code (with prefix) or the buyer name.","type":"string"}},{"name":"date_from","in":"query","required":false,"schema":{"description":"Inclusive lower bound on the invoice date (`invoiceDateTime.date`), yyyy-mm-dd, a Malaysian civil date.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"date_to","in":"query","required":false,"schema":{"description":"Inclusive upper bound on the invoice date (`invoiceDateTime.date`), yyyy-mm-dd, a Malaysian civil date.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"invoiceCode","in":"query","required":false,"schema":{"description":"Exact match on the numeric `invoiceCode` (not the prefixed string).","type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"externalId","in":"query","required":false,"schema":{"description":"Exact match on `externalId` (your own record reference).","type":"string","minLength":1}},{"name":"externalIdPlatform","in":"query","required":false,"schema":{"description":"Exact match on `externalIdPlatform` (e.g. shopify).","type":"string","minLength":1}},{"name":"consolidatedInvoiceId","in":"query","required":false,"schema":{"description":"Only invoices folded into this consolidated invoice (its id).","type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"consolidatedInvoiceId":{"type":["string","null"]},"isSubmittedToLhdn":{"type":"boolean"},"isReady":{"type":"boolean"},"invoiceCode":{"type":"number"},"externalId":{"type":["string","null"]},"externalIdPlatform":{"type":["string","null"]},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE","CONSOLIDATED_INVOICE","CONSOLIDATED_SELF_BILLED_INVOICE"]},"invoiceCodeWithPrefixAndDigits":{"type":"string"},"billingReferenceNumber":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"buyer":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},{"type":"null"}]},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string","description":"Issue date, a Malaysian civil date yyyy-mm-dd (ADR 0022; the database refuses any other shape)."},"time":{"type":"string","description":"Issue time as the producer stored it: a Malaysian wall-clock HH:MM:SS, or zoned (HH:MM:SS+08:00 / HH:MM:SSZ). LHDN receives date + time as one UTC instant."}},"required":["date","time"],"additionalProperties":false},"foreignCurrency":{"anyOf":[{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},{"type":"null"}]},"billingPeriod":{"anyOf":[{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},{"type":"null"}]},"prePayment":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},{"type":"null"}]},"invoiceLevelAllowanceCharge":{"anyOf":[{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]},"additionalDocumentReference":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},{"type":"null"}]},"environment":{"type":"string","enum":["live","test"],"description":"LHDN environment this invoice belongs to"},"status":{"type":"string","enum":["Draft","Pending","Submitted","Valid","Invalid","Cancelled","AWAIT_SUBMISSION_TO_LHDN","UNKNOWN"],"description":"Computed from the latest submission: Draft (not ready), Pending (ready, never submitted), Submitted/Valid/Invalid/Cancelled (latest LHDN status), AWAIT_SUBMISSION_TO_LHDN (folded into a consolidated invoice that is not submitted yet). UNKNOWN is a defensive fallback."},"latestSubmission":{"description":"Latest LHDN submission of this invoice's own document; null when never submitted. Omitted where not loaded. An invoice folded into a consolidated invoice has no submission of its own (null); read the consolidated invoice instead.","anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"Submitted-document id"},"uuid":{"description":"LHDN document uuid","type":["string","null"]},"longId":{"description":"LHDN long id (QR / validation URL)","type":["string","null"]},"status":{"type":"string","enum":["Submitted","Valid","Invalid","Cancelled"],"description":"LHDN status of this submission"},"failReason":{"description":"Why LHDN rejected the document (Invalid), when known","type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}],"description":"Structured LHDN rejection details, when known"},"submissionUid":{"description":"LHDN submission (batch) uid this document travelled in","type":["string","null"]},"submittedAt":{"type":"string","description":"When the document was submitted (ISO)"},"updatedAt":{"type":"string","description":"Last status change seen by Books (ISO)"},"cancelledAt":{"description":"When the document was cancelled (ISO), if it was","type":["string","null"]},"cancelReason":{"description":"Cancellation reason","type":["string","null"]}},"required":["id","uuid","longId","status","failReason","failDetails","submissionUid","submittedAt","updatedAt","cancelledAt","cancelReason"],"additionalProperties":false,"description":"Most recent submitted document of this invoice, or null when it was never submitted."},{"type":"null"}]},"legalMonetaryTotal":{"anyOf":[{"type":"object","properties":{"discountValue":{"type":"number"},"excludingTax":{"type":"number"},"feeAmount":{"type":"number"},"includingTax":{"type":"number"},"netAmount":{"type":"number"},"payableAmount":{"type":"number"},"payableRoundingAmount":{"type":"number"}},"required":["discountValue","excludingTax","feeAmount","includingTax","netAmount","payableAmount","payableRoundingAmount"],"additionalProperties":false},{"type":"null"}]},"isTotalExceedOrEqual10k":{"type":"boolean"}},"required":["id","companyId","userId","organizationId","consolidatedInvoiceId","isSubmittedToLhdn","isReady","invoiceCode","externalId","externalIdPlatform","type","invoiceCodeWithPrefixAndDigits","billingReferenceNumber","createdAt","updatedAt","buyer","supplier","lineItems","invoiceDateTime","foreignCurrency","billingPeriod","payment","prePayment","invoiceLevelAllowanceCharge","additionalDocumentReference","environment","status","legalMonetaryTotal","isTotalExceedOrEqual10k"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasNextPage":{"type":"boolean"},"hasPrevPage":{"type":"boolean"}},"required":["page","perPage","total","totalPages","hasNextPage","hasPrevPage"],"additionalProperties":false}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Invoices"},"post":{"summary":"Create invoice","description":"Creates an invoice, optionally submitting it to MyInvois (submitImmediately). Send an `Idempotency-Key` header (1-128 visible ASCII characters) to make retries safe: a repeat request with the same key returns the invoice created by the first request (200, `idempotentReplay: true`, message \"Already created (idempotent replay)\") and never submits again. The key is scoped to your company and LHDN environment (the API key's environment). If the same key is sent with a different body, the existing invoice is returned unchanged; the new body is ignored. Deleting the invoice frees its key. Invoice codes are unique per company for all time (there is no year component); a duplicate code returns 409 `CODE_EXISTS` with `details.invoiceId` pointing at the existing invoice and `details.environment` (`live` or `test`), because codes are unique across both environments: the holder may be in the other one. Deleting an invoice frees its code. `externalId` / `externalIdPlatform` are optional references to the record in your own system; they are stored but not unique. `externalIdPlatform` \"shopify\" (any case) is reserved for the Shopify integration and is rejected with 400 `VALIDATION_ERROR`. 402 `QUOTA_EXCEEDED` carries `details: { currentUsage, limit, planName }`.","tags":["Invoices"],"parameters":[{"name":"idempotency-key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"additionalDocumentReference":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},"billingPeriod":{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},"billingReferenceNumber":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"deliveryDetails":{},"foreignCurrency":{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"invoiceLevelAllowanceCharge":{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},"isReady":{"type":"boolean"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"payment":{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},"prePayment":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},"submitImmediately":{"type":"boolean"},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]},"externalId":{"type":"string","minLength":1,"maxLength":255},"externalIdPlatform":{"type":"string","minLength":1,"maxLength":64}},"required":["invoiceCode","invoiceDateTime","lineItems","type"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"additionalDocumentReference":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},"billingPeriod":{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},"billingReferenceNumber":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"deliveryDetails":{},"foreignCurrency":{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"invoiceLevelAllowanceCharge":{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},"isReady":{"type":"boolean"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"payment":{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},"prePayment":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},"submitImmediately":{"type":"boolean"},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]},"externalId":{"type":"string","minLength":1,"maxLength":255},"externalIdPlatform":{"type":"string","minLength":1,"maxLength":64}},"required":["invoiceCode","invoiceDateTime","lineItems","type"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"additionalDocumentReference":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},"billingPeriod":{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},"billingReferenceNumber":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"deliveryDetails":{},"foreignCurrency":{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"invoiceLevelAllowanceCharge":{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},"isReady":{"type":"boolean"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"payment":{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},"prePayment":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},"submitImmediately":{"type":"boolean"},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]},"externalId":{"type":"string","minLength":1,"maxLength":255},"externalIdPlatform":{"type":"string","minLength":1,"maxLength":64}},"required":["invoiceCode","invoiceDateTime","lineItems","type"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"consolidatedInvoiceId":{"type":["string","null"]},"isSubmittedToLhdn":{"type":"boolean"},"isReady":{"type":"boolean"},"invoiceCode":{"type":"number"},"externalId":{"type":["string","null"]},"externalIdPlatform":{"type":["string","null"]},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE","CONSOLIDATED_INVOICE","CONSOLIDATED_SELF_BILLED_INVOICE"]},"invoiceCodeWithPrefixAndDigits":{"type":"string"},"billingReferenceNumber":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"buyer":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},{"type":"null"}]},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string","description":"Issue date, a Malaysian civil date yyyy-mm-dd (ADR 0022; the database refuses any other shape)."},"time":{"type":"string","description":"Issue time as the producer stored it: a Malaysian wall-clock HH:MM:SS, or zoned (HH:MM:SS+08:00 / HH:MM:SSZ). LHDN receives date + time as one UTC instant."}},"required":["date","time"],"additionalProperties":false},"foreignCurrency":{"anyOf":[{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},{"type":"null"}]},"billingPeriod":{"anyOf":[{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},{"type":"null"}]},"prePayment":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},{"type":"null"}]},"invoiceLevelAllowanceCharge":{"anyOf":[{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]},"additionalDocumentReference":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},{"type":"null"}]},"environment":{"type":"string","enum":["live","test"],"description":"LHDN environment this invoice belongs to"},"status":{"type":"string","enum":["Draft","Pending","Submitted","Valid","Invalid","Cancelled","AWAIT_SUBMISSION_TO_LHDN","UNKNOWN"],"description":"Computed from the latest submission: Draft (not ready), Pending (ready, never submitted), Submitted/Valid/Invalid/Cancelled (latest LHDN status), AWAIT_SUBMISSION_TO_LHDN (folded into a consolidated invoice that is not submitted yet). UNKNOWN is a defensive fallback."},"latestSubmission":{"description":"Latest LHDN submission of this invoice's own document; null when never submitted. Omitted where not loaded. An invoice folded into a consolidated invoice has no submission of its own (null); read the consolidated invoice instead.","anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"Submitted-document id"},"uuid":{"description":"LHDN document uuid","type":["string","null"]},"longId":{"description":"LHDN long id (QR / validation URL)","type":["string","null"]},"status":{"type":"string","enum":["Submitted","Valid","Invalid","Cancelled"],"description":"LHDN status of this submission"},"failReason":{"description":"Why LHDN rejected the document (Invalid), when known","type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}],"description":"Structured LHDN rejection details, when known"},"submissionUid":{"description":"LHDN submission (batch) uid this document travelled in","type":["string","null"]},"submittedAt":{"type":"string","description":"When the document was submitted (ISO)"},"updatedAt":{"type":"string","description":"Last status change seen by Books (ISO)"},"cancelledAt":{"description":"When the document was cancelled (ISO), if it was","type":["string","null"]},"cancelReason":{"description":"Cancellation reason","type":["string","null"]}},"required":["id","uuid","longId","status","failReason","failDetails","submissionUid","submittedAt","updatedAt","cancelledAt","cancelReason"],"additionalProperties":false,"description":"Most recent submitted document of this invoice, or null when it was never submitted."},{"type":"null"}]},"legalMonetaryTotal":{"anyOf":[{"type":"object","properties":{"discountValue":{"type":"number"},"excludingTax":{"type":"number"},"feeAmount":{"type":"number"},"includingTax":{"type":"number"},"netAmount":{"type":"number"},"payableAmount":{"type":"number"},"payableRoundingAmount":{"type":"number"}},"required":["discountValue","excludingTax","feeAmount","includingTax","netAmount","payableAmount","payableRoundingAmount"],"additionalProperties":false},{"type":"null"}]},"isTotalExceedOrEqual10k":{"type":"boolean"},"submitErrorCode":{"type":"string"},"idempotentReplay":{"type":"boolean"}},"required":["id","companyId","userId","organizationId","consolidatedInvoiceId","isSubmittedToLhdn","isReady","invoiceCode","externalId","externalIdPlatform","type","invoiceCodeWithPrefixAndDigits","billingReferenceNumber","createdAt","updatedAt","buyer","supplier","lineItems","invoiceDateTime","foreignCurrency","billingPeriod","payment","prePayment","invoiceLevelAllowanceCharge","additionalDocumentReference","environment","status","legalMonetaryTotal","isTotalExceedOrEqual10k"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1Invoices"}},"/api/v1/invoices/export":{"get":{"summary":"Export all invoices as JSON","tags":["Invoices"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1InvoicesExport"}},"/api/v1/invoices/{id}":{"get":{"summary":"Get invoice","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"consolidatedInvoiceId":{"type":["string","null"]},"isSubmittedToLhdn":{"type":"boolean"},"isReady":{"type":"boolean"},"invoiceCode":{"type":"number"},"externalId":{"type":["string","null"]},"externalIdPlatform":{"type":["string","null"]},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE","CONSOLIDATED_INVOICE","CONSOLIDATED_SELF_BILLED_INVOICE"]},"invoiceCodeWithPrefixAndDigits":{"type":"string"},"billingReferenceNumber":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"buyer":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},{"type":"null"}]},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string","description":"Issue date, a Malaysian civil date yyyy-mm-dd (ADR 0022; the database refuses any other shape)."},"time":{"type":"string","description":"Issue time as the producer stored it: a Malaysian wall-clock HH:MM:SS, or zoned (HH:MM:SS+08:00 / HH:MM:SSZ). LHDN receives date + time as one UTC instant."}},"required":["date","time"],"additionalProperties":false},"foreignCurrency":{"anyOf":[{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},{"type":"null"}]},"billingPeriod":{"anyOf":[{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},{"type":"null"}]},"prePayment":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},{"type":"null"}]},"invoiceLevelAllowanceCharge":{"anyOf":[{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]},"additionalDocumentReference":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},{"type":"null"}]},"environment":{"type":"string","enum":["live","test"],"description":"LHDN environment this invoice belongs to"},"status":{"type":"string","enum":["Draft","Pending","Submitted","Valid","Invalid","Cancelled","AWAIT_SUBMISSION_TO_LHDN","UNKNOWN"],"description":"Computed from the latest submission: Draft (not ready), Pending (ready, never submitted), Submitted/Valid/Invalid/Cancelled (latest LHDN status), AWAIT_SUBMISSION_TO_LHDN (folded into a consolidated invoice that is not submitted yet). UNKNOWN is a defensive fallback."},"latestSubmission":{"description":"Latest LHDN submission of this invoice's own document; null when never submitted. Omitted where not loaded. An invoice folded into a consolidated invoice has no submission of its own (null); read the consolidated invoice instead.","anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"Submitted-document id"},"uuid":{"description":"LHDN document uuid","type":["string","null"]},"longId":{"description":"LHDN long id (QR / validation URL)","type":["string","null"]},"status":{"type":"string","enum":["Submitted","Valid","Invalid","Cancelled"],"description":"LHDN status of this submission"},"failReason":{"description":"Why LHDN rejected the document (Invalid), when known","type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}],"description":"Structured LHDN rejection details, when known"},"submissionUid":{"description":"LHDN submission (batch) uid this document travelled in","type":["string","null"]},"submittedAt":{"type":"string","description":"When the document was submitted (ISO)"},"updatedAt":{"type":"string","description":"Last status change seen by Books (ISO)"},"cancelledAt":{"description":"When the document was cancelled (ISO), if it was","type":["string","null"]},"cancelReason":{"description":"Cancellation reason","type":["string","null"]}},"required":["id","uuid","longId","status","failReason","failDetails","submissionUid","submittedAt","updatedAt","cancelledAt","cancelReason"],"additionalProperties":false,"description":"Most recent submitted document of this invoice, or null when it was never submitted."},{"type":"null"}]},"legalMonetaryTotal":{"anyOf":[{"type":"object","properties":{"discountValue":{"type":"number"},"excludingTax":{"type":"number"},"feeAmount":{"type":"number"},"includingTax":{"type":"number"},"netAmount":{"type":"number"},"payableAmount":{"type":"number"},"payableRoundingAmount":{"type":"number"}},"required":["discountValue","excludingTax","feeAmount","includingTax","netAmount","payableAmount","payableRoundingAmount"],"additionalProperties":false},{"type":"null"}]},"isTotalExceedOrEqual10k":{"type":"boolean"}},"required":["id","companyId","userId","organizationId","consolidatedInvoiceId","isSubmittedToLhdn","isReady","invoiceCode","externalId","externalIdPlatform","type","invoiceCodeWithPrefixAndDigits","billingReferenceNumber","createdAt","updatedAt","buyer","supplier","lineItems","invoiceDateTime","foreignCurrency","billingPeriod","payment","prePayment","invoiceLevelAllowanceCharge","additionalDocumentReference","environment","status","legalMonetaryTotal","isTotalExceedOrEqual10k"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1InvoicesById"},"put":{"summary":"Update invoice","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"additionalDocumentReference":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},"billingPeriod":{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},"billingReferenceNumber":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"deliveryDetails":{},"foreignCurrency":{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"invoiceLevelAllowanceCharge":{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},"isReady":{"type":"boolean"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"payment":{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},"prePayment":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},"submitImmediately":{"type":"boolean"},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]}},"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"additionalDocumentReference":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},"billingPeriod":{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},"billingReferenceNumber":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"deliveryDetails":{},"foreignCurrency":{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"invoiceLevelAllowanceCharge":{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},"isReady":{"type":"boolean"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"payment":{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},"prePayment":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},"submitImmediately":{"type":"boolean"},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]}},"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"additionalDocumentReference":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},"billingPeriod":{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},"billingReferenceNumber":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"deliveryDetails":{},"foreignCurrency":{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"invoiceLevelAllowanceCharge":{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},"isReady":{"type":"boolean"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"payment":{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},"prePayment":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},"submitImmediately":{"type":"boolean"},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"consolidatedInvoiceId":{"type":["string","null"]},"isSubmittedToLhdn":{"type":"boolean"},"isReady":{"type":"boolean"},"invoiceCode":{"type":"number"},"externalId":{"type":["string","null"]},"externalIdPlatform":{"type":["string","null"]},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE","CONSOLIDATED_INVOICE","CONSOLIDATED_SELF_BILLED_INVOICE"]},"invoiceCodeWithPrefixAndDigits":{"type":"string"},"billingReferenceNumber":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"buyer":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},{"type":"null"}]},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string","description":"Issue date, a Malaysian civil date yyyy-mm-dd (ADR 0022; the database refuses any other shape)."},"time":{"type":"string","description":"Issue time as the producer stored it: a Malaysian wall-clock HH:MM:SS, or zoned (HH:MM:SS+08:00 / HH:MM:SSZ). LHDN receives date + time as one UTC instant."}},"required":["date","time"],"additionalProperties":false},"foreignCurrency":{"anyOf":[{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},{"type":"null"}]},"billingPeriod":{"anyOf":[{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},{"type":"null"}]},"prePayment":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},{"type":"null"}]},"invoiceLevelAllowanceCharge":{"anyOf":[{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]},"additionalDocumentReference":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},{"type":"null"}]},"environment":{"type":"string","enum":["live","test"],"description":"LHDN environment this invoice belongs to"},"status":{"type":"string","enum":["Draft","Pending","Submitted","Valid","Invalid","Cancelled","AWAIT_SUBMISSION_TO_LHDN","UNKNOWN"],"description":"Computed from the latest submission: Draft (not ready), Pending (ready, never submitted), Submitted/Valid/Invalid/Cancelled (latest LHDN status), AWAIT_SUBMISSION_TO_LHDN (folded into a consolidated invoice that is not submitted yet). UNKNOWN is a defensive fallback."},"latestSubmission":{"description":"Latest LHDN submission of this invoice's own document; null when never submitted. Omitted where not loaded. An invoice folded into a consolidated invoice has no submission of its own (null); read the consolidated invoice instead.","anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"Submitted-document id"},"uuid":{"description":"LHDN document uuid","type":["string","null"]},"longId":{"description":"LHDN long id (QR / validation URL)","type":["string","null"]},"status":{"type":"string","enum":["Submitted","Valid","Invalid","Cancelled"],"description":"LHDN status of this submission"},"failReason":{"description":"Why LHDN rejected the document (Invalid), when known","type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}],"description":"Structured LHDN rejection details, when known"},"submissionUid":{"description":"LHDN submission (batch) uid this document travelled in","type":["string","null"]},"submittedAt":{"type":"string","description":"When the document was submitted (ISO)"},"updatedAt":{"type":"string","description":"Last status change seen by Books (ISO)"},"cancelledAt":{"description":"When the document was cancelled (ISO), if it was","type":["string","null"]},"cancelReason":{"description":"Cancellation reason","type":["string","null"]}},"required":["id","uuid","longId","status","failReason","failDetails","submissionUid","submittedAt","updatedAt","cancelledAt","cancelReason"],"additionalProperties":false,"description":"Most recent submitted document of this invoice, or null when it was never submitted."},{"type":"null"}]},"legalMonetaryTotal":{"anyOf":[{"type":"object","properties":{"discountValue":{"type":"number"},"excludingTax":{"type":"number"},"feeAmount":{"type":"number"},"includingTax":{"type":"number"},"netAmount":{"type":"number"},"payableAmount":{"type":"number"},"payableRoundingAmount":{"type":"number"}},"required":["discountValue","excludingTax","feeAmount","includingTax","netAmount","payableAmount","payableRoundingAmount"],"additionalProperties":false},{"type":"null"}]},"isTotalExceedOrEqual10k":{"type":"boolean"}},"required":["id","companyId","userId","organizationId","consolidatedInvoiceId","isSubmittedToLhdn","isReady","invoiceCode","externalId","externalIdPlatform","type","invoiceCodeWithPrefixAndDigits","billingReferenceNumber","createdAt","updatedAt","buyer","supplier","lineItems","invoiceDateTime","foreignCurrency","billingPeriod","payment","prePayment","invoiceLevelAllowanceCharge","additionalDocumentReference","environment","status","legalMonetaryTotal","isTotalExceedOrEqual10k"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"putApiV1InvoicesById"},"delete":{"summary":"Delete invoice","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"deleteApiV1InvoicesById"}},"/api/v1/invoices/bulk":{"post":{"summary":"Bulk create invoices","description":"Creates up to 100 invoices with per-item results. With submitImmediately, all created rows are sent as one MyInvois submission; rows that are not ready (e.g. PENDING_FINALIZE types) or already have an active submission are skipped, so submission.accepted may be less than summary.created. Each row may carry an optional `idempotencyKey` (same rules as the Idempotency-Key header on POST /invoices): a replayed row returns status \"created\" with `idempotentReplay: true` and is not submitted again. A row whose invoice code already exists in your company returns code `DUPLICATE_CODE` with `existingInvoiceId`. Quota exhaustion is reported in the 200 body (`submission.error = \"QUOTA_EXCEEDED\"` with `currentUsage`, `limit`, `planName`), not as HTTP 402; the invoices are still created as unsubmitted.","tags":["Invoices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoices":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"additionalDocumentReference":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},"billingPeriod":{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},"billingReferenceNumber":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"deliveryDetails":{},"foreignCurrency":{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"invoiceLevelAllowanceCharge":{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},"isReady":{"type":"boolean"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"payment":{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},"prePayment":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]},"externalId":{"type":"string","minLength":1,"maxLength":255},"externalIdPlatform":{"type":"string","minLength":1,"maxLength":64},"idempotencyKey":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x21-\\x7E]+$"}},"required":["invoiceCode","invoiceDateTime","lineItems","type"],"additionalProperties":false}},"submitImmediately":{"type":"boolean"}},"required":["invoices"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoices":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"additionalDocumentReference":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},"billingPeriod":{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},"billingReferenceNumber":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"deliveryDetails":{},"foreignCurrency":{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"invoiceLevelAllowanceCharge":{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},"isReady":{"type":"boolean"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"payment":{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},"prePayment":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]},"externalId":{"type":"string","minLength":1,"maxLength":255},"externalIdPlatform":{"type":"string","minLength":1,"maxLength":64},"idempotencyKey":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x21-\\x7E]+$"}},"required":["invoiceCode","invoiceDateTime","lineItems","type"],"additionalProperties":false}},"submitImmediately":{"type":"boolean"}},"required":["invoices"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoices":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"additionalDocumentReference":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},"billingPeriod":{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},"billingReferenceNumber":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"deliveryDetails":{},"foreignCurrency":{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},"invoiceCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"invoiceLevelAllowanceCharge":{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},"isReady":{"type":"boolean"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"payment":{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},"prePayment":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"type":{"type":"string","enum":["INVOICE","SELF_BILLED_INVOICE","PENDING_FINALIZE_INVOICE","PENDING_FINALIZE_SELF_BILLED_INVOICE"]},"externalId":{"type":"string","minLength":1,"maxLength":255},"externalIdPlatform":{"type":"string","minLength":1,"maxLength":64},"idempotencyKey":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x21-\\x7E]+$"}},"required":["invoiceCode","invoiceDateTime","lineItems","type"],"additionalProperties":false}},"submitImmediately":{"type":"boolean"}},"required":["invoices"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"results":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","const":"created"},"id":{"type":"string"},"invoiceCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"idempotentReplay":{"type":"boolean"}},"required":["index","status","id","invoiceCode"],"additionalProperties":false},{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","const":"error"},"error":{"type":"string"},"code":{"type":"string"},"existingInvoiceId":{"type":"string"}},"required":["index","status","error","code"],"additionalProperties":false}]}},"submission":{"anyOf":[{"anyOf":[{"type":"object","properties":{"submissionId":{"type":["string","null"]},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"results":{"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string"},"code":{"type":"string"},"outcome":{"type":"string","enum":["accepted","rejected"]},"reason":{"type":"string"},"errorCode":{"type":"string"}},"required":["invoiceId","code","outcome"],"additionalProperties":false}}},"required":["submissionId","accepted","rejected","results"],"additionalProperties":false},{"type":"object","properties":{"error":{"type":"string","const":"QUOTA_EXCEEDED"},"currentUsage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"planName":{"type":"string"}},"required":["error","currentUsage","limit","planName"],"additionalProperties":false},{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error","code"],"additionalProperties":false}]},{"type":"null"}]},"summary":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["total","created","failed"],"additionalProperties":false}},"required":["results","submission","summary"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1InvoicesBulk"}},"/api/v1/invoices/bulk-submit":{"post":{"summary":"Bulk submit selected ready invoices to MyInvois","tags":["Invoices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoiceIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1}}},"required":["invoiceIds"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoiceIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1}}},"required":["invoiceIds"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoiceIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1}}},"required":["invoiceIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"submissionId":{"type":["string","null"]},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"results":{"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string"},"code":{"type":"string"},"outcome":{"type":"string","enum":["accepted","rejected"]},"reason":{"type":"string"},"errorCode":{"type":"string"}},"required":["invoiceId","code","outcome"],"additionalProperties":false}}},"required":["submissionId","accepted","rejected","results"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"502":{"description":"Response for status 502","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1InvoicesBulk-submit"}},"/api/v1/invoices/{id}/submit-to-myinvois":{"post":{"summary":"Submit invoice to MyInvois","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"submissionId":{"type":["string","null"]},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"results":{"type":"array","items":{"type":"object","properties":{"invoiceId":{"type":"string"},"code":{"type":"string"},"outcome":{"type":"string","enum":["accepted","rejected"]},"reason":{"type":"string"},"errorCode":{"type":"string"}},"required":["invoiceId","code","outcome"],"additionalProperties":false}}},"required":["submissionId","accepted","rejected","results"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"502":{"description":"Response for status 502","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1InvoicesByIdSubmit-to-myinvois"}},"/api/v1/invoices/{id}/cancel-latest-invoice-submitted":{"post":{"summary":"Cancel submitted invoice","description":"Cancels the invoice's latest LHDN document. LHDN only allows cancellation within 72 hours of submission; after that the request is refused with 403 `CANCEL_FAILED` and `details: { reason: \"CANCEL_WINDOW_EXPIRED\" }` (issue a credit or refund note instead). Other refusals (never submitted, already cancelled or invalid) are 403 `CANCEL_FAILED` without that reason. Active adjustment notes are cancelled first.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"null"},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1InvoicesByIdCancel-latest-invoice-submitted"}},"/api/v1/invoices/{id}/submitted-documents":{"get":{"summary":"Get invoice submission history","description":"The invoice's submitted documents, newest first (at most 10), in the same shape as `GET /submitted-documents`. The signed UBL and raw LHDN responses are not included; use `GET /invoices/:id/export` for the submitted UBL.","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"documentSubmissionId":{"type":"string"},"invoiceId":{"type":["string","null"]},"adjustmentNoteId":{"type":["string","null"]},"consolidatedInvoiceId":{"type":["string","null"]},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"code":{"type":"string"},"uuid":{"type":["string","null"]},"status":{"type":"string","enum":["Submitted","Cancelled","Valid","Invalid"]},"cancelledBy":{"type":["string","null"]},"cancelledAt":{"type":["string","null"]},"failReason":{"type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}]},"type":{"type":"string"},"cancelReason":{"type":["string","null"]},"longId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"submissionUid":{"type":["string","null"]},"documentDate":{"type":["string","null"]},"buyerName":{"type":["string","null"]},"buyerTin":{"type":["string","null"]},"grandTotal":{"type":["number","null"]}},"required":["id","documentSubmissionId","invoiceId","adjustmentNoteId","consolidatedInvoiceId","companyId","userId","organizationId","code","uuid","status","cancelledBy","cancelledAt","failReason","failDetails","type","cancelReason","longId","createdAt","updatedAt","submissionUid","documentDate","buyerName","buyerTin","grandTotal"],"additionalProperties":false}},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1InvoicesByIdSubmitted-documents"}},"/api/v1/invoices/{id}/export":{"get":{"summary":"Export invoice (incl. submitted UBL)","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1InvoicesByIdExport"}},"/api/v1/invoices/{id}/adjustment-note":{"post":{"summary":"Create adjustment note for invoice","tags":["Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"adjustmentNoteIssueDate":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"isCharge":{"type":"boolean"},"rate":{"type":"number"},"reason":{"type":"string"}},"required":["isCharge","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"targetInvoiceType":{"type":"string"},"type":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},"required":["adjustmentNoteCode","lineItems","type"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"adjustmentNoteIssueDate":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"isCharge":{"type":"boolean"},"rate":{"type":"number"},"reason":{"type":"string"}},"required":["isCharge","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"targetInvoiceType":{"type":"string"},"type":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},"required":["adjustmentNoteCode","lineItems","type"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"adjustmentNoteIssueDate":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"isCharge":{"type":"boolean"},"rate":{"type":"number"},"reason":{"type":"string"}},"required":["isCharge","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"targetInvoiceType":{"type":"string"},"type":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},"required":["adjustmentNoteCode","lineItems","type"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1InvoicesByIdAdjustment-note"}},"/api/v1/adjustment-notes/export":{"get":{"summary":"Export all adjustment notes","tags":["Adjustment Notes"],"operationId":"getApiV1Adjustment-notesExport"}},"/api/v1/adjustment-notes":{"get":{"summary":"List adjustment notes","tags":["Adjustment Notes"],"parameters":[{"name":"page","in":"query","required":true,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"per_page","in":"query","required":true,"schema":{"default":10,"type":"integer","minimum":1,"maximum":1000}},{"name":"view","in":"query","required":true,"schema":{"default":"all","type":"string","enum":["all","needs_action","valid","cancelled"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["Pending","Submitted","Valid","Invalid","Cancelled"]}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"date_to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"invoiceId":{"type":["string","null"]},"consolidatedInvoiceId":{"type":["string","null"]},"code":{"type":"number"},"type":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]},"invoiceCodeWithPrefixAndDigits":{"type":"string"},"issueDate":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"status":{"type":"string"},"buyer":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},{"type":"null"}]},"adjustmentNoteCode":{"type":"number"},"correctedSource":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["invoice","consolidated_invoice"]},"id":{"type":"string"},"code":{"type":"string"}},"required":["kind","id","code"],"additionalProperties":false},{"type":"null"}]},"correctionProof":{"anyOf":[{"type":"object","properties":{"sourceKind":{"type":"string","enum":["invoice","consolidated_invoice"]},"originalTotal":{"type":"number"},"noteEffect":{"type":"number"},"correctedTotal":{"type":"number"}},"required":["sourceKind","originalTotal","noteEffect","correctedTotal"],"additionalProperties":false},{"type":"null"}]},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"legalMonetaryTotal":{"anyOf":[{"type":"object","properties":{"discountValue":{"type":"number"},"excludingTax":{"type":"number"},"feeAmount":{"type":"number"},"includingTax":{"type":"number"},"netAmount":{"type":"number"},"payableAmount":{"type":"number"},"payableRoundingAmount":{"type":"number"}},"required":["excludingTax","includingTax","payableAmount"],"additionalProperties":false},{"type":"null"}]}},"required":["id","companyId","userId","organizationId","invoiceId","consolidatedInvoiceId","code","type","invoiceCodeWithPrefixAndDigits","issueDate","createdAt","updatedAt","lineItems","status","invoiceDateTime"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasNextPage":{"type":"boolean"},"hasPrevPage":{"type":"boolean"}},"required":["page","perPage","total","totalPages","hasNextPage","hasPrevPage"],"additionalProperties":false},"viewCounts":{"type":"object","properties":{"all":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"needs_action":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["all","needs_action","valid","cancelled"],"additionalProperties":false}},"required":["success","data","pagination","viewCounts"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Adjustment-notes"}},"/api/v1/adjustment-notes/{id}":{"get":{"summary":"Get adjustment note","tags":["Adjustment Notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"invoiceId":{"type":["string","null"]},"consolidatedInvoiceId":{"type":["string","null"]},"code":{"type":"number"},"type":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]},"invoiceCodeWithPrefixAndDigits":{"type":"string"},"issueDate":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"status":{"type":"string"},"buyer":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},{"type":"null"}]},"adjustmentNoteCode":{"type":"number"},"correctedSource":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["invoice","consolidated_invoice"]},"id":{"type":"string"},"code":{"type":"string"}},"required":["kind","id","code"],"additionalProperties":false},{"type":"null"}]},"correctionProof":{"anyOf":[{"type":"object","properties":{"sourceKind":{"type":"string","enum":["invoice","consolidated_invoice"]},"originalTotal":{"type":"number"},"noteEffect":{"type":"number"},"correctedTotal":{"type":"number"}},"required":["sourceKind","originalTotal","noteEffect","correctedTotal"],"additionalProperties":false},{"type":"null"}]},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"}},"required":["date","time"],"additionalProperties":false},"legalMonetaryTotal":{"anyOf":[{"type":"object","properties":{"discountValue":{"type":"number"},"excludingTax":{"type":"number"},"feeAmount":{"type":"number"},"includingTax":{"type":"number"},"netAmount":{"type":"number"},"payableAmount":{"type":"number"},"payableRoundingAmount":{"type":"number"}},"required":["excludingTax","includingTax","payableAmount"],"additionalProperties":false},{"type":"null"}]}},"required":["id","companyId","userId","organizationId","invoiceId","consolidatedInvoiceId","code","type","invoiceCodeWithPrefixAndDigits","issueDate","createdAt","updatedAt","lineItems","status","invoiceDateTime"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Adjustment-notesById"},"put":{"summary":"Update adjustment note","tags":["Adjustment Notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteIssueDate":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"isCharge":{"type":"boolean"},"rate":{"type":"number"},"reason":{"type":"string"}},"required":["isCharge","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}}},"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteIssueDate":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"isCharge":{"type":"boolean"},"rate":{"type":"number"},"reason":{"type":"string"}},"required":["isCharge","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}}},"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteIssueDate":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"isCharge":{"type":"boolean"},"rate":{"type":"number"},"reason":{"type":"string"}},"required":["isCharge","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}}},"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"null"},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"putApiV1Adjustment-notesById"},"delete":{"summary":"Delete adjustment note","tags":["Adjustment Notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"deleteApiV1Adjustment-notesById"}},"/api/v1/adjustment-notes/{id}/export":{"get":{"summary":"Export adjustment note (incl. submitted UBL)","tags":["Adjustment Notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{},"additionalProperties":{}},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Adjustment-notesByIdExport"}},"/api/v1/adjustment-notes/{id}/submit-to-myinvois":{"post":{"summary":"Submit adjustment note to MyInvois","tags":["Adjustment Notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"null"},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1Adjustment-notesByIdSubmit-to-myinvois"}},"/api/v1/adjustment-notes/{id}/cancel-latest-adjustment-note-submitted":{"post":{"summary":"Cancel submitted adjustment note","description":"Cancels the note's own LHDN document. LHDN only allows cancellation within 72 hours of submission; after that the request is refused with 403 `CANCEL_FAILED` and `details: { reason: \"CANCEL_WINDOW_EXPIRED\" }`. Other refusals (never submitted, already cancelled or invalid) are 403 `CANCEL_FAILED` without that reason.","tags":["Adjustment Notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"null"},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1Adjustment-notesByIdCancel-latest-adjustment-note-submitted"}},"/api/v1/adjustment-notes/{id}/submitted-documents":{"get":{"summary":"Get adjustment note submission history","tags":["Adjustment Notes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Adjustment-notesByIdSubmitted-documents"}},"/api/v1/consolidated-invoices":{"get":{"summary":"List consolidated invoices","description":"Newest first, in the API key's environment. Optional filters (combined with AND; unknown query parameters are ignored): `status` (Pending, Submitted, Valid, Invalid, Cancelled; matches the `status` field) and `date_from` / `date_to` (inclusive yyyy-mm-dd bounds on `invoiceDateTime.date`). Each item carries `latestSubmission`, loaded in one batch for the page.","tags":["Consolidated Invoices"],"parameters":[{"name":"page","in":"query","required":true,"schema":{"default":1,"description":"1-based page number","type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"per_page","in":"query","required":true,"schema":{"default":10,"description":"Page size (1-1000, default 10)","type":"integer","minimum":1,"maximum":1000}},{"name":"status","in":"query","required":false,"schema":{"description":"Exact match on the consolidated invoice `status` (Pending = not yet submitted to LHDN).","type":"string","enum":["Pending","Submitted","Valid","Invalid","Cancelled"]}},{"name":"date_from","in":"query","required":false,"schema":{"description":"Inclusive lower bound on the invoice date (`invoiceDateTime.date`), yyyy-mm-dd, a Malaysian civil date.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"date_to","in":"query","required":false,"schema":{"description":"Inclusive upper bound on the invoice date (`invoiceDateTime.date`), yyyy-mm-dd, a Malaysian civil date.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"invoiceCode":{"type":"number"},"externalId":{"type":["string","null"]},"type":{"type":"string","enum":["CONSOLIDATED_INVOICE","CONSOLIDATED_SELF_BILLED_INVOICE"]},"invoiceCodeWithPrefixAndDigits":{"type":"string"},"billingReferenceNumber":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string","description":"Issue date, a Malaysian civil date yyyy-mm-dd (ADR 0022; the database refuses any other shape)."},"time":{"type":"string","description":"Issue time as the producer stored it: a Malaysian wall-clock HH:MM:SS, or zoned (HH:MM:SS+08:00 / HH:MM:SSZ). LHDN receives date + time as one UTC instant."}},"required":["date","time"],"additionalProperties":false},"foreignCurrency":{"anyOf":[{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},{"type":"null"}]},"billingPeriod":{"anyOf":[{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},{"type":"null"}]},"prePayment":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},{"type":"null"}]},"invoiceLevelAllowanceCharge":{"anyOf":[{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]},"additionalDocumentReference":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},{"type":"null"}]},"environment":{"type":"string","enum":["live","test"],"description":"LHDN environment this consolidated invoice belongs to"},"status":{"type":"string","enum":["Pending","Submitted","Valid","Invalid","Cancelled"],"description":"Pending until submitted to LHDN, then the LHDN status (a Submitted document wins over later ones while LHDN is still processing)."},"latestSubmission":{"description":"Latest LHDN submission of this consolidated invoice; null when never submitted.","anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"Submitted-document id"},"uuid":{"description":"LHDN document uuid","type":["string","null"]},"longId":{"description":"LHDN long id (QR / validation URL)","type":["string","null"]},"status":{"type":"string","enum":["Submitted","Valid","Invalid","Cancelled"],"description":"LHDN status of this submission"},"failReason":{"description":"Why LHDN rejected the document (Invalid), when known","type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}],"description":"Structured LHDN rejection details, when known"},"submissionUid":{"description":"LHDN submission (batch) uid this document travelled in","type":["string","null"]},"submittedAt":{"type":"string","description":"When the document was submitted (ISO)"},"updatedAt":{"type":"string","description":"Last status change seen by Books (ISO)"},"cancelledAt":{"description":"When the document was cancelled (ISO), if it was","type":["string","null"]},"cancelReason":{"description":"Cancellation reason","type":["string","null"]}},"required":["id","uuid","longId","status","failReason","failDetails","submissionUid","submittedAt","updatedAt","cancelledAt","cancelReason"],"additionalProperties":false,"description":"Most recent submitted document of this invoice, or null when it was never submitted."},{"type":"null"}]},"consolidatedInvoiceCode":{"type":"number"},"legalMonetaryTotal":{"anyOf":[{"type":"object","properties":{"discountValue":{"type":"number"},"excludingTax":{"type":"number"},"feeAmount":{"type":"number"},"includingTax":{"type":"number"},"netAmount":{"type":"number"},"payableAmount":{"type":"number"},"payableRoundingAmount":{"type":"number"}},"required":["excludingTax","includingTax","payableAmount"],"additionalProperties":false},{"type":"null"}]}},"required":["id","companyId","userId","organizationId","invoiceCode","externalId","type","invoiceCodeWithPrefixAndDigits","billingReferenceNumber","createdAt","updatedAt","buyer","supplier","lineItems","invoiceDateTime","foreignCurrency","billingPeriod","payment","prePayment","invoiceLevelAllowanceCharge","additionalDocumentReference","environment","status","consolidatedInvoiceCode","legalMonetaryTotal"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasNextPage":{"type":"boolean"},"hasPrevPage":{"type":"boolean"}},"required":["page","perPage","total","totalPages","hasNextPage","hasPrevPage"],"additionalProperties":false}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Consolidated-invoices"}},"/api/v1/consolidated-invoices/export":{"get":{"summary":"Export all consolidated invoices as JSON","tags":["Consolidated Invoices"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Consolidated-invoicesExport"}},"/api/v1/consolidated-invoices/{id}":{"get":{"summary":"Get consolidated invoice","tags":["Consolidated Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"invoiceCode":{"type":"number"},"externalId":{"type":["string","null"]},"type":{"type":"string","enum":["CONSOLIDATED_INVOICE","CONSOLIDATED_SELF_BILLED_INVOICE"]},"invoiceCodeWithPrefixAndDigits":{"type":"string"},"billingReferenceNumber":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"supplier":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"},"bankAccount":{"type":"string"},"businessActivityDescription":{"type":"string"},"exporterCertifiedNumber":{"type":"string"},"msic":{"type":"string"},"tourismTaxRegistrationNumber":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin","businessActivityDescription","msic"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"invoiceDateTime":{"type":"object","properties":{"date":{"type":"string","description":"Issue date, a Malaysian civil date yyyy-mm-dd (ADR 0022; the database refuses any other shape)."},"time":{"type":"string","description":"Issue time as the producer stored it: a Malaysian wall-clock HH:MM:SS, or zoned (HH:MM:SS+08:00 / HH:MM:SSZ). LHDN receives date + time as one UTC instant."}},"required":["date","time"],"additionalProperties":false},"foreignCurrency":{"anyOf":[{"type":"object","properties":{"currencyCode":{"type":"string"},"currencyExchangeRate":{"type":"number"}},"required":["currencyCode","currencyExchangeRate"],"additionalProperties":false},{"type":"null"}]},"billingPeriod":{"anyOf":[{"type":"object","properties":{"endDate":{"type":"string"},"frequency":{"type":"string"},"startDate":{"type":"string"}},"required":["endDate","frequency","startDate"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string"},"terms":{"type":"string"}},"required":["mode"],"additionalProperties":false},{"type":"null"}]},"prePayment":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"},"referenceNumber":{"type":"string"},"time":{"type":"string"}},"required":["amount","date","referenceNumber","time"],"additionalProperties":false},{"type":"null"}]},"invoiceLevelAllowanceCharge":{"anyOf":[{"type":"object","properties":{"discount":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false},"fee":{"type":"object","properties":{"amount":{"type":"number"},"reason":{"type":"string"}},"required":["amount","reason"],"additionalProperties":false}},"additionalProperties":false},{"type":"null"}]},"additionalDocumentReference":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string"},"type":{"type":"string","enum":["CustomsImportForm","FreeTradeAgreement","K2","CIF"]}},"required":["id"],"additionalProperties":false}},{"type":"null"}]},"environment":{"type":"string","enum":["live","test"],"description":"LHDN environment this consolidated invoice belongs to"},"status":{"type":"string","enum":["Pending","Submitted","Valid","Invalid","Cancelled"],"description":"Pending until submitted to LHDN, then the LHDN status (a Submitted document wins over later ones while LHDN is still processing)."},"latestSubmission":{"description":"Latest LHDN submission of this consolidated invoice; null when never submitted.","anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"Submitted-document id"},"uuid":{"description":"LHDN document uuid","type":["string","null"]},"longId":{"description":"LHDN long id (QR / validation URL)","type":["string","null"]},"status":{"type":"string","enum":["Submitted","Valid","Invalid","Cancelled"],"description":"LHDN status of this submission"},"failReason":{"description":"Why LHDN rejected the document (Invalid), when known","type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}],"description":"Structured LHDN rejection details, when known"},"submissionUid":{"description":"LHDN submission (batch) uid this document travelled in","type":["string","null"]},"submittedAt":{"type":"string","description":"When the document was submitted (ISO)"},"updatedAt":{"type":"string","description":"Last status change seen by Books (ISO)"},"cancelledAt":{"description":"When the document was cancelled (ISO), if it was","type":["string","null"]},"cancelReason":{"description":"Cancellation reason","type":["string","null"]}},"required":["id","uuid","longId","status","failReason","failDetails","submissionUid","submittedAt","updatedAt","cancelledAt","cancelReason"],"additionalProperties":false,"description":"Most recent submitted document of this invoice, or null when it was never submitted."},{"type":"null"}]},"consolidatedInvoiceCode":{"type":"number"},"legalMonetaryTotal":{"anyOf":[{"type":"object","properties":{"discountValue":{"type":"number"},"excludingTax":{"type":"number"},"feeAmount":{"type":"number"},"includingTax":{"type":"number"},"netAmount":{"type":"number"},"payableAmount":{"type":"number"},"payableRoundingAmount":{"type":"number"}},"required":["excludingTax","includingTax","payableAmount"],"additionalProperties":false},{"type":"null"}]}},"required":["id","companyId","userId","organizationId","invoiceCode","externalId","type","invoiceCodeWithPrefixAndDigits","billingReferenceNumber","createdAt","updatedAt","buyer","supplier","lineItems","invoiceDateTime","foreignCurrency","billingPeriod","payment","prePayment","invoiceLevelAllowanceCharge","additionalDocumentReference","environment","status","consolidatedInvoiceCode","legalMonetaryTotal"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Consolidated-invoicesById"}},"/api/v1/consolidated-invoices/{id}/export":{"get":{"summary":"Export consolidated invoice (incl. linked invoice ids + UBL)","tags":["Consolidated Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Consolidated-invoicesByIdExport"}},"/api/v1/consolidated-invoices/{id}/submitted-documents":{"get":{"summary":"Get consolidated invoice submission history","description":"The consolidated invoice's own submitted documents, newest first (at most 10), in the same shape as `GET /submitted-documents`. The signed UBL and raw LHDN responses are not included; use `GET /consolidated-invoices/:id/export` for the submitted UBL.","tags":["Consolidated Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"documentSubmissionId":{"type":"string"},"invoiceId":{"type":["string","null"]},"adjustmentNoteId":{"type":["string","null"]},"consolidatedInvoiceId":{"type":["string","null"]},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"code":{"type":"string"},"uuid":{"type":["string","null"]},"status":{"type":"string","enum":["Submitted","Cancelled","Valid","Invalid"]},"cancelledBy":{"type":["string","null"]},"cancelledAt":{"type":["string","null"]},"failReason":{"type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}]},"type":{"type":"string"},"cancelReason":{"type":["string","null"]},"longId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"submissionUid":{"type":["string","null"]},"documentDate":{"type":["string","null"]},"buyerName":{"type":["string","null"]},"buyerTin":{"type":["string","null"]},"grandTotal":{"type":["number","null"]}},"required":["id","documentSubmissionId","invoiceId","adjustmentNoteId","consolidatedInvoiceId","companyId","userId","organizationId","code","uuid","status","cancelledBy","cancelledAt","failReason","failDetails","type","cancelReason","longId","createdAt","updatedAt","submissionUid","documentDate","buyerName","buyerTin","grandTotal"],"additionalProperties":false}},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Consolidated-invoicesByIdSubmitted-documents"}},"/api/v1/consolidated-invoices/{id}/adjustment-notes":{"post":{"summary":"Create adjustment note for consolidated invoice","tags":["Consolidated Invoices"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"adjustmentNoteIssueDate":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"isCharge":{"type":"boolean"},"rate":{"type":"number"},"reason":{"type":"string"}},"required":["isCharge","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"targetInvoiceType":{"type":"string"},"type":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},"required":["adjustmentNoteCode","lineItems","type"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"adjustmentNoteIssueDate":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"isCharge":{"type":"boolean"},"rate":{"type":"number"},"reason":{"type":"string"}},"required":["isCharge","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"targetInvoiceType":{"type":"string"},"type":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},"required":["adjustmentNoteCode","lineItems","type"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"adjustmentNoteCode":{"type":"integer","minimum":1,"maximum":9007199254740991},"adjustmentNoteIssueDate":{"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"isCharge":{"type":"boolean"},"rate":{"type":"number"},"reason":{"type":"string"}},"required":["isCharge","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}},"targetInvoiceType":{"type":"string"},"type":{"type":"string","enum":["CREDIT_NOTE","DEBIT_NOTE","REFUND_NOTE"]}},"required":["adjustmentNoteCode","lineItems","type"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"402":{"description":"Response for status 402","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1Consolidated-invoicesByIdAdjustment-notes"}},"/api/v1/submitted-documents/export":{"get":{"summary":"Export all submitted documents","tags":["Submitted Documents"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Submitted-documentsExport"}},"/api/v1/submitted-documents/{id}/export":{"get":{"summary":"Export submitted document","tags":["Submitted Documents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Submitted-documentsByIdExport"}},"/api/v1/submitted-documents":{"get":{"summary":"List submitted documents","tags":["Submitted Documents"],"parameters":[{"name":"page","in":"query","required":true,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"per_page","in":"query","required":true,"schema":{"default":10,"type":"integer","minimum":1,"maximum":1000}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"documentSubmissionId":{"type":"string"},"invoiceId":{"type":["string","null"]},"adjustmentNoteId":{"type":["string","null"]},"consolidatedInvoiceId":{"type":["string","null"]},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"code":{"type":"string"},"uuid":{"type":["string","null"]},"status":{"type":"string","enum":["Submitted","Cancelled","Valid","Invalid"]},"cancelledBy":{"type":["string","null"]},"cancelledAt":{"type":["string","null"]},"failReason":{"type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}]},"type":{"type":"string"},"cancelReason":{"type":["string","null"]},"longId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"submissionUid":{"type":["string","null"]},"documentDate":{"type":["string","null"]},"buyerName":{"type":["string","null"]},"buyerTin":{"type":["string","null"]},"grandTotal":{"type":["number","null"]}},"required":["id","documentSubmissionId","invoiceId","adjustmentNoteId","consolidatedInvoiceId","companyId","userId","organizationId","code","uuid","status","cancelledBy","cancelledAt","failReason","failDetails","type","cancelReason","longId","createdAt","updatedAt","submissionUid","documentDate","buyerName","buyerTin","grandTotal"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasNextPage":{"type":"boolean"},"hasPrevPage":{"type":"boolean"}},"required":["page","perPage","total","totalPages","hasNextPage","hasPrevPage"],"additionalProperties":false}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Submitted-documents"}},"/api/v1/submitted-documents/{id}":{"get":{"summary":"Get submitted document","tags":["Submitted Documents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"documentSubmissionId":{"type":"string"},"invoiceId":{"type":["string","null"]},"adjustmentNoteId":{"type":["string","null"]},"consolidatedInvoiceId":{"type":["string","null"]},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"code":{"type":"string"},"uuid":{"type":["string","null"]},"status":{"type":"string","enum":["Submitted","Cancelled","Valid","Invalid"]},"cancelledBy":{"type":["string","null"]},"cancelledAt":{"type":["string","null"]},"failReason":{"type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}]},"type":{"type":"string"},"cancelReason":{"type":["string","null"]},"longId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"submissionUid":{"type":["string","null"]},"documentDate":{"type":["string","null"]},"buyerName":{"type":["string","null"]},"buyerTin":{"type":["string","null"]},"grandTotal":{"type":["number","null"]}},"required":["id","documentSubmissionId","invoiceId","adjustmentNoteId","consolidatedInvoiceId","companyId","userId","organizationId","code","uuid","status","cancelledBy","cancelledAt","failReason","failDetails","type","cancelReason","longId","createdAt","updatedAt","submissionUid","documentDate","buyerName","buyerTin","grandTotal"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Submitted-documentsById"}},"/api/v1/submitted-documents/sync-status":{"post":{"summary":"Re-sync every pending submitted document's status from LHDN","description":"Polls LHDN now for this company's documents (in the API key's environment) that are still `Submitted`, oldest first, at most 20 per call, and returns how many were `checked` and how many changed status (`updated`). You normally never need this: Books polls LHDN itself, every 60 seconds after a submit while LHDN reports \"in progress\", and a background sweep on the half-hour re-checks anything still `Submitted` after 10 minutes (up to 30 days back). Status changes reach you through webhooks and the document endpoints as soon as Books sees them. Only one company-wide sync runs at a time per company: a call made while another is still running returns 409 `SYNC_IN_PROGRESS` (wait and retry). The call can take a while (each document is one rate-limited LHDN request).","tags":["Submitted Documents"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"checked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Still-Submitted documents examined (at most 20)"},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Documents whose status changed after polling LHDN"}},"required":["checked","updated"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1Submitted-documentsSync-status"}},"/api/v1/submitted-documents/{id}/sync-status":{"post":{"summary":"Re-sync a submitted document's status from LHDN","tags":["Submitted Documents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"documentSubmissionId":{"type":"string"},"invoiceId":{"type":["string","null"]},"adjustmentNoteId":{"type":["string","null"]},"consolidatedInvoiceId":{"type":["string","null"]},"companyId":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"code":{"type":"string"},"uuid":{"type":["string","null"]},"status":{"type":"string","enum":["Submitted","Cancelled","Valid","Invalid"]},"cancelledBy":{"type":["string","null"]},"cancelledAt":{"type":["string","null"]},"failReason":{"type":["string","null"]},"failDetails":{"anyOf":[{},{"type":"null"}]},"type":{"type":"string"},"cancelReason":{"type":["string","null"]},"longId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"submissionUid":{"type":["string","null"]},"documentDate":{"type":["string","null"]},"buyerName":{"type":["string","null"]},"buyerTin":{"type":["string","null"]},"grandTotal":{"type":["number","null"]}},"required":["id","documentSubmissionId","invoiceId","adjustmentNoteId","consolidatedInvoiceId","companyId","userId","organizationId","code","uuid","status","cancelledBy","cancelledAt","failReason","failDetails","type","cancelReason","longId","createdAt","updatedAt","submissionUid","documentDate","buyerName","buyerTin","grandTotal"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1Submitted-documentsByIdSync-status"}},"/api/v1/submitted-documents/{id}/ubl-totals":{"get":{"summary":"Submitted-document monetary/tax totals from the UBL","tags":["Submitted Documents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"totals":{"anyOf":[{},{"type":"null"}]},"lines":{}},"required":["totals","lines"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Submitted-documentsByIdUbl-totals"}},"/api/v1/einvoice-requests":{"get":{"summary":"List e-invoice requests","tags":["E-Invoice Requests"],"parameters":[{"name":"page","in":"query","required":true,"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"per_page","in":"query","required":true,"schema":{"default":10,"type":"integer","minimum":1,"maximum":1000}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"organizationId":{"type":"string"},"invoiceCode":{"type":"string"},"status":{"type":"string","enum":["Pending","Reject","Approve"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"documentDetails":{"type":"object","properties":{"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}}},"additionalProperties":false}},"required":["id","companyId","organizationId","invoiceCode","status","createdAt","updatedAt","documentDetails"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasNextPage":{"type":"boolean"},"hasPrevPage":{"type":"boolean"}},"required":["page","perPage","total","totalPages","hasNextPage","hasPrevPage"],"additionalProperties":false}},"required":["success","data","pagination"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Einvoice-requests"},"post":{"summary":"Create e-invoice request","description":"Records a buyer's request for an e-invoice against an invoice code. The request starts as `Pending`. Retries are safe: if a `Pending` request for the same `invoiceCode` already exists in your company, it is returned unchanged (200, `idempotentReplay: true`) and no second row is created. An `Idempotency-Key` header (1-128 visible ASCII characters) is accepted for consistency with other create routes.","tags":["E-Invoice Requests"],"parameters":[{"name":"idempotency-key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"invoiceCode":{"type":"string","minLength":1,"maxLength":100}},"required":["buyer","invoiceCode"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"invoiceCode":{"type":"string","minLength":1,"maxLength":100}},"required":["buyer","invoiceCode"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"invoiceCode":{"type":"string","minLength":1,"maxLength":100}},"required":["buyer","invoiceCode"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"organizationId":{"type":"string"},"invoiceCode":{"type":"string"},"status":{"type":"string","enum":["Pending","Reject","Approve"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"documentDetails":{"type":"object","properties":{"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}}},"additionalProperties":false},"idempotentReplay":{"type":"boolean"}},"required":["id","companyId","organizationId","invoiceCode","status","createdAt","updatedAt","documentDetails"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"201":{"description":"Response for status 201","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"organizationId":{"type":"string"},"invoiceCode":{"type":"string"},"status":{"type":"string","enum":["Pending","Reject","Approve"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"documentDetails":{"type":"object","properties":{"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}}},"additionalProperties":false},"idempotentReplay":{"type":"boolean"}},"required":["id","companyId","organizationId","invoiceCode","status","createdAt","updatedAt","documentDetails"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1Einvoice-requests"}},"/api/v1/einvoice-requests/{id}":{"get":{"summary":"Get e-invoice request","tags":["E-Invoice Requests"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"organizationId":{"type":"string"},"invoiceCode":{"type":"string"},"status":{"type":"string","enum":["Pending","Reject","Approve"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"documentDetails":{"type":"object","properties":{"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}}},"additionalProperties":false}},"required":["id","companyId","organizationId","invoiceCode","status","createdAt","updatedAt","documentDetails"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Einvoice-requestsById"},"put":{"summary":"Update e-invoice request status","tags":["E-Invoice Requests"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["Pending","Reject","Approve"]}},"required":["status"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["Pending","Reject","Approve"]}},"required":["status"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["Pending","Reject","Approve"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"organizationId":{"type":"string"},"invoiceCode":{"type":"string"},"status":{"type":"string","enum":["Pending","Reject","Approve"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"documentDetails":{"type":"object","properties":{"buyer":{"type":"object","properties":{"address":{"type":"object","properties":{"addressLine0":{"type":"string"},"addressLine1":{"type":"string"},"addressLine2":{"type":"string"},"cityName":{"type":"string"},"country":{"type":"string"},"postalZone":{"type":"string"},"state":{"type":"string"}},"required":["addressLine0","cityName","country","state"],"additionalProperties":false},"contactNumber":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"partyType":{"type":"string"},"registrationNumber":{"type":"string"},"registrationType":{"type":"string"},"sstRegistrationNumber":{"type":"string"},"tin":{"type":"string"}},"required":["contactNumber","name","partyType","registrationNumber","registrationType","tin"],"additionalProperties":false},"lineItems":{"type":"array","items":{"type":"object","properties":{"allowanceCharges":{"type":"array","items":{"type":"object","properties":{"amount":{},"isCharge":{"type":"boolean"},"rate":{},"reason":{"type":"string"}},"required":["amount","isCharge","rate","reason"],"additionalProperties":false}},"classifications":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string"},"originCountry":{"type":"string"},"tarriffCode":{"type":"string"},"taxDetails":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"object","properties":{"percentage":{"type":"number"},"ratePerUnit":{"type":"number"}},"additionalProperties":false},"taxType":{"type":"string"}},"required":["taxRate","taxType"],"additionalProperties":false}},"taxExemption":{"type":"object","properties":{"reason":{"type":"string"},"taxableAmount":{"type":"number"}},"required":["reason","taxableAmount"],"additionalProperties":false},"unit":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"number"},"price":{"type":"number"}},"required":["count","price"],"additionalProperties":false}},"required":["description","id","taxDetails","unit"],"additionalProperties":false}}},"additionalProperties":false}},"required":["id","companyId","organizationId","invoiceCode","status","createdAt","updatedAt","documentDetails"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"putApiV1Einvoice-requestsById"},"delete":{"summary":"Delete e-invoice request","tags":["E-Invoice Requests"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"deleteApiV1Einvoice-requestsById"}},"/api/v1/webhooks":{"get":{"summary":"List webhook endpoints","tags":["Webhooks"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"environment":{"anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}],"description":"\"live\" or \"test\" when restricted; null = both environments"},"isActive":{"type":"boolean"},"secretHint":{"type":"string","description":"Masked hint of the signing secret (last 4 characters)"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","url","events","environment","isActive","secretHint","createdAt","updatedAt"],"additionalProperties":false}},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1Webhooks"},"post":{"summary":"Create a webhook endpoint","description":"Registers a URL to receive document status callbacks. The response includes the signing `secret` exactly once. Each delivery is a POST with `X-Webhook-Signature: sha256=<hex HMAC-SHA256 of the raw body>`, `X-Webhook-Event`, `X-Webhook-Delivery-Id` (stable across retries; use it to dedupe) and `X-Webhook-Timestamp` (unix seconds).","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"URL that receives the POST callbacks"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["document.submitted","document.valid","document.invalid","document.cancelled","*"]},"description":"Events to subscribe to: document.submitted, document.valid, document.invalid, document.cancelled, or \"*\""},"isActive":{"type":"boolean"},"environment":{"description":"Restrict this endpoint to one LHDN environment (\"live\" or \"test\"); null receives both. Omitted defaults to the environment of the API key making the call, so an integrator holding one key per environment gets one endpoint per environment.","anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}]}},"required":["url","events"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"URL that receives the POST callbacks"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["document.submitted","document.valid","document.invalid","document.cancelled","*"]},"description":"Events to subscribe to: document.submitted, document.valid, document.invalid, document.cancelled, or \"*\""},"isActive":{"type":"boolean"},"environment":{"description":"Restrict this endpoint to one LHDN environment (\"live\" or \"test\"); null receives both. Omitted defaults to the environment of the API key making the call, so an integrator holding one key per environment gets one endpoint per environment.","anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}]}},"required":["url","events"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"URL that receives the POST callbacks"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["document.submitted","document.valid","document.invalid","document.cancelled","*"]},"description":"Events to subscribe to: document.submitted, document.valid, document.invalid, document.cancelled, or \"*\""},"isActive":{"type":"boolean"},"environment":{"description":"Restrict this endpoint to one LHDN environment (\"live\" or \"test\"); null receives both. Omitted defaults to the environment of the API key making the call, so an integrator holding one key per environment gets one endpoint per environment.","anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}]}},"required":["url","events"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"environment":{"anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}],"description":"\"live\" or \"test\" when restricted; null = both environments"},"isActive":{"type":"boolean"},"secretHint":{"type":"string","description":"Masked hint of the signing secret (last 4 characters)"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"secret":{"type":"string","description":"Signing secret (whsec_...). Shown ONCE: store it now; use regenerate-secret to rotate."}},"required":["id","url","events","environment","isActive","secretHint","createdAt","updatedAt","secret"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1Webhooks"}},"/api/v1/webhooks/{id}":{"get":{"summary":"Get a webhook endpoint","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"environment":{"anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}],"description":"\"live\" or \"test\" when restricted; null = both environments"},"isActive":{"type":"boolean"},"secretHint":{"type":"string","description":"Masked hint of the signing secret (last 4 characters)"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","url","events","environment","isActive","secretHint","createdAt","updatedAt"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1WebhooksById"},"put":{"summary":"Update a webhook endpoint","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["document.submitted","document.valid","document.invalid","document.cancelled","*"]}},"isActive":{"type":"boolean"},"environment":{"description":"Change the environment filter (\"live\" | \"test\"); null = both environments; omitted = unchanged.","anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}]}},"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["document.submitted","document.valid","document.invalid","document.cancelled","*"]}},"isActive":{"type":"boolean"},"environment":{"description":"Change the environment filter (\"live\" | \"test\"); null = both environments; omitted = unchanged.","anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}]}},"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["document.submitted","document.valid","document.invalid","document.cancelled","*"]}},"isActive":{"type":"boolean"},"environment":{"description":"Change the environment filter (\"live\" | \"test\"); null = both environments; omitted = unchanged.","anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"environment":{"anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}],"description":"\"live\" or \"test\" when restricted; null = both environments"},"isActive":{"type":"boolean"},"secretHint":{"type":"string","description":"Masked hint of the signing secret (last 4 characters)"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","url","events","environment","isActive","secretHint","createdAt","updatedAt"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"putApiV1WebhooksById"},"delete":{"summary":"Delete a webhook endpoint","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"deleteApiV1WebhooksById"}},"/api/v1/webhooks/{id}/regenerate-secret":{"post":{"summary":"Rotate a webhook endpoint's signing secret","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"secret":{"type":"string","description":"New signing secret. Shown once; the old one stops working."}},"required":["secret"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"postApiV1WebhooksByIdRegenerate-secret"}},"/api/v1/webhooks/{id}/deliveries":{"get":{"summary":"List webhook delivery attempts","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"before","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"endpointId":{"type":"string"},"event":{"type":"string"},"documentId":{"type":["string","null"]},"attemptNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"success":{"type":"boolean"},"statusCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"errorMessage":{"type":["string","null"]},"responseSnippet":{"type":["string","null"]},"durationMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payload":{},"createdAt":{"type":"string"}},"required":["id","endpointId","event","documentId","attemptNumber","success","statusCode","errorMessage","responseSnippet","durationMs","payload","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["deliveries","nextCursor"],"additionalProperties":false},"message":{"type":"string"}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"type":"string","const":"VALIDATION_ERROR","description":"Machine-readable error code category"},"details":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"The dot-path or field name that failed validation"},"message":{"type":"string","description":"The detailed validation error message"},"summary":{"description":"A summary of the validation error","type":"string"},"value":{"description":"The invalid value received"}},"required":["path","message"],"additionalProperties":false},"description":"List of field validation failures"}},"required":["success","error","message","code","details"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}},"500":{"description":"Response for status 500","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":false,"description":"Always false for error responses"},"error":{"type":"string","description":"Human-readable error message detailing what went wrong"},"message":{"type":"string","description":"Alias of `error` for v1-client compatibility"},"code":{"description":"Machine-readable error code category (e.g. NOT_FOUND, UNAUTHORIZED)","type":"string"},"details":{"description":"Additional context about the error (if any)","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["success","error","message"],"additionalProperties":false}}}}},"operationId":"getApiV1WebhooksByIdDeliveries"}},"/feedback/files/{key}":{"get":{"summary":"Feedback screenshot","description":"Public by unguessable key so GitHub and agents can fetch the image.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"operationId":"getFeedbackFilesByKey"}},"/feedback/":{"post":{"summary":"Send feedback","description":"Files a GitHub issue from the signed-in operator. Any authenticated role may call this.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000},"page":{"type":"string","minLength":1,"maxLength":4096},"screenshot":{"type":"string","format":"binary","contentEncoding":"binary"},"attachments":{"anyOf":[{"type":"string","format":"binary","contentEncoding":"binary"},{"type":"array","items":{"type":"string","format":"binary","contentEncoding":"binary"}}]}},"required":["message","page"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000},"page":{"type":"string","minLength":1,"maxLength":4096},"screenshot":{"type":"string","format":"binary","contentEncoding":"binary"},"attachments":{"anyOf":[{"type":"string","format":"binary","contentEncoding":"binary"},{"type":"array","items":{"type":"string","format":"binary","contentEncoding":"binary"}}]}},"required":["message","page"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000},"page":{"type":"string","minLength":1,"maxLength":4096},"screenshot":{"type":"string","format":"binary","contentEncoding":"binary"},"attachments":{"anyOf":[{"type":"string","format":"binary","contentEncoding":"binary"},{"type":"array","items":{"type":"string","format":"binary","contentEncoding":"binary"}}]}},"required":["message","page"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Response for status 401","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Response for status 429","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Response for status 502","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Response for status 503","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}},"operationId":"postFeedback"}},"/platform/me":{"get":{"summary":"Platform console: current actor","tags":["Platform"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"getPlatformMe"}},"/platform/ai-budget-warning":{"get":{"summary":"Platform console: operator AI allowance","tags":["Platform"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"getPlatformAi-budget-warning"}},"/platform/overview":{"get":{"summary":"Platform console: overview","tags":["Platform"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"getPlatformOverview"}},"/platform/organizations":{"get":{"summary":"Platform console: list organizations","tags":["Platform"],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["all","qualified","pending","local","grace"]}},{"name":"demo","in":"query","required":false,"schema":{"type":"string","enum":["include","exclude","only"]}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"getPlatformOrganizations"}},"/platform/organizations/{id}":{"get":{"summary":"Platform console: organization detail","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"getPlatformOrganizationsById"}},"/platform/organizations/adopt":{"post":{"summary":"Platform console: adopt a hub organization directly (no Books sign-in required)","tags":["Platform"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"hubOrgId":{"type":"string","minLength":1},"slug":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"graceDays":{"default":30,"type":"integer","minimum":1,"maximum":90},"qualify":{"default":true,"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":500},"members":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["owner","admin","member","viewer"]}},"required":["email","role"],"additionalProperties":false}}},"required":["name","hubOrgId","graceDays","qualify","reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"hubOrgId":{"type":"string","minLength":1},"slug":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"graceDays":{"default":30,"type":"integer","minimum":1,"maximum":90},"qualify":{"default":true,"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":500},"members":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["owner","admin","member","viewer"]}},"required":["email","role"],"additionalProperties":false}}},"required":["name","hubOrgId","graceDays","qualify","reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"hubOrgId":{"type":"string","minLength":1},"slug":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"graceDays":{"default":30,"type":"integer","minimum":1,"maximum":90},"qualify":{"default":true,"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":500},"members":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["owner","admin","member","viewer"]}},"required":["email","role"],"additionalProperties":false}}},"required":["name","hubOrgId","graceDays","qualify","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsAdopt"}},"/platform/organizations/{id}/unadopt":{"post":{"summary":"Platform console: undo an adoption — hard-deletes an organization, ONLY when it is provably never used (409 not_pristine otherwise)","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdUnadopt"}},"/platform/organizations/{id}/qualify":{"post":{"summary":"Platform console: qualify organization","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdQualify"}},"/platform/organizations/{id}/unqualify":{"post":{"summary":"Platform console: unqualify organization","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdUnqualify"}},"/platform/organizations/{id}/designate-firm":{"post":{"summary":"Platform console: designate organization as accounting firm","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdDesignate-firm"}},"/platform/organizations/{id}/undesignate-firm":{"post":{"summary":"Platform console: remove organization's firm designation","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdUndesignate-firm"}},"/platform/organizations/{id}/fee-waiver":{"post":{"summary":"Platform console: set (or replace) an organization's Fee Waiver","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"until":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"until":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"until":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdFee-waiver"}},"/platform/organizations/{id}/clear-fee-waiver":{"post":{"summary":"Platform console: clear an organization's Fee Waiver","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdClear-fee-waiver"}},"/platform/organizations/{id}/mark-demo":{"post":{"summary":"Platform console: mark an organization as a Demo Organization (one-way)","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdMark-demo"}},"/platform/organizations/{id}/link-hub":{"post":{"summary":"Platform console: link organization to a hub org","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"hubOrgId":{"type":"string","minLength":1},"graceDays":{"default":30,"type":"integer","minimum":1,"maximum":90},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["hubOrgId","graceDays","reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"hubOrgId":{"type":"string","minLength":1},"graceDays":{"default":30,"type":"integer","minimum":1,"maximum":90},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["hubOrgId","graceDays","reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"hubOrgId":{"type":"string","minLength":1},"graceDays":{"default":30,"type":"integer","minimum":1,"maximum":90},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["hubOrgId","graceDays","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdLink-hub"}},"/platform/organizations/{id}/grace":{"post":{"summary":"Platform console: set link grace window","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"days":{"type":"integer","minimum":0,"maximum":90},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["days","reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"days":{"type":"integer","minimum":0,"maximum":90},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["days","reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"days":{"type":"integer","minimum":0,"maximum":90},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["days","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdGrace"}},"/platform/organizations/{id}/members":{"post":{"summary":"Platform console: pre-link a member by email","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["email","role","reason"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["email","role","reason"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["email","role","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformOrganizationsByIdMembers"}},"/platform/audit":{"get":{"summary":"Platform console: audit log","tags":["Platform"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"schema":{"type":"string"}},{"name":"action","in":"query","required":false,"schema":{"type":"string"}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"getPlatformAudit"}},"/platform/businesses/decommissioned":{"get":{"summary":"Platform console: archived Businesses across all organizations, with per-row discardability","tags":["Platform"],"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"getPlatformBusinessesDecommissioned"}},"/platform/businesses/{id}/discard":{"post":{"summary":"Platform console: discard a provably-empty archived Business immediately, no 90-day window (409 not_discardable otherwise)","tags":["Platform"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"confirmName":{"type":"string"}},"required":["reason","confirmName"],"additionalProperties":false}},"application/x-www-form-urlencoded":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"confirmName":{"type":"string"}},"required":["reason","confirmName"],"additionalProperties":false}},"multipart/form-data":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500},"confirmName":{"type":"string"}},"required":["reason","confirmName"],"additionalProperties":false}}}},"responses":{"200":{"description":"Response for status 200","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"400":{"description":"Response for status 400","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"403":{"description":"Response for status 403","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"404":{"description":"Response for status 404","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"409":{"description":"Response for status 409","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}},"428":{"description":"Response for status 428","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema"}}}}},"operationId":"postPlatformBusinessesByIdDiscard"}}}}