{"components":{"headers":{"CatalogCacheControl":{"description":"Always `public, max-age=300`. Tenant-neutral catalog endpoints are safe to cache in shared proxies for 5 minutes.","schema":{"type":"string"}},"CatalogETag":{"description":"Weak ETag over (partner, locale, catalog version). Supports `If-None-Match` → 304.","schema":{"type":"string"}},"CatalogVary":{"description":"Always `Accept-Language, X-API-Key` — caches must partition responses by locale + credential.","schema":{"type":"string"}},"CatalogVersion":{"description":"Current catalog version (e.g. `2026-10`). Partners key their SDK cache off a change in this value — a bump means `/catalog/changelog?since=<previous>` should fire to see what moved.","schema":{"type":"string"}},"CatalogXCache":{"description":"`HIT` when served from the in-memory cache, `MISS` on the fallback path.","schema":{"enum":["HIT","MISS"],"type":"string"}}},"parameters":{"IdempotencyKey":{"description":"Deterministic key (UUID or hash). Same key + same body replays the stored result.","in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"minLength":1,"type":"string"}}},"responses":{"Conflict":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"State transition not allowed"},"Forbidden":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Credentials authenticated but the caller isn't allowed to perform this action. The most common `code` on invoice push is `connection_trn_mismatch` — the top-level `trn` in your request doesn't match the SME bound to your `x-erp-partner-secret`. Call `GET /v1/partner/whoami` with the same connection-secret header attached to look up the correct TRN. Other codes include `connection_partner_mismatch` (secret belongs to a different ERP partner) and `sme_not_connected` (the SME revoked their connection)."},"IdempotencyConflict":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"The same `Idempotency-Key` was used with a DIFFERENT request body. Use a fresh key (recommended: a UUID) for every new request; the same key is only safe for RETRY of the identical request."},"InvalidBody":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Body failed schema validation. The RFC 7807 response carries a `meta.issues[]` array with `{code, severity, path, message}` entries covering EVERY failing field — fix them all in one pass instead of retrying per-field. The entries use the same shape as `POST /v1/partner/invoices/validate` so logging code can be shared."},"InvalidQuery":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Query parameters failed validation"},"NotFound":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Resource missing or not owned by caller"},"RateLimited":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Per-partner request budget exceeded. Honour the `Retry-After` response header (seconds) and back off; retrying inside that window keeps the budget pinned at zero. The budget is partner-wide, not per-SME.","headers":{"Retry-After":{"schema":{"type":"integer"}},"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}}}},"Unauthorized":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Missing or invalid credentials. Verify your `X-API-Key` + `X-API-Secret` headers — test-mode keys start with `erp_test_`, live-mode with `erp_live_`. On endpoints that also require the connection secret, a bad `x-erp-partner-secret` returns 401 `invalid_connection_credential` with the same shape."}},"schemas":{"Address":{"properties":{"city":{"type":"string"},"country":{"default":"AE","maxLength":2,"minLength":2,"type":"string"},"emirate":{"type":"string"},"line1":{"type":"string"},"line2":{"type":"string"},"postalCode":{"type":"string"}},"type":"object"},"BulkInvoiceBody":{"example":{"invoices":[{"actualDeliveryDate":"2026-10-30","buyer":{"address":{"city":"Abu Dhabi","country":"AE","countrySubdivision":"Abu Dhabi","emirate":"Abu Dhabi","line1":"Al Reem Island, Marina Square","line2":"Tower B","postalCode":"00000","state":"AUH"},"authorityName":"FTA","country":"AE","electronicAddress":"ap@buyer.ae","electronicAddressSchemeId":"EM","email":"ap@buyer.ae","kind":"buyer","legalRegistrationType":"TL","name":"Buyer Company LLC","phone":"+971-2-7654321","tin":"100000160500003","tradeLicenseNumber":"DED-654321","tradingName":"Buyer Co","trn":"100000160500003"},"contractReference":"CTR-2026-0421","contractValue":500000,"creditNoteReasonCode":"01","currency":"AED","customsReferenceNumber":"CDN-2026-0001","deliveryAddressLine1":"Plot 12, Sheikh Zayed Road","deliveryAddressLine2":"Zone 3","deliveryAddressLine3":"Building 42","deliveryCity":"Dubai","deliveryCountryCode":"AE","deliveryCountrySubdivision":"Dubai","deliveryLocationIdentifier":"LOC-5500","deliveryLocationSchemeIdentifier":"0088","deliveryPartyName":"Al Noor Warehouse","deliveryPostalCode":"00000","deliveryStateCode":"DXB","docAllowancesAmount":50,"docAllowancesReason":"Volume discount","docAllowancesVatCategory":"S","docAllowancesVatRate":0.05,"docChargesAmount":25,"docChargesReason":"Freight surcharge","docChargesVatCategory":"S","docChargesVatRate":0.05,"dueDate":"2026-11-29","externalRef":"acme-batch-item-1","frequencyOfBilling":"monthly","incoterms":"DAP Dubai","invoiceNote":"Payment due within 30 days from issue date.","invoiceType":"sale","invoicingPeriodEndDate":"2026-10-31","invoicingPeriodStartDate":"2026-10-01","issueDate":"2026-10-29","lines":[{"allowanceAmount":10,"allowanceReason":"Loyalty rebate","attributeName":"Period","attributeValue":"October 2026","chargeAmount":5,"chargeReason":"Handling","countryOfOrigin":"AE","description":"Consulting services — October 2026","itemType":"services","name":"Consulting — Oct 2026","priceBaseQuantity":1,"priceDiscount":0,"quantity":10,"serviceAccountingCode":"998311","standardIdentifier":"SKU-CONS-OCT","taxCategory":"standard_5","unitOfMeasureCode":"HUR","unitPrice":500,"vatRate":0.05}],"number":"INV-2026-0001","paymentAccountIdentifier":"AE070331234567890123456","paymentAccountName":"Al Noor Trading LLC","paymentAccountScheme":"IBAN","paymentMeansCode":"30","paymentServiceProviderIdentifier":"EBILAEAD","precedingInvoiceIssueDate":"2025-10-01","precedingInvoiceNumber":"INV-2025-999","principleId":"principal-ref-01","projectReference":"PRJ-2026-99","purchaseOrderReference":"PO-2026-5500","receivingAdviceReference":"RAD-2026-0100","salesOrderReference":"SO-2026-5500","seller":{"address":{"city":"Dubai","country":"AE","countrySubdivision":"Dubai","emirate":"Dubai","line1":"Office 2201, Boulevard Plaza Tower 1","line2":"Sheikh Mohammed Bin Rashid Boulevard","postalCode":"00000","state":"DXB"},"authorityName":"FTA","country":"AE","electronicAddress":"ops@alnoor.ae","electronicAddressSchemeId":"EM","email":"ops@alnoor.ae","kind":"seller","legalRegistrationType":"TL","name":"Al Noor Trading LLC","passportIssuingCountry":"AE","phone":"+971-4-1234567","tin":"100000000000003","tradeLicenseNumber":"DED-123456","tradingName":"Al Noor","trn":"100000000000003"},"tenderOrLotReference":"TND-2026-0005","transactionTypeCode":"0100000A","trn":"100000000000003","vatPointDate":"2026-10-29"}]},"properties":{"invoices":{"items":{"properties":{"actualDeliveryDate":{"format":"date","type":"string"},"buyer":{"properties":{"address":{"properties":{"city":{"type":"string"},"countrySubdivision":{"maxLength":100,"minLength":1,"type":"string"},"emirate":{"type":"string"},"line1":{"type":"string"},"line2":{"type":"string"},"postalCode":{"type":"string"},"state":{"description":"UAE emirate code (Microvista uaeStateCodes, FTA IBT-063): AUH=Abu Dhabi, DXB=Dubai, SHJ=Sharjah, AJM=Ajman, UAQ=Umm Al Quwain, RAK=Ras Al Khaimah, FUJ=Fujairah.","enum":["AUH","DXB","SHJ","AJM","UAQ","RAK","FUJ"],"type":"string"}},"required":["line1","city"],"type":"object"},"authorityName":{"maxLength":200,"minLength":1,"type":"string"},"country":{"maxLength":2,"minLength":2,"type":"string"},"electronicAddress":{"maxLength":128,"minLength":1,"type":"string"},"electronicAddressSchemeId":{"maxLength":16,"minLength":1,"type":"string"},"email":{"format":"email","type":"string"},"id":{"format":"uuid","type":"string"},"kind":{"default":"buyer","enum":["buyer","seller","both"],"type":"string"},"legalRegistrationType":{"enum":["TL","PAS","NI","EID"],"type":"string"},"name":{"minLength":1,"type":"string"},"passportIssuingCountry":{"maxLength":2,"minLength":2,"type":"string"},"phone":{"type":"string"},"tin":{"maxLength":32,"minLength":1,"type":"string"},"tradeLicenseNumber":{"maxLength":64,"minLength":1,"type":"string"},"tradingName":{"maxLength":200,"minLength":1,"type":"string"},"trn":{"pattern":"^[0-9]{15}$","type":"string"}},"required":["name","country"],"type":"object"},"contractReference":{"maxLength":64,"minLength":1,"type":"string"},"contractValue":{"minimum":0,"type":"number"},"creditNoteReasonCode":{"maxLength":32,"minLength":1,"type":"string"},"currency":{"default":"AED","enum":["AED"],"type":"string"},"customsReferenceNumber":{"maxLength":64,"minLength":1,"type":"string"},"deliveryAddressLine1":{"maxLength":200,"minLength":1,"type":"string"},"deliveryAddressLine2":{"maxLength":200,"minLength":1,"type":"string"},"deliveryAddressLine3":{"maxLength":200,"minLength":1,"type":"string"},"deliveryCity":{"maxLength":100,"minLength":1,"type":"string"},"deliveryCountryCode":{"maxLength":2,"minLength":2,"type":"string"},"deliveryCountrySubdivision":{"maxLength":100,"minLength":1,"type":"string"},"deliveryLocationIdentifier":{"maxLength":64,"minLength":1,"type":"string"},"deliveryLocationSchemeIdentifier":{"maxLength":16,"minLength":1,"type":"string"},"deliveryPartyName":{"maxLength":200,"minLength":1,"type":"string"},"deliveryPostalCode":{"maxLength":20,"minLength":1,"type":"string"},"deliveryStateCode":{"maxLength":4,"minLength":1,"type":"string"},"docAllowancesAmount":{"minimum":0,"type":"number"},"docAllowancesReason":{"maxLength":200,"minLength":1,"type":"string"},"docAllowancesVatCategory":{"maxLength":32,"minLength":1,"type":"string"},"docAllowancesVatExemptReason":{"maxLength":500,"minLength":1,"type":"string"},"docAllowancesVatRate":{"maximum":1,"minimum":0,"type":"number"},"docChargesAmount":{"minimum":0,"type":"number"},"docChargesReason":{"maxLength":200,"minLength":1,"type":"string"},"docChargesVatCategory":{"maxLength":32,"minLength":1,"type":"string"},"docChargesVatExemptReason":{"maxLength":500,"minLength":1,"type":"string"},"docChargesVatRate":{"maximum":1,"minimum":0,"type":"number"},"documentType":{"default":"tax_invoice","enum":["tax_invoice","commercial_invoice_out_of_scope","credit_note","credit_note_goods_services","self_billed_invoice","self_billed_credit_note"],"type":"string"},"dueDate":{"format":"date","type":"string"},"externalRef":{"maxLength":128,"minLength":1,"type":"string"},"frequencyOfBilling":{"enum":["daily","weekly","monthly","quarterly","yearly","other"],"type":"string"},"incoterms":{"maxLength":16,"minLength":1,"type":"string"},"invoiceNote":{"maxLength":1000,"minLength":1,"type":"string"},"invoiceType":{"default":"sale","enum":["sale","purchase"],"type":"string"},"invoicingPeriodEndDate":{"format":"date","type":"string"},"invoicingPeriodStartDate":{"format":"date","type":"string"},"issueDate":{"format":"date","type":"string"},"lines":{"items":{"properties":{"allowanceAmount":{"minimum":0,"type":"number"},"allowanceReason":{"maxLength":200,"minLength":1,"type":"string"},"attributeName":{"maxLength":100,"minLength":1,"type":"string"},"attributeValue":{"maxLength":200,"minLength":1,"type":"string"},"chargeAmount":{"minimum":0,"type":"number"},"chargeReason":{"maxLength":200,"minLength":1,"type":"string"},"classificationCode":{"maxLength":32,"minLength":1,"type":"string"},"classificationScheme":{"maxLength":16,"minLength":1,"type":"string"},"countryOfOrigin":{"maxLength":2,"minLength":2,"type":"string"},"description":{"minLength":1,"type":"string"},"itemType":{"enum":["goods","services","both"],"type":"string"},"name":{"maxLength":200,"minLength":1,"type":"string"},"priceBaseQuantity":{"minimum":1,"type":"number"},"priceDiscount":{"minimum":0,"type":"number"},"quantity":{"exclusiveMinimum":0,"type":"number"},"serviceAccountingCode":{"maxLength":32,"minLength":1,"type":"string"},"standardIdentifier":{"maxLength":128,"minLength":1,"type":"string"},"taxCategory":{"default":"standard_5","enum":["standard_5","zero_rated_export","zero_rated_healthcare","zero_rated_education","exempt_financial","exempt_residential_rent","reverse_charge_designated_zone","reverse_charge_electronic_devices","reverse_charge_gold_diamonds","reverse_charge_crude_or_refined_oil","reverse_charge_natural_gas","reverse_charge_hydrocarbons","out_of_scope"],"type":"string"},"taxExemptionReasonCode":{"maxLength":32,"minLength":1,"type":"string"},"taxExemptionReasonText":{"maxLength":500,"minLength":1,"type":"string"},"unitOfMeasureCode":{"maxLength":16,"minLength":1,"type":"string"},"unitPrice":{"minimum":0,"type":"number"},"vatRate":{"description":"VAT rate as a fraction between 0 and 1 (UAE standard 5% = 0.05, not 5).","maximum":1,"minimum":0,"type":"number"}},"required":["description","quantity","unitPrice","vatRate"],"type":"object"},"maxItems":200,"minItems":1,"type":"array"},"number":{"maxLength":64,"minLength":1,"type":"string"},"paymentAccountIdentifier":{"maxLength":64,"minLength":1,"type":"string"},"paymentAccountName":{"maxLength":200,"minLength":1,"type":"string"},"paymentAccountScheme":{"maxLength":16,"minLength":1,"type":"string"},"paymentCardHolderName":{"maxLength":200,"minLength":1,"type":"string"},"paymentCardPan":{"pattern":"^[0-9]{4}$","type":"string"},"paymentMeansCode":{"maxLength":16,"minLength":1,"type":"string"},"paymentNetworkId":{"maxLength":32,"minLength":1,"type":"string"},"paymentServiceProviderIdentifier":{"maxLength":32,"minLength":1,"type":"string"},"precedingInvoiceIssueDate":{"format":"date","type":"string"},"precedingInvoiceNumber":{"maxLength":64,"minLength":1,"type":"string"},"principleId":{"maxLength":32,"minLength":1,"type":"string"},"projectReference":{"maxLength":64,"minLength":1,"type":"string"},"purchaseOrderReference":{"maxLength":64,"minLength":1,"type":"string"},"receivingAdviceReference":{"maxLength":64,"minLength":1,"type":"string"},"salesOrderReference":{"maxLength":64,"minLength":1,"type":"string"},"seller":{"properties":{"address":{"properties":{"city":{"type":"string"},"countrySubdivision":{"maxLength":100,"minLength":1,"type":"string"},"emirate":{"type":"string"},"line1":{"type":"string"},"line2":{"type":"string"},"postalCode":{"type":"string"},"state":{"description":"UAE emirate code (Microvista uaeStateCodes, FTA IBT-063): AUH=Abu Dhabi, DXB=Dubai, SHJ=Sharjah, AJM=Ajman, UAQ=Umm Al Quwain, RAK=Ras Al Khaimah, FUJ=Fujairah.","enum":["AUH","DXB","SHJ","AJM","UAQ","RAK","FUJ"],"type":"string"}},"required":["line1","city"],"type":"object"},"authorityName":{"maxLength":200,"minLength":1,"type":"string"},"country":{"maxLength":2,"minLength":2,"type":"string"},"electronicAddress":{"maxLength":128,"minLength":1,"type":"string"},"electronicAddressSchemeId":{"maxLength":16,"minLength":1,"type":"string"},"email":{"format":"email","type":"string"},"id":{"format":"uuid","type":"string"},"kind":{"default":"buyer","enum":["buyer","seller","both"],"type":"string"},"legalRegistrationType":{"enum":["TL","PAS","NI","EID"],"type":"string"},"name":{"minLength":1,"type":"string"},"passportIssuingCountry":{"maxLength":2,"minLength":2,"type":"string"},"phone":{"type":"string"},"tin":{"maxLength":32,"minLength":1,"type":"string"},"tradeLicenseNumber":{"maxLength":64,"minLength":1,"type":"string"},"tradingName":{"maxLength":200,"minLength":1,"type":"string"},"trn":{"pattern":"^[0-9]{15}$","type":"string"}},"required":["name","country"],"type":"object"},"tenderOrLotReference":{"maxLength":64,"minLength":1,"type":"string"},"transactionTypeCode":{"maxLength":64,"minLength":1,"type":"string"},"trn":{"description":"The connected SME's 15-digit UAE Tax Registration Number. Must match the TIN registered against your `x-erp-partner-secret`. Call `GET /v1/partner/whoami` with your connection secret attached to look up the SME's TRN programmatically. Test-mode shortcut: `100000000000000` always succeeds (bypasses the SME TRN check); `100000000000666` always rejects with 403 so you can exercise your rejection code path.","pattern":"^[0-9]{15}$","type":"string"},"vatPointDate":{"format":"date","type":"string"}},"required":["number","issueDate","buyer","seller","lines","trn"],"type":"object"},"maxItems":100,"minItems":1,"type":"array"}},"required":["invoices"],"type":"object"},"BulkResponse":{"properties":{"results":{"items":{"oneOf":[{"properties":{"externalRef":{"type":"string"},"index":{"type":"integer"},"invoiceId":{"format":"uuid","type":"string"},"number":{"type":"string"},"ok":{"enum":[true],"type":"boolean"},"status":{"type":"string"}},"required":["index","ok","invoiceId","number","status"],"type":"object"},{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"externalRef":{"type":"string"},"index":{"type":"integer"},"ok":{"enum":[false],"type":"boolean"}},"required":["index","ok","error"],"type":"object"}]},"type":"array"},"summary":{"properties":{"failed":{"type":"integer"},"ok":{"type":"integer"},"total":{"type":"integer"}},"required":["total","ok","failed"],"type":"object"}},"required":["results","summary"],"type":"object"},"CatalogVersionResponse":{"properties":{"catalogVersion":{"type":"string"},"generatedAt":{"format":"date-time","type":"string"}},"required":["catalogVersion","generatedAt"],"type":"object"},"Customer":{"properties":{"address":{"$ref":"#/components/schemas/Address"},"country":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"customerId":{"format":"uuid","type":"string"},"email":{"nullable":true,"type":"string"},"externalRef":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"phone":{"nullable":true,"type":"string"},"trn":{"nullable":true,"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["customerId","externalRef","name","kind","country","createdAt","updatedAt"],"type":"object"},"CustomerUpsertBody":{"additionalProperties":false,"properties":{"address":{"additionalProperties":false,"properties":{"city":{"maxLength":100,"type":"string"},"country":{"default":"AE","maxLength":2,"minLength":2,"type":"string"},"emirate":{"maxLength":50,"type":"string"},"line1":{"maxLength":200,"type":"string"},"line2":{"maxLength":200,"type":"string"},"postalCode":{"maxLength":20,"type":"string"}},"type":"object"},"country":{"default":"AE","maxLength":2,"minLength":2,"type":"string"},"email":{"format":"email","type":["string","null"]},"externalRef":{"maxLength":128,"minLength":1,"type":"string"},"kind":{"default":"buyer","enum":["buyer","seller","both"],"type":"string"},"name":{"maxLength":300,"minLength":1,"type":"string"},"phone":{"maxLength":30,"type":["string","null"]},"trn":{"pattern":"^\\d{15}$","type":["string","null"]}},"required":["externalRef","name"],"type":"object"},"DeliveryAddress":{"description":"Delivery location + actual delivery date for export / cross-border transactions. All sub-fields are optional at the API boundary; the pre-submit validator enforces the CM-mandatory rules keyed on `transactionTypeCode`.","properties":{"actualDeliveryDate":{"description":"<!-- catalog --> **O** · `IBT-058` · `cac:Delivery / cbc:ActualDeliveryDate`\n\n→ `GET /v1/partner/field-schema/delivery.actualDate` for full detail.","format":"date","type":"string","x-trustbill-catalog-key":"delivery.actualDate","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-actualDate","x-trustbill-fta-key":"IBT-058","x-trustbill-source":"manual"},"city":{"description":"<!-- catalog --> **O** · `IBT-062` · `cac:DeliveryAddress / cbc:CityName`\n\n→ `GET /v1/partner/field-schema/delivery.city` for full detail.","maxLength":100,"minLength":1,"type":"string","x-trustbill-catalog-key":"delivery.city","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-city","x-trustbill-fta-key":"IBT-062","x-trustbill-source":"manual"},"country":{"description":"<!-- catalog --> **O** · `IBT-065` · `cac:DeliveryAddress / cac:Country / cbc:IdentificationCode`\n\nValidation:\n  - custom validator `delivery.countryCodeCannotBeAeOnExport`\n\n→ `GET /v1/partner/field-schema/delivery.countryCode` for full detail.","maxLength":2,"minLength":2,"type":"string","x-trustbill-catalog-key":"delivery.countryCode","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-countryCode","x-trustbill-fta-key":"IBT-065","x-trustbill-source":"manual"},"countrySubdivision":{"description":"<!-- catalog --> **O** · `IBT-064` · `cac:DeliveryAddress / cbc:CountrySubentity`\n\nValidation:\n  - custom validator `delivery.subdivisionMutualExclusion`\n  - custom validator `delivery.subdivisionRequiredWhenNonAe`\n\n→ `GET /v1/partner/field-schema/delivery.countrySubdivision` for full detail.","maxLength":100,"minLength":1,"type":"string","x-trustbill-catalog-key":"delivery.countrySubdivision","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-countrySubdivision","x-trustbill-fta-key":"IBT-064","x-trustbill-source":"manual"},"line1":{"description":"<!-- catalog --> **O** · `IBT-059` · `cac:DeliveryAddress / cbc:StreetName`\n\n→ `GET /v1/partner/field-schema/delivery.addressLine1` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"delivery.addressLine1","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-addressLine1","x-trustbill-fta-key":"IBT-059","x-trustbill-source":"manual"},"line2":{"description":"<!-- catalog --> **O** · `IBT-060` · `cac:DeliveryAddress / cbc:AdditionalStreetName`\n\n→ `GET /v1/partner/field-schema/delivery.addressLine2` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"delivery.addressLine2","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-addressLine2","x-trustbill-fta-key":"IBT-060","x-trustbill-source":"manual"},"line3":{"description":"<!-- catalog --> **O** · `IBT-061` · `cac:DeliveryAddress / cbc:AddressLine`\n\n→ `GET /v1/partner/field-schema/delivery.addressLine3` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"delivery.addressLine3","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-addressLine3","x-trustbill-fta-key":"IBT-061","x-trustbill-source":"manual"},"locationIdentifier":{"description":"<!-- catalog --> **O** · `IBT-056` · `cac:Delivery / cac:DeliveryLocation / cbc:ID`\n\n→ `GET /v1/partner/field-schema/delivery.locationIdentifier` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"delivery.locationIdentifier","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-locationIdentifier","x-trustbill-fta-key":"IBT-056","x-trustbill-source":"manual"},"locationSchemeIdentifier":{"description":"<!-- catalog --> **O** · `IBT-057` · `cac:DeliveryLocation / cbc:ID@schemeID`\n\n→ `GET /v1/partner/field-schema/delivery.locationSchemeIdentifier` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"delivery.locationSchemeIdentifier","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-locationSchemeIdentifier","x-trustbill-fta-key":"IBT-057","x-trustbill-source":"manual"},"partyName":{"description":"<!-- catalog --> **O** · `IBT-055` · `cac:Delivery / cac:DeliveryParty / cbc:Name`\n\n→ `GET /v1/partner/field-schema/delivery.partyName` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"delivery.partyName","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-partyName","x-trustbill-fta-key":"IBT-055","x-trustbill-source":"manual"},"postalCode":{"description":"<!-- catalog --> **O** · `IBT-063` · `cac:DeliveryAddress / cbc:PostalZone`\n\n→ `GET /v1/partner/field-schema/delivery.postalCode` for full detail.","maxLength":20,"minLength":1,"type":"string","x-trustbill-catalog-key":"delivery.postalCode","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-delivery-postalCode","x-trustbill-fta-key":"IBT-063","x-trustbill-source":"manual"},"state":{"maxLength":4,"minLength":1,"type":"string"}},"type":"object"},"ErrorCode":{"properties":{"category":{"enum":["authentication","validation","rate_limit","not_found","conflict","server","vendor"],"type":"string"},"code":{"type":"string"},"detail":{"type":"string"},"docUrl":{"type":"string"},"httpStatus":{"maximum":599,"minimum":400,"type":"integer"},"retriable":{"type":"boolean"},"title":{"type":"string"}},"required":["code","category","httpStatus","title","detail","retriable","docUrl"],"type":"object"},"ErrorCodesResponse":{"properties":{"catalogVersion":{"type":"string"},"errorCodes":{"items":{"$ref":"#/components/schemas/ErrorCode"},"type":"array"},"generatedAt":{"format":"date-time","type":"string"},"locale":{"enum":["en","ar"],"type":"string"}},"required":["catalogVersion","locale","generatedAt","errorCodes"],"type":"object"},"FieldSchemaOneResponse":{"properties":{"catalogVersion":{"type":"string"},"field":{"$ref":"#/components/schemas/FieldSchemaRow"}},"required":["catalogVersion","field"],"type":"object"},"FieldSchemaResponse":{"properties":{"catalogVersion":{"type":"string"},"etag":{"type":"string"},"fields":{"items":{"$ref":"#/components/schemas/FieldSchemaRow"},"type":"array"},"generatedAt":{"format":"date-time","type":"string"},"locale":{"enum":["en","ar"],"type":"string"},"partner":{"type":"string"}},"required":["catalogVersion","partner","locale","generatedAt","etag","fields"],"type":"object"},"FieldSchemaRow":{"properties":{"adapter":{"properties":{"microvista":{"type":"string"},"partnerBinding":{"nullable":true,"properties":{"forced":{"type":"boolean"},"sourcePath":{"type":"string"},"transform":{"nullable":true,"type":"string"}},"type":"object"}},"required":["microvista","partnerBinding"],"type":"object"},"class":{"enum":["M","CM","O"],"type":"string"},"computedFormulaI18nKey":{"nullable":true,"type":"string"},"deprecatedIn":{"nullable":true,"type":"string"},"deprecatedReason":{"nullable":true,"type":"string"},"docUrl":{"type":"string"},"errorCodes":{"description":"Pre-indexed rules[].code list for fast error-to-field lookup.","items":{"type":"string"},"type":"array"},"example":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"ftaKey":{"type":"string"},"helpI18nKey":{"type":"string"},"input":{"description":"Form-input descriptor (text / number / date / select / boolean / block / codeLookup).","type":"object"},"introducedIn":{"nullable":true,"type":"string"},"key":{"type":"string"},"labelI18nKey":{"type":"string"},"order":{"type":"integer"},"partnerApiAddressable":{"description":"Whether a partner can SEND this field on POST /v1/partner/invoices (`addressable`) or TrustBill fills it server-side (`server_computed`). Derived deterministically from the catalog × the request-body zod — no author toggle.","enum":["addressable","server_computed"],"type":"string"},"profileKey":{"nullable":true,"type":"string"},"replacementKey":{"nullable":true,"type":"string"},"rules":{"description":"Declarative rule bodies — same shape the live validator runs.","items":{"type":"object"},"type":"array"},"section":{"type":"string"},"source":{"properties":{"default":{"enum":["erp","profile","computed","industry","manual"],"type":"string"},"effective":{"enum":["erp","profile","computed","industry","manual"],"type":"string"}},"required":["default","effective"],"type":"object"},"trigger":{"nullable":true,"type":"string"},"ublKey":{"type":"string"},"zodPath":{"type":"string"}},"required":["key","section","order","class","ftaKey","ublKey","zodPath","source","input","rules","errorCodes","labelI18nKey","helpI18nKey","docUrl","adapter","example","partnerApiAddressable"],"type":"object"},"InvoiceCreateBody":{"description":"`required` here is the **base** shape — the controller runs the pre-submit catalog validator too, which enforces Conditional-Mandatory (CM) rules (e.g. buyer address + authority for UAE trade-licence parties, serviceAccountingCode for services lines, VAT exemption reason when transactionTypeCode is `EXEMPT`). Call `POST /v1/partner/invoices/validate` with a candidate body to see the full error list before `POST /v1/partner/invoices` so you fix every field at once. The field-schema endpoint (`GET /v1/partner/field-schema`) returns the authoritative M / CM / O classification per field.","example":{"actualDeliveryDate":"2026-10-30","buyer":{"address":{"city":"Abu Dhabi","country":"AE","countrySubdivision":"Abu Dhabi","emirate":"Abu Dhabi","line1":"Al Reem Island, Marina Square","line2":"Tower B","postalCode":"00000","state":"AUH"},"authorityName":"FTA","country":"AE","electronicAddress":"ap@buyer.ae","electronicAddressSchemeId":"EM","email":"ap@buyer.ae","kind":"buyer","legalRegistrationType":"TL","name":"Buyer Company LLC","phone":"+971-2-7654321","tin":"100000160500003","tradeLicenseNumber":"DED-654321","tradingName":"Buyer Co","trn":"100000160500003"},"contractReference":"CTR-2026-0421","contractValue":500000,"creditNoteReasonCode":"01","currency":"AED","customsReferenceNumber":"CDN-2026-0001","deliveryAddressLine1":"Plot 12, Sheikh Zayed Road","deliveryAddressLine2":"Zone 3","deliveryAddressLine3":"Building 42","deliveryCity":"Dubai","deliveryCountryCode":"AE","deliveryCountrySubdivision":"Dubai","deliveryLocationIdentifier":"LOC-5500","deliveryLocationSchemeIdentifier":"0088","deliveryPartyName":"Al Noor Warehouse","deliveryPostalCode":"00000","deliveryStateCode":"DXB","docAllowancesAmount":50,"docAllowancesReason":"Volume discount","docAllowancesVatCategory":"S","docAllowancesVatRate":0.05,"docChargesAmount":25,"docChargesReason":"Freight surcharge","docChargesVatCategory":"S","docChargesVatRate":0.05,"documentType":"tax_invoice","dueDate":"2026-11-29","frequencyOfBilling":"monthly","incoterms":"DAP Dubai","invoiceNote":"Payment due within 30 days from issue date.","invoiceType":"sale","invoicingPeriodEndDate":"2026-10-31","invoicingPeriodStartDate":"2026-10-01","issueDate":"2026-10-29","lines":[{"allowanceAmount":10,"allowanceReason":"Loyalty rebate","attributeName":"Period","attributeValue":"October 2026","chargeAmount":5,"chargeReason":"Handling","countryOfOrigin":"AE","description":"Consulting services — October 2026","itemType":"services","name":"Consulting — Oct 2026","priceBaseQuantity":1,"priceDiscount":0,"quantity":10,"serviceAccountingCode":"998311","standardIdentifier":"SKU-CONS-OCT","taxCategory":"standard_5","unitOfMeasureCode":"HUR","unitPrice":500,"vatRate":0.05}],"number":"INV-2026-0001","paymentAccountIdentifier":"AE070331234567890123456","paymentAccountName":"Al Noor Trading LLC","paymentAccountScheme":"IBAN","paymentMeansCode":"30","paymentServiceProviderIdentifier":"EBILAEAD","precedingInvoiceIssueDate":"2025-10-01","precedingInvoiceNumber":"INV-2025-999","precedingInvoiceReference":"INV-2025-999","principleId":"principal-ref-01","projectReference":"PRJ-2026-99","purchaseOrderReference":"PO-2026-5500","receivingAdviceReference":"RAD-2026-0100","salesOrderReference":"SO-2026-5500","seller":{"address":{"city":"Dubai","country":"AE","countrySubdivision":"Dubai","emirate":"Dubai","line1":"Office 2201, Boulevard Plaza Tower 1","line2":"Sheikh Mohammed Bin Rashid Boulevard","postalCode":"00000","state":"DXB"},"authorityName":"FTA","country":"AE","electronicAddress":"ops@alnoor.ae","electronicAddressSchemeId":"EM","email":"ops@alnoor.ae","kind":"seller","legalRegistrationType":"TL","name":"Al Noor Trading LLC","passportIssuingCountry":"AE","phone":"+971-4-1234567","tin":"100000000000003","tradeLicenseNumber":"DED-123456","tradingName":"Al Noor","trn":"100000000000003"},"tenderOrLotReference":"TND-2026-0005","transactionTypeCode":"0100000A","trn":"100000000000003","vatPointDate":"2026-10-29"},"properties":{"buyer":{"properties":{"address":{"properties":{"city":{"description":"<!-- catalog --> **M** · `IBT-049` · `cac:PostalAddress / cbc:CityName`\n\n→ `GET /v1/partner/field-schema/buyer.address.city` for full detail.","type":"string","x-trustbill-catalog-key":"buyer.address.city","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-city","x-trustbill-fta-key":"IBT-049","x-trustbill-source":"erp"},"countrySubdivision":{"description":"<!-- catalog --> **CM** · `IBT-051` · `cac:PostalAddress / cbc:CountrySubentity`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.address.countrySubdivision` for full detail.","maxLength":100,"minLength":1,"type":"string","x-trustbill-catalog-key":"buyer.address.countrySubdivision","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-countrySubdivision","x-trustbill-fta-key":"IBT-051","x-trustbill-source":"profile"},"emirate":{"type":"string"},"line1":{"description":"<!-- catalog --> **M** · `IBT-048` · `cac:PostalAddress / cbc:StreetName`\n\n→ `GET /v1/partner/field-schema/buyer.address.line1` for full detail.","type":"string","x-trustbill-catalog-key":"buyer.address.line1","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-line1","x-trustbill-fta-key":"IBT-048","x-trustbill-source":"erp"},"line2":{"description":"<!-- catalog --> **O** · `IBT-048` · `cac:PostalAddress / cbc:AdditionalStreetName`\n\n→ `GET /v1/partner/field-schema/buyer.address.line2` for full detail.","type":"string","x-trustbill-catalog-key":"buyer.address.line2","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-line2","x-trustbill-fta-key":"IBT-048","x-trustbill-source":"profile"},"postalCode":{"description":"<!-- catalog --> **O** · `IBT-050` · `cac:PostalAddress / cbc:PostalZone`\n\n→ `GET /v1/partner/field-schema/buyer.address.postalCode` for full detail.","type":"string","x-trustbill-catalog-key":"buyer.address.postalCode","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-postalCode","x-trustbill-fta-key":"IBT-050","x-trustbill-source":"erp"},"state":{"description":"<!-- catalog --> **CM** · `IBT-051` · `cac:PostalAddress / cbc:CountrySubentity`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - one of: AUH, DXB, SHJ, AJM, UAQ, RAK, FUJ\n\n→ `GET /v1/partner/field-schema/buyer.address.state` for full detail.\n\nUAE emirate code (Microvista uaeStateCodes, FTA IBT-063): AUH=Abu Dhabi, DXB=Dubai, SHJ=Sharjah, AJM=Ajman, UAQ=Umm Al Quwain, RAK=Ras Al Khaimah, FUJ=Fujairah.","enum":["AUH","DXB","SHJ","AJM","UAQ","RAK","FUJ"],"type":"string","x-trustbill-catalog-key":"buyer.address.state","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-state","x-trustbill-fta-key":"IBT-051","x-trustbill-source":"profile"}},"required":["line1","city"],"type":"object"},"authorityName":{"description":"<!-- catalog --> **CM** · `IBT-042` · `cac:PartyLegalEntity / cbc:CompanyLegalForm`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.authorityName` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"buyer.authorityName","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-authorityName","x-trustbill-fta-key":"IBT-042","x-trustbill-source":"profile"},"country":{"description":"<!-- catalog --> **M** · `IBT-052` · `cac:PostalAddress / cac:Country / cbc:IdentificationCode`\n\n→ `GET /v1/partner/field-schema/buyer.address.countryCode` for full detail.","maxLength":2,"minLength":2,"type":"string","x-trustbill-catalog-key":"buyer.address.countryCode","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-countryCode","x-trustbill-fta-key":"IBT-052","x-trustbill-source":"erp"},"electronicAddress":{"description":"<!-- catalog --> **M** · `IBT-046` · `cbc:EndpointID`\n\n→ `GET /v1/partner/field-schema/buyer.electronicAddress` for full detail.","maxLength":128,"minLength":1,"type":"string","x-trustbill-catalog-key":"buyer.electronicAddress","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-electronicAddress","x-trustbill-fta-key":"IBT-046","x-trustbill-source":"profile"},"electronicAddressSchemeId":{"description":"<!-- catalog --> **M** · `IBT-045` · `cbc:EndpointID@schemeID`\n\n→ `GET /v1/partner/field-schema/buyer.electronicAddressSchemeId` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"buyer.electronicAddressSchemeId","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-electronicAddressSchemeId","x-trustbill-fta-key":"IBT-045","x-trustbill-source":"profile"},"email":{"description":"<!-- catalog --> **O** · `IBT-053` · `cac:Contact / cbc:ElectronicMail`\n\n→ `GET /v1/partner/field-schema/buyer.email` for full detail.","format":"email","type":"string","x-trustbill-catalog-key":"buyer.email","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-email","x-trustbill-fta-key":"IBT-053","x-trustbill-source":"erp"},"id":{"format":"uuid","type":"string"},"kind":{"default":"buyer","enum":["buyer","seller","both"],"type":"string"},"legalRegistrationType":{"description":"<!-- catalog --> **CM** · `IBT-041` · `cac:PartyLegalEntity / cbc:CompanyID@schemeID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.legalRegistrationType` for full detail.","enum":["TL","PAS","NI","EID"],"type":"string","x-trustbill-catalog-key":"buyer.legalRegistrationType","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-legalRegistrationType","x-trustbill-fta-key":"IBT-041","x-trustbill-source":"profile"},"name":{"description":"<!-- catalog --> **M** · `IBT-036` · `cac:AccountingCustomerParty / cbc:RegistrationName`\n\n→ `GET /v1/partner/field-schema/buyer.name` for full detail.","minLength":1,"type":"string","x-trustbill-catalog-key":"buyer.name","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-name","x-trustbill-fta-key":"IBT-036","x-trustbill-source":"erp"},"passportIssuingCountry":{"description":"<!-- catalog --> **CM** · `IBT-043` · `cac:PartyLegalEntity / cbc:Country`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.passportIssuingCountry` for full detail.","maxLength":2,"minLength":2,"type":"string","x-trustbill-catalog-key":"buyer.passportIssuingCountry","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-passportIssuingCountry","x-trustbill-fta-key":"IBT-043","x-trustbill-source":"profile"},"phone":{"description":"<!-- catalog --> **O** · `IBT-054` · `cac:Contact / cbc:Telephone`\n\n→ `GET /v1/partner/field-schema/buyer.phone` for full detail.","type":"string","x-trustbill-catalog-key":"buyer.phone","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-phone","x-trustbill-fta-key":"IBT-054","x-trustbill-source":"profile"},"tin":{"description":"<!-- catalog --> **CM** · `IBT-044` · `cac:PartyTaxScheme / cbc:CompanyID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.tin` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"buyer.tin","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-tin","x-trustbill-fta-key":"IBT-044","x-trustbill-source":"profile"},"tradeLicenseNumber":{"description":"<!-- catalog --> **CM** · `IBT-040` · `cac:PartyLegalEntity / cbc:CompanyID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.tradeLicenseNumber` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"buyer.tradeLicenseNumber","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-tradeLicenseNumber","x-trustbill-fta-key":"IBT-040","x-trustbill-source":"profile"},"tradingName":{"description":"<!-- catalog --> **O** · `IBT-037` · `cac:PartyName / cbc:Name`\n\n→ `GET /v1/partner/field-schema/buyer.tradingName` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"buyer.tradingName","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-tradingName","x-trustbill-fta-key":"IBT-037","x-trustbill-source":"profile"},"trn":{"description":"<!-- catalog --> **M** · `IBT-044` · `cac:PartyTaxScheme / cbc:CompanyID`\n\nValidation:\n  - regex `^[0-9]{15}$`\n\n→ `GET /v1/partner/field-schema/buyer.trn` for full detail.","pattern":"^[0-9]{15}$","type":"string","x-trustbill-catalog-key":"buyer.trn","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-trn","x-trustbill-fta-key":"IBT-044","x-trustbill-source":"erp"}},"required":["name","country"],"type":"object"},"contractReference":{"description":"<!-- catalog --> **O** · `IBT-014` · `cac:ContractDocumentReference / cbc:ID`\n\n→ `GET /v1/partner/field-schema/other.contractReference` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"other.contractReference","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-contractReference","x-trustbill-fta-key":"IBT-014","x-trustbill-source":"manual"},"contractValue":{"description":"<!-- catalog --> **O** · `IBT-015` · `cac:ContractDocumentReference / cbc:Amount`\n\n→ `GET /v1/partner/field-schema/other.contractValue` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"other.contractValue","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-contractValue","x-trustbill-fta-key":"IBT-015","x-trustbill-source":"manual"},"creditNoteReasonCode":{"description":"<!-- catalog --> **CM** · `IBT-008` · `cac:BillingReference / cbc:ReasonCode`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/doc.creditNoteReasonCode` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"doc.creditNoteReasonCode","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-doc-creditNoteReasonCode","x-trustbill-fta-key":"IBT-008","x-trustbill-source":"manual"},"currency":{"default":"AED","description":"<!-- catalog --> **M** · `IBT-005` · `cbc:DocumentCurrencyCode`\n\n→ `GET /v1/partner/field-schema/doc.currencyCode` for full detail.","enum":["AED"],"type":"string","x-trustbill-catalog-key":"doc.currencyCode","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-doc-currencyCode","x-trustbill-fta-key":"IBT-005","x-trustbill-source":"erp"},"customsReferenceNumber":{"description":"<!-- catalog --> **O** · `IBT-200` · `cac:AdditionalDocumentReference[@typeCode='50'] / cbc:ID`\n\n→ `GET /v1/partner/field-schema/other.customsReferenceNumber` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"other.customsReferenceNumber","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-customsReferenceNumber","x-trustbill-fta-key":"IBT-200","x-trustbill-source":"manual"},"deliveryAddress":{"$ref":"#/components/schemas/DeliveryAddress"},"docAllowancesAmount":{"description":"<!-- catalog --> **O** · `IBT-097` · `cac:AllowanceCharge[ChargeIndicator=false] / cbc:Amount`\n\n→ `GET /v1/partner/field-schema/totals.docAllowances` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"totals.docAllowances","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docAllowances","x-trustbill-fta-key":"IBT-097","x-trustbill-source":"manual"},"docAllowancesReason":{"description":"<!-- catalog --> **CM** · `IBT-098` · `cac:AllowanceCharge / cbc:AllowanceChargeReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/totals.docAllowancesReason` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"totals.docAllowancesReason","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docAllowancesReason","x-trustbill-fta-key":"IBT-098","x-trustbill-source":"manual"},"docAllowancesVatCategory":{"description":"<!-- catalog --> **CM** · `IBT-098` · `cac:AllowanceCharge / cac:TaxCategory / cbc:ID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/totals.docAllowancesVatCategory` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"totals.docAllowancesVatCategory","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docAllowancesVatCategory","x-trustbill-fta-key":"IBT-098","x-trustbill-source":"manual"},"docAllowancesVatExemptReason":{"description":"<!-- catalog --> **CM** · `IBT-100` · `cac:AllowanceCharge / cac:TaxCategory / cbc:TaxExemptionReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/totals.docAllowancesVatExemptReason` for full detail.","maxLength":500,"minLength":1,"type":"string","x-trustbill-catalog-key":"totals.docAllowancesVatExemptReason","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docAllowancesVatExemptReason","x-trustbill-fta-key":"IBT-100","x-trustbill-source":"manual"},"docAllowancesVatRate":{"description":"<!-- catalog --> **CM** · `IBT-099` · `cac:AllowanceCharge / cac:TaxCategory / cbc:Percent`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/totals.docAllowancesVatRate` for full detail.","maximum":1,"minimum":0,"type":"number","x-trustbill-catalog-key":"totals.docAllowancesVatRate","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docAllowancesVatRate","x-trustbill-fta-key":"IBT-099","x-trustbill-source":"manual"},"docChargesAmount":{"description":"<!-- catalog --> **O** · `IBT-093` · `cac:AllowanceCharge[ChargeIndicator=true] / cbc:Amount`\n\n→ `GET /v1/partner/field-schema/totals.docCharges` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"totals.docCharges","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docCharges","x-trustbill-fta-key":"IBT-093","x-trustbill-source":"manual"},"docChargesReason":{"description":"<!-- catalog --> **CM** · `IBT-094` · `cac:AllowanceCharge / cbc:AllowanceChargeReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/totals.docChargesReason` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"totals.docChargesReason","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docChargesReason","x-trustbill-fta-key":"IBT-094","x-trustbill-source":"manual"},"docChargesVatCategory":{"description":"<!-- catalog --> **CM** · `IBT-094` · `cac:AllowanceCharge / cac:TaxCategory / cbc:ID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/totals.docChargesVatCategory` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"totals.docChargesVatCategory","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docChargesVatCategory","x-trustbill-fta-key":"IBT-094","x-trustbill-source":"manual"},"docChargesVatExemptReason":{"description":"<!-- catalog --> **CM** · `IBT-096` · `cac:AllowanceCharge / cac:TaxCategory / cbc:TaxExemptionReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/totals.docChargesVatExemptReason` for full detail.","maxLength":500,"minLength":1,"type":"string","x-trustbill-catalog-key":"totals.docChargesVatExemptReason","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docChargesVatExemptReason","x-trustbill-fta-key":"IBT-096","x-trustbill-source":"manual"},"docChargesVatRate":{"description":"<!-- catalog --> **CM** · `IBT-095` · `cac:AllowanceCharge / cac:TaxCategory / cbc:Percent`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/totals.docChargesVatRate` for full detail.","maximum":1,"minimum":0,"type":"number","x-trustbill-catalog-key":"totals.docChargesVatRate","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-totals-docChargesVatRate","x-trustbill-fta-key":"IBT-095","x-trustbill-source":"manual"},"documentType":{"description":"<!-- catalog --> **M** · `IBT-003` · `cbc:InvoiceTypeCode`\n\n→ `GET /v1/partner/field-schema/doc.documentType` for full detail.","enum":["tax_invoice","commercial_invoice","simplified_tax_invoice","credit_note","debit_note","self_billed_invoice"],"type":"string","x-trustbill-catalog-key":"doc.documentType","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-doc-documentType","x-trustbill-fta-key":"IBT-003","x-trustbill-source":"manual"},"dueDate":{"description":"<!-- catalog --> **CM** · `IBT-114` · `cbc:DueDate`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/payment.dueDate` for full detail.","format":"date","type":"string","x-trustbill-catalog-key":"payment.dueDate","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-payment-dueDate","x-trustbill-fta-key":"IBT-114","x-trustbill-source":"erp"},"frequencyOfBilling":{"description":"<!-- catalog --> **O** · `IBT-011` · `cac:InvoicePeriod / cbc:Description`\n\n→ `GET /v1/partner/field-schema/other.frequencyOfBilling` for full detail.","enum":["daily","weekly","monthly","quarterly","yearly","other"],"type":"string","x-trustbill-catalog-key":"other.frequencyOfBilling","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-frequencyOfBilling","x-trustbill-fta-key":"IBT-011","x-trustbill-source":"manual"},"incoterms":{"description":"<!-- catalog --> **O** · `IBT-201` · `cac:DeliveryTerms / cbc:ID`\n\n→ `GET /v1/partner/field-schema/other.incoterms` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"other.incoterms","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-incoterms","x-trustbill-fta-key":"IBT-201","x-trustbill-source":"manual"},"invoiceNote":{"description":"<!-- catalog --> **CM** · `IBT-016` · `cbc:Note`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/other.invoiceNote` for full detail.","maxLength":1000,"minLength":1,"type":"string","x-trustbill-catalog-key":"other.invoiceNote","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-invoiceNote","x-trustbill-fta-key":"IBT-016","x-trustbill-source":"manual"},"invoiceType":{"default":"sale","enum":["sale","purchase"],"type":"string"},"invoicingPeriodEndDate":{"description":"<!-- catalog --> **CM** · `IBT-013` · `cac:InvoicePeriod / cbc:EndDate`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - custom validator `other.invoicingPeriodEndAfterStart`\n\n→ `GET /v1/partner/field-schema/other.invoicingPeriodEndDate` for full detail.","format":"date","type":"string","x-trustbill-catalog-key":"other.invoicingPeriodEndDate","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-invoicingPeriodEndDate","x-trustbill-fta-key":"IBT-013","x-trustbill-source":"manual"},"invoicingPeriodStartDate":{"description":"<!-- catalog --> **CM** · `IBT-012` · `cac:InvoicePeriod / cbc:StartDate`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/other.invoicingPeriodStartDate` for full detail.","format":"date","type":"string","x-trustbill-catalog-key":"other.invoicingPeriodStartDate","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-invoicingPeriodStartDate","x-trustbill-fta-key":"IBT-012","x-trustbill-source":"manual"},"issueDate":{"description":"<!-- catalog --> **M** · `IBT-002` · `cbc:IssueDate`\n\nValidation:\n  - date max=today\n\n→ `GET /v1/partner/field-schema/doc.issueDate` for full detail.","format":"date","type":"string","x-trustbill-catalog-key":"doc.issueDate","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-doc-issueDate","x-trustbill-fta-key":"IBT-002","x-trustbill-source":"erp"},"lines":{"items":{"properties":{"allowanceAmount":{"description":"<!-- catalog --> **O** · `IBT-081` · `cac:AllowanceCharge[ChargeIndicator=false] / cbc:Amount`\n\n→ `GET /v1/partner/field-schema/line.allowanceAmount` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"line.allowanceAmount","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-allowanceAmount","x-trustbill-fta-key":"IBT-081","x-trustbill-source":"manual"},"allowanceReason":{"description":"<!-- catalog --> **CM** · `IBT-081` · `cac:AllowanceCharge / cbc:AllowanceChargeReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.allowanceReason` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.allowanceReason","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-allowanceReason","x-trustbill-fta-key":"IBT-081","x-trustbill-source":"manual"},"attributeName":{"description":"<!-- catalog --> **CM** · `IBT-090` · `cac:Item / cac:AdditionalItemProperty / cbc:Name`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.attributeName` for full detail.","maxLength":100,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.attributeName","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-attributeName","x-trustbill-fta-key":"IBT-090","x-trustbill-source":"manual"},"attributeValue":{"description":"<!-- catalog --> **CM** · `IBT-091` · `cac:Item / cac:AdditionalItemProperty / cbc:Value`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.attributeValue` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.attributeValue","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-attributeValue","x-trustbill-fta-key":"IBT-091","x-trustbill-source":"manual"},"chargeAmount":{"description":"<!-- catalog --> **O** · `IBT-080` · `cac:AllowanceCharge[ChargeIndicator=true] / cbc:Amount`\n\n→ `GET /v1/partner/field-schema/line.chargeAmount` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"line.chargeAmount","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-chargeAmount","x-trustbill-fta-key":"IBT-080","x-trustbill-source":"manual"},"chargeReason":{"description":"<!-- catalog --> **CM** · `IBT-080` · `cac:AllowanceCharge / cbc:AllowanceChargeReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.chargeReason` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.chargeReason","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-chargeReason","x-trustbill-fta-key":"IBT-080","x-trustbill-source":"manual"},"classificationCode":{"description":"<!-- catalog --> **CM** · `IBT-070` · `cac:Item / cac:CommodityClassification / cbc:ItemClassificationCode`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - regex `^[0-9]{6,10}$`\n\n→ `GET /v1/partner/field-schema/line.classificationIdentifier` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.classificationIdentifier","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-classificationIdentifier","x-trustbill-fta-key":"IBT-070","x-trustbill-source":"manual"},"classificationScheme":{"description":"<!-- catalog --> **O** · `IBT-070` · `cac:Item / cac:CommodityClassification / cbc:ItemClassificationCode@listID`\n\nValidation:\n  - one of: HS\n\n→ `GET /v1/partner/field-schema/line.classificationScheme` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.classificationScheme","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-classificationScheme","x-trustbill-fta-key":"IBT-070","x-trustbill-source":"manual"},"countryOfOrigin":{"description":"<!-- catalog --> **O** · `IBT-089` · `cac:Item / cac:OriginCountry / cbc:IdentificationCode`\n\n→ `GET /v1/partner/field-schema/line.countryOfOrigin` for full detail.","maxLength":2,"minLength":2,"type":"string","x-trustbill-catalog-key":"line.countryOfOrigin","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-countryOfOrigin","x-trustbill-fta-key":"IBT-089","x-trustbill-source":"manual"},"description":{"description":"<!-- catalog --> **M** · `IBT-073` · `cac:Item / cbc:Description`\n\n→ `GET /v1/partner/field-schema/line.description` for full detail.","minLength":1,"type":"string","x-trustbill-catalog-key":"line.description","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-description","x-trustbill-fta-key":"IBT-073","x-trustbill-source":"erp"},"itemType":{"description":"<!-- catalog --> **M** · `IBT-067` · `cac:Item / cbc:Name`\n\n→ `GET /v1/partner/field-schema/line.itemType` for full detail.","enum":["goods","services","both"],"type":"string","x-trustbill-catalog-key":"line.itemType","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-itemType","x-trustbill-fta-key":"IBT-067","x-trustbill-source":"manual"},"name":{"description":"<!-- catalog --> **M** · `IBT-072` · `cac:Item / cbc:Name`\n\n→ `GET /v1/partner/field-schema/line.name` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.name","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-name","x-trustbill-fta-key":"IBT-072","x-trustbill-source":"manual"},"priceBaseQuantity":{"description":"<!-- catalog --> **M** · `IBT-074` · `cac:Price / cbc:BaseQuantity`\n\n→ `GET /v1/partner/field-schema/line.priceBaseQuantity` for full detail.","minimum":1,"type":"number","x-trustbill-catalog-key":"line.priceBaseQuantity","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-priceBaseQuantity","x-trustbill-fta-key":"IBT-074","x-trustbill-source":"manual"},"priceDiscount":{"description":"<!-- catalog --> **O** · `IBT-076` · `cac:Price / cac:AllowanceCharge / cbc:Amount`\n\n→ `GET /v1/partner/field-schema/line.priceDiscount` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"line.priceDiscount","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-priceDiscount","x-trustbill-fta-key":"IBT-076","x-trustbill-source":"manual"},"quantity":{"description":"<!-- catalog --> **M** · `IBT-078` · `cbc:InvoicedQuantity`\n\nValidation:\n  - range 1..+∞\n\n→ `GET /v1/partner/field-schema/line.quantity` for full detail.","exclusiveMinimum":0,"type":"number","x-trustbill-catalog-key":"line.quantity","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-quantity","x-trustbill-fta-key":"IBT-078","x-trustbill-source":"erp"},"serviceAccountingCode":{"description":"<!-- catalog --> **CM** · `IBT-071` · `cac:Item / cac:CommodityClassification / cbc:ItemClassificationCode@listID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - cross-field predicate\n\n→ `GET /v1/partner/field-schema/line.serviceAccountingCode` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.serviceAccountingCode","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-serviceAccountingCode","x-trustbill-fta-key":"IBT-071","x-trustbill-source":"manual"},"standardIdentifier":{"description":"<!-- catalog --> **CM** · `IBT-069` · `cac:Item / cac:StandardItemIdentification / cbc:ID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.standardIdentifier` for full detail.","maxLength":128,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.standardIdentifier","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-standardIdentifier","x-trustbill-fta-key":"IBT-069","x-trustbill-source":"manual"},"taxCategory":{"default":"standard_5","description":"<!-- catalog --> **M** · `IBT-083` · `cac:ClassifiedTaxCategory / cbc:ID`\n\nValidation:\n  - one of: standard_5, zero_rated_export, zero_rated_healthcare, zero_rated_education, exempt_financial, exempt_residential_rent, reverse_charge_designated_zone, reverse_charge_electronic_devices, reverse_charge_gold_diamonds, reverse_charge_crude_or_refined_oil, reverse_charge_natural_gas, reverse_charge_hydrocarbons, out_of_scope\n\n→ `GET /v1/partner/field-schema/line.taxCategory` for full detail.","enum":["standard_5","zero_rated_export","zero_rated_healthcare","zero_rated_education","exempt_financial","exempt_residential_rent","reverse_charge_designated_zone","reverse_charge_electronic_devices","reverse_charge_gold_diamonds","reverse_charge_crude_or_refined_oil","reverse_charge_natural_gas","reverse_charge_hydrocarbons","out_of_scope"],"type":"string","x-trustbill-catalog-key":"line.taxCategory","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-taxCategory","x-trustbill-fta-key":"IBT-083","x-trustbill-source":"erp"},"taxExemptionReasonCode":{"description":"<!-- catalog --> **CM** · `IBT-088` · `cac:TaxCategory / cbc:TaxExemptionReasonCode`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.taxExemptionReasonCode` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.taxExemptionReasonCode","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-taxExemptionReasonCode","x-trustbill-fta-key":"IBT-088","x-trustbill-source":"manual"},"taxExemptionReasonText":{"description":"<!-- catalog --> **CM** · `IBT-087` · `cac:TaxCategory / cbc:TaxExemptionReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.taxExemptionReasonText` for full detail.","maxLength":500,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.taxExemptionReasonText","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-taxExemptionReasonText","x-trustbill-fta-key":"IBT-087","x-trustbill-source":"manual"},"unitOfMeasureCode":{"description":"<!-- catalog --> **M** · `IBT-079` · `cbc:InvoicedQuantity@unitCode`\n\n→ `GET /v1/partner/field-schema/line.unitOfMeasureCode` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.unitOfMeasureCode","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-unitOfMeasureCode","x-trustbill-fta-key":"IBT-079","x-trustbill-source":"erp"},"unitPrice":{"description":"<!-- catalog --> **M** · `IBT-077` · `cac:Price / cbc:PriceAmount`\n\nValidation:\n  - range 0..+∞\n\n→ `GET /v1/partner/field-schema/line.netPrice` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"line.netPrice","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-netPrice","x-trustbill-fta-key":"IBT-077","x-trustbill-source":"erp"},"vatRate":{"description":"<!-- catalog --> **M** · `IBT-084` · `cac:ClassifiedTaxCategory / cbc:Percent`\n\nValidation:\n  - range 0..1\n  - custom validator `line.standardRateMustBe5`\n  - custom validator `line.rcmRateRequiredPositive`\n\n→ `GET /v1/partner/field-schema/line.taxRate` for full detail.\n\nVAT rate as a fraction between 0 and 1 (UAE standard 5% = 0.05, not 5).","maximum":1,"minimum":0,"type":"number","x-trustbill-catalog-key":"line.taxRate","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-taxRate","x-trustbill-fta-key":"IBT-084","x-trustbill-source":"erp"}},"required":["description","quantity","unitPrice","vatRate"],"type":"object"},"maxItems":200,"minItems":1,"type":"array"},"number":{"description":"<!-- catalog --> **M** · `IBT-001` · `cbc:ID`\n\n→ `GET /v1/partner/field-schema/doc.invoiceNumber` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"doc.invoiceNumber","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-doc-invoiceNumber","x-trustbill-fta-key":"IBT-001","x-trustbill-source":"erp"},"paymentAccountIdentifier":{"description":"<!-- catalog --> **CM** · `IBT-109` · `cac:PaymentMeans / cac:PayeeFinancialAccount / cbc:ID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/payment.accountIdentifier` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"payment.accountIdentifier","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-payment-accountIdentifier","x-trustbill-fta-key":"IBT-109","x-trustbill-source":"manual"},"paymentAccountName":{"description":"<!-- catalog --> **O** · `IBT-111` · `cac:PayeeFinancialAccount / cbc:Name`\n\n→ `GET /v1/partner/field-schema/payment.accountName` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"payment.accountName","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-payment-accountName","x-trustbill-fta-key":"IBT-111","x-trustbill-source":"manual"},"paymentAccountScheme":{"description":"<!-- catalog --> **CM** · `IBT-110` · `cac:PayeeFinancialAccount / cbc:ID@schemeID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/payment.schemeIdentifier` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"payment.schemeIdentifier","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-payment-schemeIdentifier","x-trustbill-fta-key":"IBT-110","x-trustbill-source":"manual"},"paymentCardHolderName":{"description":"<!-- catalog --> **CM** · `IBT-113` · `cac:PaymentMeans / cac:CardAccount / cbc:HolderName`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/payment.cardHolderName` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"payment.cardHolderName","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-payment-cardHolderName","x-trustbill-fta-key":"IBT-113","x-trustbill-source":"manual"},"paymentCardPan":{"description":"<!-- catalog --> **CM** · `IBT-113` · `cac:PaymentMeans / cac:CardAccount / cbc:PrimaryAccountNumberID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - regex `^[0-9]{4}$`\n\n→ `GET /v1/partner/field-schema/payment.cardPrimaryAccountNumber` for full detail.","pattern":"^[0-9]{4}$","type":"string","x-trustbill-catalog-key":"payment.cardPrimaryAccountNumber","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-payment-cardPrimaryAccountNumber","x-trustbill-fta-key":"IBT-113","x-trustbill-source":"manual"},"paymentMeansCode":{"description":"<!-- catalog --> **CM** · `IBT-108` · `cac:PaymentMeans / cbc:PaymentMeansCode`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - one of: 1, 10, 20, 21, 30, 49, 54, 55, 68\n\n→ `GET /v1/partner/field-schema/payment.meansTypeCode` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"payment.meansTypeCode","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-payment-meansTypeCode","x-trustbill-fta-key":"IBT-108","x-trustbill-source":"manual"},"paymentNetworkId":{"description":"<!-- catalog --> **CM** · `IBT-113` · `cac:PaymentMeans / cac:CardAccount / cbc:NetworkID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/payment.networkId` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"payment.networkId","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-payment-networkId","x-trustbill-fta-key":"IBT-113","x-trustbill-source":"manual"},"paymentServiceProviderIdentifier":{"description":"<!-- catalog --> **O** · `IBT-112` · `cac:PayeeFinancialAccount / cac:FinancialInstitutionBranch / cbc:ID`\n\nValidation:\n  - length ≤ 10\n\n→ `GET /v1/partner/field-schema/payment.serviceProviderIdentifier` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"payment.serviceProviderIdentifier","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-payment-serviceProviderIdentifier","x-trustbill-fta-key":"IBT-112","x-trustbill-source":"manual"},"precedingInvoiceIssueDate":{"description":"<!-- catalog --> **CM** · `IBT-010` · `cac:BillingReference / cbc:IssueDate`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/doc.precedingInvoiceIssueDate` for full detail.","format":"date","type":"string","x-trustbill-catalog-key":"doc.precedingInvoiceIssueDate","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-doc-precedingInvoiceIssueDate","x-trustbill-fta-key":"IBT-010","x-trustbill-source":"manual"},"precedingInvoiceNumber":{"description":"<!-- catalog --> **CM** · `IBT-009` · `cac:BillingReference / cbc:ID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/doc.precedingInvoiceNumber` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"doc.precedingInvoiceNumber","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-doc-precedingInvoiceNumber","x-trustbill-fta-key":"IBT-009","x-trustbill-source":"manual"},"precedingInvoiceReference":{"maxLength":64,"minLength":1,"type":"string"},"principleId":{"description":"<!-- catalog --> **CM** · `IBT-017` · `cac:PayeeParty / cbc:ID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/other.principleId` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"other.principleId","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-principleId","x-trustbill-fta-key":"IBT-017","x-trustbill-source":"manual"},"projectReference":{"maxLength":64,"minLength":1,"type":"string"},"purchaseOrderReference":{"maxLength":64,"minLength":1,"type":"string"},"receivingAdviceReference":{"description":"<!-- catalog --> **O** · `IBT-204` · `cac:ReceiptDocumentReference / cbc:ID`\n\n→ `GET /v1/partner/field-schema/other.receivingAdviceReference` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"other.receivingAdviceReference","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-receivingAdviceReference","x-trustbill-fta-key":"IBT-204","x-trustbill-source":"manual"},"salesOrderReference":{"maxLength":64,"minLength":1,"type":"string"},"seller":{"properties":{"address":{"properties":{"city":{"description":"<!-- catalog --> **M** · `IBT-030` · `cac:PostalAddress / cbc:CityName`\n\n→ `GET /v1/partner/field-schema/seller.address.city` for full detail.","type":"string","x-trustbill-catalog-key":"seller.address.city","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-city","x-trustbill-fta-key":"IBT-030","x-trustbill-source":"profile"},"countrySubdivision":{"description":"<!-- catalog --> **CM** · `IBT-032` · `cac:PostalAddress / cbc:CountrySubentity`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/seller.address.countrySubdivision` for full detail.","maxLength":100,"minLength":1,"type":"string","x-trustbill-catalog-key":"seller.address.countrySubdivision","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-countrySubdivision","x-trustbill-fta-key":"IBT-032","x-trustbill-source":"profile"},"emirate":{"type":"string"},"line1":{"description":"<!-- catalog --> **M** · `IBT-028` · `cac:PostalAddress / cbc:StreetName`\n\n→ `GET /v1/partner/field-schema/seller.address.line1` for full detail.","type":"string","x-trustbill-catalog-key":"seller.address.line1","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-line1","x-trustbill-fta-key":"IBT-028","x-trustbill-source":"profile"},"line2":{"description":"<!-- catalog --> **O** · `IBT-029` · `cac:PostalAddress / cbc:AdditionalStreetName`\n\n→ `GET /v1/partner/field-schema/seller.address.line2` for full detail.","type":"string","x-trustbill-catalog-key":"seller.address.line2","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-line2","x-trustbill-fta-key":"IBT-029","x-trustbill-source":"profile"},"postalCode":{"description":"<!-- catalog --> **O** · `IBT-031` · `cac:PostalAddress / cbc:PostalZone`\n\n→ `GET /v1/partner/field-schema/seller.address.postalCode` for full detail.","type":"string","x-trustbill-catalog-key":"seller.address.postalCode","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-postalCode","x-trustbill-fta-key":"IBT-031","x-trustbill-source":"profile"},"state":{"description":"<!-- catalog --> **CM** · `IBT-032` · `cac:PostalAddress / cbc:CountrySubentity`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - one of: AUH, DXB, SHJ, AJM, UAQ, RAK, FUJ\n\n→ `GET /v1/partner/field-schema/seller.address.state` for full detail.\n\nUAE emirate code (Microvista uaeStateCodes, FTA IBT-063): AUH=Abu Dhabi, DXB=Dubai, SHJ=Sharjah, AJM=Ajman, UAQ=Umm Al Quwain, RAK=Ras Al Khaimah, FUJ=Fujairah.","enum":["AUH","DXB","SHJ","AJM","UAQ","RAK","FUJ"],"type":"string","x-trustbill-catalog-key":"seller.address.state","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-state","x-trustbill-fta-key":"IBT-032","x-trustbill-source":"profile"}},"required":["line1","city"],"type":"object"},"authorityName":{"description":"<!-- catalog --> **CM** · `IBT-022` · `cac:PartyLegalEntity / cbc:CompanyLegalForm`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/seller.authorityName` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"seller.authorityName","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-authorityName","x-trustbill-fta-key":"IBT-022","x-trustbill-source":"profile"},"country":{"description":"<!-- catalog --> **M** · `IBT-033` · `cac:PostalAddress / cac:Country / cbc:IdentificationCode`\n\n→ `GET /v1/partner/field-schema/seller.address.countryCode` for full detail.","maxLength":2,"minLength":2,"type":"string","x-trustbill-catalog-key":"seller.address.countryCode","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-countryCode","x-trustbill-fta-key":"IBT-033","x-trustbill-source":"erp"},"electronicAddress":{"description":"<!-- catalog --> **M** · `IBT-026` · `cbc:EndpointID`\n\n→ `GET /v1/partner/field-schema/seller.electronicAddress` for full detail.","maxLength":128,"minLength":1,"type":"string","x-trustbill-catalog-key":"seller.electronicAddress","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-electronicAddress","x-trustbill-fta-key":"IBT-026","x-trustbill-source":"profile"},"electronicAddressSchemeId":{"description":"<!-- catalog --> **M** · `IBT-027` · `cbc:EndpointID@schemeID`\n\n→ `GET /v1/partner/field-schema/seller.electronicAddressSchemeId` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"seller.electronicAddressSchemeId","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-electronicAddressSchemeId","x-trustbill-fta-key":"IBT-027","x-trustbill-source":"profile"},"email":{"description":"<!-- catalog --> **O** · `IBT-034` · `cac:Contact / cbc:ElectronicMail`\n\n→ `GET /v1/partner/field-schema/seller.email` for full detail.","format":"email","type":"string","x-trustbill-catalog-key":"seller.email","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-email","x-trustbill-fta-key":"IBT-034","x-trustbill-source":"profile"},"id":{"format":"uuid","type":"string"},"kind":{"default":"buyer","enum":["buyer","seller","both"],"type":"string"},"legalRegistrationType":{"description":"<!-- catalog --> **CM** · `IBT-021` · `cac:PartyLegalEntity / cbc:CompanyID@schemeID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/seller.legalRegistrationType` for full detail.","enum":["TL","PAS","NI","EID"],"type":"string","x-trustbill-catalog-key":"seller.legalRegistrationType","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-legalRegistrationType","x-trustbill-fta-key":"IBT-021","x-trustbill-source":"profile"},"name":{"description":"<!-- catalog --> **M** · `IBT-018` · `cac:AccountingSupplierParty / cbc:RegistrationName`\n\n→ `GET /v1/partner/field-schema/seller.name` for full detail.","minLength":1,"type":"string","x-trustbill-catalog-key":"seller.name","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-name","x-trustbill-fta-key":"IBT-018","x-trustbill-source":"profile"},"passportIssuingCountry":{"description":"<!-- catalog --> **CM** · `IBT-023` · `cac:PartyLegalEntity / cbc:Country`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/seller.passportIssuingCountry` for full detail.","maxLength":2,"minLength":2,"type":"string","x-trustbill-catalog-key":"seller.passportIssuingCountry","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-passportIssuingCountry","x-trustbill-fta-key":"IBT-023","x-trustbill-source":"profile"},"phone":{"description":"<!-- catalog --> **O** · `IBT-035` · `cac:Contact / cbc:Telephone`\n\n→ `GET /v1/partner/field-schema/seller.phone` for full detail.","type":"string","x-trustbill-catalog-key":"seller.phone","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-phone","x-trustbill-fta-key":"IBT-035","x-trustbill-source":"profile"},"tin":{"description":"<!-- catalog --> **CM** · `IBT-025` · `cac:PartyTaxScheme / cbc:CompanyID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/seller.tin` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"seller.tin","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-tin","x-trustbill-fta-key":"IBT-025","x-trustbill-source":"profile"},"tradeLicenseNumber":{"description":"<!-- catalog --> **CM** · `IBT-020` · `cac:PartyLegalEntity / cbc:CompanyID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/seller.tradeLicenseNumber` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"seller.tradeLicenseNumber","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-tradeLicenseNumber","x-trustbill-fta-key":"IBT-020","x-trustbill-source":"profile"},"tradingName":{"description":"<!-- catalog --> **O** · `IBT-019` · `cac:PartyName / cbc:Name`\n\n→ `GET /v1/partner/field-schema/seller.tradingName` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"seller.tradingName","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-tradingName","x-trustbill-fta-key":"IBT-019","x-trustbill-source":"profile"},"trn":{"description":"<!-- catalog --> **CM** · `IBT-024` · `cac:PartyTaxScheme / cbc:CompanyID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - regex `^[0-9]{15}$`\n\n→ `GET /v1/partner/field-schema/seller.trn` for full detail.","pattern":"^[0-9]{15}$","type":"string","x-trustbill-catalog-key":"seller.trn","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-seller-trn","x-trustbill-fta-key":"IBT-024","x-trustbill-source":"profile"}},"required":["name","country"],"type":"object"},"tenderOrLotReference":{"description":"<!-- catalog --> **O** · `IBT-203` · `cac:OriginatorDocumentReference / cbc:ID`\n\n→ `GET /v1/partner/field-schema/other.tenderOrLotReference` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"other.tenderOrLotReference","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-other-tenderOrLotReference","x-trustbill-fta-key":"IBT-203","x-trustbill-source":"manual"},"transactionTypeCode":{"description":"<!-- catalog --> **M** · `IBT-004` · `cbc:InvoiceTypeCode@listVersionID`\n\nValidation:\n  - regex `^[0-9A-Z]{8}$`\n\n→ `GET /v1/partner/field-schema/doc.transactionTypeCode` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":"doc.transactionTypeCode","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-doc-transactionTypeCode","x-trustbill-fta-key":"IBT-004","x-trustbill-source":"manual"},"trn":{"description":"The connected SME's 15-digit UAE Tax Registration Number. Must match the TIN registered against your `x-erp-partner-secret`. Call `GET /v1/partner/whoami` with your connection secret attached to look up the SME's TRN programmatically. Test-mode shortcut: `100000000000000` always succeeds (bypasses the SME TRN check); `100000000000666` always rejects with 403 so you can exercise your rejection code path.","pattern":"^[0-9]{15}$","type":"string"},"vatPointDate":{"format":"date","type":"string"}},"required":["number","issueDate","buyer","seller","lines","trn"],"type":"object"},"InvoiceLine":{"properties":{"allowanceAmount":{"description":"<!-- catalog --> **O** · `IBT-081` · `cac:AllowanceCharge[ChargeIndicator=false] / cbc:Amount`\n\n→ `GET /v1/partner/field-schema/line.allowanceAmount` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"line.allowanceAmount","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-allowanceAmount","x-trustbill-fta-key":"IBT-081","x-trustbill-source":"manual"},"allowanceReason":{"description":"<!-- catalog --> **CM** · `IBT-081` · `cac:AllowanceCharge / cbc:AllowanceChargeReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.allowanceReason` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.allowanceReason","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-allowanceReason","x-trustbill-fta-key":"IBT-081","x-trustbill-source":"manual"},"attributeName":{"description":"<!-- catalog --> **CM** · `IBT-090` · `cac:Item / cac:AdditionalItemProperty / cbc:Name`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.attributeName` for full detail.","maxLength":100,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.attributeName","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-attributeName","x-trustbill-fta-key":"IBT-090","x-trustbill-source":"manual"},"attributeValue":{"description":"<!-- catalog --> **CM** · `IBT-091` · `cac:Item / cac:AdditionalItemProperty / cbc:Value`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.attributeValue` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.attributeValue","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-attributeValue","x-trustbill-fta-key":"IBT-091","x-trustbill-source":"manual"},"chargeAmount":{"description":"<!-- catalog --> **O** · `IBT-080` · `cac:AllowanceCharge[ChargeIndicator=true] / cbc:Amount`\n\n→ `GET /v1/partner/field-schema/line.chargeAmount` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"line.chargeAmount","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-chargeAmount","x-trustbill-fta-key":"IBT-080","x-trustbill-source":"manual"},"chargeReason":{"description":"<!-- catalog --> **CM** · `IBT-080` · `cac:AllowanceCharge / cbc:AllowanceChargeReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.chargeReason` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.chargeReason","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-chargeReason","x-trustbill-fta-key":"IBT-080","x-trustbill-source":"manual"},"classificationCode":{"description":"<!-- catalog --> **CM** · `IBT-070` · `cac:Item / cac:CommodityClassification / cbc:ItemClassificationCode`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - regex `^[0-9]{6,10}$`\n\n→ `GET /v1/partner/field-schema/line.classificationIdentifier` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.classificationIdentifier","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-classificationIdentifier","x-trustbill-fta-key":"IBT-070","x-trustbill-source":"manual"},"classificationScheme":{"description":"<!-- catalog --> **O** · `IBT-070` · `cac:Item / cac:CommodityClassification / cbc:ItemClassificationCode@listID`\n\nValidation:\n  - one of: HS\n\n→ `GET /v1/partner/field-schema/line.classificationScheme` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.classificationScheme","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-classificationScheme","x-trustbill-fta-key":"IBT-070","x-trustbill-source":"manual"},"countryOfOrigin":{"description":"<!-- catalog --> **O** · `IBT-089` · `cac:Item / cac:OriginCountry / cbc:IdentificationCode`\n\n→ `GET /v1/partner/field-schema/line.countryOfOrigin` for full detail.","maxLength":2,"minLength":2,"type":"string","x-trustbill-catalog-key":"line.countryOfOrigin","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-countryOfOrigin","x-trustbill-fta-key":"IBT-089","x-trustbill-source":"manual"},"description":{"description":"<!-- catalog --> **M** · `IBT-073` · `cac:Item / cbc:Description`\n\n→ `GET /v1/partner/field-schema/line.description` for full detail.","minLength":1,"type":"string","x-trustbill-catalog-key":"line.description","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-description","x-trustbill-fta-key":"IBT-073","x-trustbill-source":"erp"},"itemType":{"description":"<!-- catalog --> **M** · `IBT-067` · `cac:Item / cbc:Name`\n\n→ `GET /v1/partner/field-schema/line.itemType` for full detail.","enum":["goods","services","both"],"type":"string","x-trustbill-catalog-key":"line.itemType","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-itemType","x-trustbill-fta-key":"IBT-067","x-trustbill-source":"manual"},"name":{"description":"<!-- catalog --> **M** · `IBT-072` · `cac:Item / cbc:Name`\n\n→ `GET /v1/partner/field-schema/line.name` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.name","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-name","x-trustbill-fta-key":"IBT-072","x-trustbill-source":"manual"},"priceBaseQuantity":{"description":"<!-- catalog --> **M** · `IBT-074` · `cac:Price / cbc:BaseQuantity`\n\n→ `GET /v1/partner/field-schema/line.priceBaseQuantity` for full detail.","minimum":1,"type":"number","x-trustbill-catalog-key":"line.priceBaseQuantity","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-priceBaseQuantity","x-trustbill-fta-key":"IBT-074","x-trustbill-source":"manual"},"priceDiscount":{"description":"<!-- catalog --> **O** · `IBT-076` · `cac:Price / cac:AllowanceCharge / cbc:Amount`\n\n→ `GET /v1/partner/field-schema/line.priceDiscount` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"line.priceDiscount","x-trustbill-class":"O","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-priceDiscount","x-trustbill-fta-key":"IBT-076","x-trustbill-source":"manual"},"quantity":{"description":"<!-- catalog --> **M** · `IBT-078` · `cbc:InvoicedQuantity`\n\nValidation:\n  - range 1..+∞\n\n→ `GET /v1/partner/field-schema/line.quantity` for full detail.","exclusiveMinimum":0,"type":"number","x-trustbill-catalog-key":"line.quantity","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-quantity","x-trustbill-fta-key":"IBT-078","x-trustbill-source":"erp"},"serviceAccountingCode":{"description":"<!-- catalog --> **CM** · `IBT-071` · `cac:Item / cac:CommodityClassification / cbc:ItemClassificationCode@listID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - cross-field predicate\n\n→ `GET /v1/partner/field-schema/line.serviceAccountingCode` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.serviceAccountingCode","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-serviceAccountingCode","x-trustbill-fta-key":"IBT-071","x-trustbill-source":"manual"},"standardIdentifier":{"description":"<!-- catalog --> **CM** · `IBT-069` · `cac:Item / cac:StandardItemIdentification / cbc:ID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.standardIdentifier` for full detail.","maxLength":128,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.standardIdentifier","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-standardIdentifier","x-trustbill-fta-key":"IBT-069","x-trustbill-source":"manual"},"taxCategory":{"default":"standard_5","description":"<!-- catalog --> **M** · `IBT-083` · `cac:ClassifiedTaxCategory / cbc:ID`\n\nValidation:\n  - one of: standard_5, zero_rated_export, zero_rated_healthcare, zero_rated_education, exempt_financial, exempt_residential_rent, reverse_charge_designated_zone, reverse_charge_electronic_devices, reverse_charge_gold_diamonds, reverse_charge_crude_or_refined_oil, reverse_charge_natural_gas, reverse_charge_hydrocarbons, out_of_scope\n\n→ `GET /v1/partner/field-schema/line.taxCategory` for full detail.","enum":["standard_5","zero_rated_export","zero_rated_healthcare","zero_rated_education","exempt_financial","exempt_residential_rent","reverse_charge_designated_zone","reverse_charge_electronic_devices","reverse_charge_gold_diamonds","reverse_charge_crude_or_refined_oil","reverse_charge_natural_gas","reverse_charge_hydrocarbons","out_of_scope"],"type":"string","x-trustbill-catalog-key":"line.taxCategory","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-taxCategory","x-trustbill-fta-key":"IBT-083","x-trustbill-source":"erp"},"taxExemptionReasonCode":{"description":"<!-- catalog --> **CM** · `IBT-088` · `cac:TaxCategory / cbc:TaxExemptionReasonCode`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.taxExemptionReasonCode` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.taxExemptionReasonCode","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-taxExemptionReasonCode","x-trustbill-fta-key":"IBT-088","x-trustbill-source":"manual"},"taxExemptionReasonText":{"description":"<!-- catalog --> **CM** · `IBT-087` · `cac:TaxCategory / cbc:TaxExemptionReason`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/line.taxExemptionReasonText` for full detail.","maxLength":500,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.taxExemptionReasonText","x-trustbill-class":"CM","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-taxExemptionReasonText","x-trustbill-fta-key":"IBT-087","x-trustbill-source":"manual"},"unitOfMeasureCode":{"description":"<!-- catalog --> **M** · `IBT-079` · `cbc:InvoicedQuantity@unitCode`\n\n→ `GET /v1/partner/field-schema/line.unitOfMeasureCode` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":"line.unitOfMeasureCode","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-unitOfMeasureCode","x-trustbill-fta-key":"IBT-079","x-trustbill-source":"erp"},"unitPrice":{"description":"<!-- catalog --> **M** · `IBT-077` · `cac:Price / cbc:PriceAmount`\n\nValidation:\n  - range 0..+∞\n\n→ `GET /v1/partner/field-schema/line.netPrice` for full detail.","minimum":0,"type":"number","x-trustbill-catalog-key":"line.netPrice","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-netPrice","x-trustbill-fta-key":"IBT-077","x-trustbill-source":"erp"},"vatRate":{"description":"<!-- catalog --> **M** · `IBT-084` · `cac:ClassifiedTaxCategory / cbc:Percent`\n\nValidation:\n  - range 0..1\n  - custom validator `line.standardRateMustBe5`\n  - custom validator `line.rcmRateRequiredPositive`\n\n→ `GET /v1/partner/field-schema/line.taxRate` for full detail.\n\nVAT rate as a fraction between 0 and 1 (UAE standard 5% = 0.05, not 5).","maximum":1,"minimum":0,"type":"number","x-trustbill-catalog-key":"line.taxRate","x-trustbill-class":"M","x-trustbill-doc-url":"https://trustbill.ae/en/documentation/erp-partner-api#field-line-taxRate","x-trustbill-fta-key":"IBT-084","x-trustbill-source":"erp"}},"required":["description","quantity","unitPrice","vatRate"],"type":"object"},"InvoiceListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/InvoiceStatus"},"type":"array"},"nextCursor":{"nullable":true,"type":"string"}},"required":["data","nextCursor"],"type":"object"},"InvoiceParty":{"properties":{"address":{"properties":{"city":{"description":"<!-- catalog --> **M** · `IBT-049` · `cac:PostalAddress / cbc:CityName`\n\n→ `GET /v1/partner/field-schema/buyer.address.city` for full detail.","type":"string","x-trustbill-catalog-key":["buyer.address.city","seller.address.city"],"x-trustbill-class":["M","M"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-city","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-city"],"x-trustbill-fta-key":["IBT-049","IBT-030"],"x-trustbill-source":["erp","profile"]},"countrySubdivision":{"description":"<!-- catalog --> **CM** · `IBT-051` · `cac:PostalAddress / cbc:CountrySubentity`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.address.countrySubdivision` for full detail.","maxLength":100,"minLength":1,"type":"string","x-trustbill-catalog-key":["buyer.address.countrySubdivision","seller.address.countrySubdivision"],"x-trustbill-class":["CM","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-countrySubdivision","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-countrySubdivision"],"x-trustbill-fta-key":["IBT-051","IBT-032"],"x-trustbill-source":["profile","profile"]},"emirate":{"type":"string"},"line1":{"description":"<!-- catalog --> **M** · `IBT-048` · `cac:PostalAddress / cbc:StreetName`\n\n→ `GET /v1/partner/field-schema/buyer.address.line1` for full detail.","type":"string","x-trustbill-catalog-key":["buyer.address.line1","seller.address.line1"],"x-trustbill-class":["M","M"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-line1","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-line1"],"x-trustbill-fta-key":["IBT-048","IBT-028"],"x-trustbill-source":["erp","profile"]},"line2":{"description":"<!-- catalog --> **O** · `IBT-048` · `cac:PostalAddress / cbc:AdditionalStreetName`\n\n→ `GET /v1/partner/field-schema/buyer.address.line2` for full detail.","type":"string","x-trustbill-catalog-key":["buyer.address.line2","seller.address.line2"],"x-trustbill-class":["O","O"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-line2","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-line2"],"x-trustbill-fta-key":["IBT-048","IBT-029"],"x-trustbill-source":["profile","profile"]},"postalCode":{"description":"<!-- catalog --> **O** · `IBT-050` · `cac:PostalAddress / cbc:PostalZone`\n\n→ `GET /v1/partner/field-schema/buyer.address.postalCode` for full detail.","type":"string","x-trustbill-catalog-key":["buyer.address.postalCode","seller.address.postalCode"],"x-trustbill-class":["O","O"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-postalCode","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-postalCode"],"x-trustbill-fta-key":["IBT-050","IBT-031"],"x-trustbill-source":["erp","profile"]},"state":{"description":"<!-- catalog --> **CM** · `IBT-051` · `cac:PostalAddress / cbc:CountrySubentity`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - one of: AUH, DXB, SHJ, AJM, UAQ, RAK, FUJ\n\n→ `GET /v1/partner/field-schema/buyer.address.state` for full detail.\n\nUAE emirate code (Microvista uaeStateCodes, FTA IBT-063): AUH=Abu Dhabi, DXB=Dubai, SHJ=Sharjah, AJM=Ajman, UAQ=Umm Al Quwain, RAK=Ras Al Khaimah, FUJ=Fujairah.","enum":["AUH","DXB","SHJ","AJM","UAQ","RAK","FUJ"],"type":"string","x-trustbill-catalog-key":["buyer.address.state","seller.address.state"],"x-trustbill-class":["CM","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-state","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-state"],"x-trustbill-fta-key":["IBT-051","IBT-032"],"x-trustbill-source":["profile","profile"]}},"required":["line1","city"],"type":"object"},"authorityName":{"description":"<!-- catalog --> **CM** · `IBT-042` · `cac:PartyLegalEntity / cbc:CompanyLegalForm`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.authorityName` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":["buyer.authorityName","seller.authorityName"],"x-trustbill-class":["CM","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-authorityName","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-authorityName"],"x-trustbill-fta-key":["IBT-042","IBT-022"],"x-trustbill-source":["profile","profile"]},"country":{"description":"<!-- catalog --> **M** · `IBT-052` · `cac:PostalAddress / cac:Country / cbc:IdentificationCode`\n\n→ `GET /v1/partner/field-schema/buyer.address.countryCode` for full detail.","maxLength":2,"minLength":2,"type":"string","x-trustbill-catalog-key":["buyer.address.countryCode","seller.address.countryCode"],"x-trustbill-class":["M","M"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-countryCode","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-countryCode"],"x-trustbill-fta-key":["IBT-052","IBT-033"],"x-trustbill-source":["erp","erp"]},"electronicAddress":{"description":"<!-- catalog --> **M** · `IBT-046` · `cbc:EndpointID`\n\n→ `GET /v1/partner/field-schema/buyer.electronicAddress` for full detail.","maxLength":128,"minLength":1,"type":"string","x-trustbill-catalog-key":["buyer.electronicAddress","seller.electronicAddress"],"x-trustbill-class":["M","M"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-electronicAddress","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-electronicAddress"],"x-trustbill-fta-key":["IBT-046","IBT-026"],"x-trustbill-source":["profile","profile"]},"electronicAddressSchemeId":{"description":"<!-- catalog --> **M** · `IBT-045` · `cbc:EndpointID@schemeID`\n\n→ `GET /v1/partner/field-schema/buyer.electronicAddressSchemeId` for full detail.","maxLength":16,"minLength":1,"type":"string","x-trustbill-catalog-key":["buyer.electronicAddressSchemeId","seller.electronicAddressSchemeId"],"x-trustbill-class":["M","M"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-electronicAddressSchemeId","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-electronicAddressSchemeId"],"x-trustbill-fta-key":["IBT-045","IBT-027"],"x-trustbill-source":["profile","profile"]},"email":{"description":"<!-- catalog --> **O** · `IBT-053` · `cac:Contact / cbc:ElectronicMail`\n\n→ `GET /v1/partner/field-schema/buyer.email` for full detail.","format":"email","type":"string","x-trustbill-catalog-key":["buyer.email","seller.email"],"x-trustbill-class":["O","O"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-email","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-email"],"x-trustbill-fta-key":["IBT-053","IBT-034"],"x-trustbill-source":["erp","profile"]},"id":{"format":"uuid","type":"string"},"kind":{"default":"buyer","enum":["buyer","seller","both"],"type":"string"},"legalRegistrationType":{"description":"<!-- catalog --> **CM** · `IBT-041` · `cac:PartyLegalEntity / cbc:CompanyID@schemeID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.legalRegistrationType` for full detail.","enum":["TL","PAS","NI","EID"],"type":"string","x-trustbill-catalog-key":["buyer.legalRegistrationType","seller.legalRegistrationType"],"x-trustbill-class":["CM","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-legalRegistrationType","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-legalRegistrationType"],"x-trustbill-fta-key":["IBT-041","IBT-021"],"x-trustbill-source":["profile","profile"]},"name":{"description":"<!-- catalog --> **M** · `IBT-036` · `cac:AccountingCustomerParty / cbc:RegistrationName`\n\n→ `GET /v1/partner/field-schema/buyer.name` for full detail.","minLength":1,"type":"string","x-trustbill-catalog-key":["buyer.name","seller.name"],"x-trustbill-class":["M","M"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-name","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-name"],"x-trustbill-fta-key":["IBT-036","IBT-018"],"x-trustbill-source":["erp","profile"]},"passportIssuingCountry":{"description":"<!-- catalog --> **CM** · `IBT-043` · `cac:PartyLegalEntity / cbc:Country`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.passportIssuingCountry` for full detail.","maxLength":2,"minLength":2,"type":"string","x-trustbill-catalog-key":["buyer.passportIssuingCountry","seller.passportIssuingCountry"],"x-trustbill-class":["CM","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-passportIssuingCountry","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-passportIssuingCountry"],"x-trustbill-fta-key":["IBT-043","IBT-023"],"x-trustbill-source":["profile","profile"]},"phone":{"description":"<!-- catalog --> **O** · `IBT-054` · `cac:Contact / cbc:Telephone`\n\n→ `GET /v1/partner/field-schema/buyer.phone` for full detail.","type":"string","x-trustbill-catalog-key":["buyer.phone","seller.phone"],"x-trustbill-class":["O","O"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-phone","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-phone"],"x-trustbill-fta-key":["IBT-054","IBT-035"],"x-trustbill-source":["profile","profile"]},"tin":{"description":"<!-- catalog --> **CM** · `IBT-044` · `cac:PartyTaxScheme / cbc:CompanyID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.tin` for full detail.","maxLength":32,"minLength":1,"type":"string","x-trustbill-catalog-key":["buyer.tin","seller.tin"],"x-trustbill-class":["CM","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-tin","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-tin"],"x-trustbill-fta-key":["IBT-044","IBT-025"],"x-trustbill-source":["profile","profile"]},"tradeLicenseNumber":{"description":"<!-- catalog --> **CM** · `IBT-040` · `cac:PartyLegalEntity / cbc:CompanyID`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.tradeLicenseNumber` for full detail.","maxLength":64,"minLength":1,"type":"string","x-trustbill-catalog-key":["buyer.tradeLicenseNumber","seller.tradeLicenseNumber"],"x-trustbill-class":["CM","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-tradeLicenseNumber","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-tradeLicenseNumber"],"x-trustbill-fta-key":["IBT-040","IBT-020"],"x-trustbill-source":["profile","profile"]},"tradingName":{"description":"<!-- catalog --> **O** · `IBT-037` · `cac:PartyName / cbc:Name`\n\n→ `GET /v1/partner/field-schema/buyer.tradingName` for full detail.","maxLength":200,"minLength":1,"type":"string","x-trustbill-catalog-key":["buyer.tradingName","seller.tradingName"],"x-trustbill-class":["O","O"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-tradingName","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-tradingName"],"x-trustbill-fta-key":["IBT-037","IBT-019"],"x-trustbill-source":["profile","profile"]},"trn":{"description":"<!-- catalog --> **M** · `IBT-044` · `cac:PartyTaxScheme / cbc:CompanyID`\n\nValidation:\n  - regex `^[0-9]{15}$`\n\n→ `GET /v1/partner/field-schema/buyer.trn` for full detail.","pattern":"^[0-9]{15}$","type":"string","x-trustbill-catalog-key":["buyer.trn","seller.trn"],"x-trustbill-class":["M","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-trn","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-trn"],"x-trustbill-fta-key":["IBT-044","IBT-024"],"x-trustbill-source":["erp","profile"]}},"required":["name","country"],"type":"object"},"InvoiceQueued":{"description":"Response from POST /invoices and each item in POST /invoices/bulk. `status` reflects the REAL post-submit state — `queued` (entered the delivery pipeline), `held` (pre-submit validation refused it; see `heldReason` + `heldErrors`), or `draft` (auto-submit crashed; recover via POST /invoices/:id/retry).","properties":{"heldErrors":{"description":"Present only when status=held. Per-field validation errors.","items":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"type":"object"},"type":"array"},"heldReason":{"description":"Present only when status=held. Short machine-readable reason (e.g. `pint_ae_failures`).","type":"string"},"invoiceId":{"format":"uuid","type":"string"},"number":{"type":"string"},"status":{"enum":["queued","held","draft"],"type":"string"}},"required":["invoiceId","number","status"],"type":"object"},"InvoiceStatus":{"properties":{"createdAt":{"format":"date-time","type":"string"},"invoiceId":{"format":"uuid","type":"string"},"number":{"type":"string"},"reason":{"nullable":true,"type":"string"},"status":{"description":"Every invoice starts in `draft` and transitions forward. `queued`/`transformed`/`validated` are in-pipeline states; `delivered` + `acknowledged` are the success terminals; `rejected` and `blocked_no_credit` are the failure terminals.","enum":["draft","queued","transformed","validated","blocked_no_credit","delivered","acknowledged","rejected"],"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["invoiceId","number","status","createdAt","updatedAt"],"type":"object"},"InvoiceStatusChangedPayload":{"properties":{"erpPartnerId":{"description":"Your ERP-partner id — same value `whoami` returns. Useful when one endpoint receives webhooks for multiple TrustBill environments.","format":"uuid","type":"string"},"event":{"description":"Only event type emitted today. Future events will be additive; treat unknown values as no-op.","enum":["invoice.status_changed"],"type":"string"},"invoiceId":{"description":"The TrustBill invoice id you got back from `POST /v1/partner/invoices`.","format":"uuid","type":"string"},"reason":{"description":"Human-readable failure reason when status=rejected; null otherwise.","nullable":true,"type":"string"},"status":{"description":"Only terminal states fire a webhook. `acknowledged` collapses into `delivered` for the partner surface.","enum":["delivered","rejected"],"type":"string"},"timestamp":{"description":"ISO-8601 timestamp of the delivery attempt. Same seconds-precision value the HMAC signature commits to via `X-Webhook-Timestamp`.","format":"date-time","type":"string"}},"required":["event","erpPartnerId","invoiceId","status","reason","timestamp"],"type":"object"},"OAuthErrorResponse":{"properties":{"error":{"enum":["invalid_request","invalid_client","unsupported_grant_type","oauth_not_configured"],"type":"string"},"error_description":{"type":"string"}},"required":["error"],"type":"object"},"OAuthMetadata":{"properties":{"grant_types_supported":{"items":{"type":"string"},"type":"array"},"issuer":{"type":"string"},"response_types_supported":{"items":{"type":"string"},"type":"array"},"scopes_supported":{"items":{"type":"string"},"type":"array"},"token_endpoint":{"type":"string"},"token_endpoint_auth_methods_supported":{"items":{"type":"string"},"type":"array"}},"required":["issuer","token_endpoint","grant_types_supported","token_endpoint_auth_methods_supported"],"type":"object"},"OAuthTokenRequest":{"properties":{"client_id":{"description":"The X-API-Key value from the partner dashboard.","type":"string"},"client_secret":{"description":"The X-API-Secret value. Shown once at key generation and never retrievable thereafter.","type":"string"},"grant_type":{"enum":["client_credentials"],"type":"string"},"scope":{"description":"Reserved for future per-key scoping. Ignored today; the issued token's scope claim is fixed to `partner:write`.","nullable":true,"type":"string"}},"required":["grant_type","client_id","client_secret"],"type":"object"},"OAuthTokenResponse":{"properties":{"access_token":{"description":"The signed JWT. Include as `Authorization: Bearer <token>`.","type":"string"},"expires_in":{"description":"Seconds until the token expires (24h).","type":"integer"},"scope":{"type":"string"},"token_type":{"enum":["Bearer"],"type":"string"}},"required":["access_token","token_type","expires_in","scope"],"type":"object"},"PartnerCatalogChangelogDocCorrection":{"properties":{"note":{"type":"string"},"target":{"type":"string"}},"required":["target","note"],"type":"object"},"PartnerCatalogChangelogEntry":{"properties":{"added":{"items":{"type":"string"},"type":"array"},"breakingContract":{"description":"True iff a partner on the prior version must change code to keep working.","type":"boolean"},"deprecated":{"items":{"type":"string"},"type":"array"},"docCorrections":{"items":{"$ref":"#/components/schemas/PartnerCatalogChangelogDocCorrection"},"type":"array"},"releasedAt":{"description":"YYYY-MM-DD publish date.","type":"string"},"removed":{"items":{"type":"string"},"type":"array"},"renamed":{"items":{"$ref":"#/components/schemas/PartnerCatalogChangelogRename"},"type":"array"},"summary":{"description":"One-sentence human summary of the version.","type":"string"},"version":{"description":"Catalog version string, e.g. `2026-10`.","type":"string"}},"required":["version","releasedAt","summary","breakingContract","added","removed","deprecated","renamed","docCorrections"],"type":"object"},"PartnerCatalogChangelogRename":{"properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"type":"object"},"PartnerCatalogChangelogResponse":{"properties":{"catalogVersion":{"type":"string"},"entries":{"items":{"$ref":"#/components/schemas/PartnerCatalogChangelogEntry"},"type":"array"},"generatedAt":{"format":"date-time","type":"string"},"locale":{"enum":["en","ar"],"type":"string"},"since":{"description":"Echo of the `?since` query, null when omitted.","nullable":true,"type":"string"}},"required":["catalogVersion","locale","generatedAt","since","entries"],"type":"object"},"PartnerReceivedInvoiceDetail":{"properties":{"detail":{"additionalProperties":true,"description":"The full UBL / PINT-AE payload Microvista returned. Shape mirrors the ASP envelope and can grow — partners should treat unknown keys as pass-through.","nullable":true,"type":"object"},"summary":{"$ref":"#/components/schemas/PartnerReceivedInvoiceRow"}},"required":["summary"],"type":"object"},"PartnerReceivedInvoiceRow":{"properties":{"id":{"description":"Our local row id (received_invoices.id).","format":"uuid","type":"string"},"invoiceDate":{"description":"YYYY-MM-DD or null when the sender omitted it.","nullable":true,"type":"string"},"invoiceNumber":{"nullable":true,"type":"string"},"invoiceType":{"nullable":true,"type":"string"},"partnerInvoiceId":{"description":"The upstream (Microvista / Peppol) invoice id — stable across reads.","type":"string"},"partnerStatus":{"description":"Status word Microvista attached to the row (e.g. `Received`).","nullable":true,"type":"string"},"receivedAt":{"description":"When TrustBill ingested the row.","format":"date-time","type":"string"},"seenAt":{"description":"Set the first time an SME user opened the row.","format":"date-time","nullable":true,"type":"string"},"sellerName":{"nullable":true,"type":"string"},"sellerTrn":{"description":"The sender's TRN (`seller_trp` on the Microvista envelope; renamed for partners).","nullable":true,"type":"string"},"taxAmountFils":{"nullable":true,"type":"string"},"totalAmountFils":{"description":"Total in fils as a BigInt-safe string. Divide by 100 for AED.","nullable":true,"type":"string"},"transactionType":{"nullable":true,"type":"string"}},"required":["id","partnerInvoiceId","receivedAt"],"type":"object"},"PartnerReceivedInvoicesList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PartnerReceivedInvoiceRow"},"type":"array"},"pagination":{"properties":{"hasMore":{"type":"boolean"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["limit","offset","hasMore"],"type":"object"},"unreadCount":{"minimum":0,"type":"integer"}},"required":["data","unreadCount","pagination"],"type":"object"},"PartyAddress":{"properties":{"city":{"description":"<!-- catalog --> **M** · `IBT-049` · `cac:PostalAddress / cbc:CityName`\n\n→ `GET /v1/partner/field-schema/buyer.address.city` for full detail.","type":"string","x-trustbill-catalog-key":["buyer.address.city","seller.address.city"],"x-trustbill-class":["M","M"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-city","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-city"],"x-trustbill-fta-key":["IBT-049","IBT-030"],"x-trustbill-source":["erp","profile"]},"countrySubdivision":{"description":"<!-- catalog --> **CM** · `IBT-051` · `cac:PostalAddress / cbc:CountrySubentity`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\n→ `GET /v1/partner/field-schema/buyer.address.countrySubdivision` for full detail.","maxLength":100,"minLength":1,"type":"string","x-trustbill-catalog-key":["buyer.address.countrySubdivision","seller.address.countrySubdivision"],"x-trustbill-class":["CM","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-countrySubdivision","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-countrySubdivision"],"x-trustbill-fta-key":["IBT-051","IBT-032"],"x-trustbill-source":["profile","profile"]},"emirate":{"type":"string"},"line1":{"description":"<!-- catalog --> **M** · `IBT-048` · `cac:PostalAddress / cbc:StreetName`\n\n→ `GET /v1/partner/field-schema/buyer.address.line1` for full detail.","type":"string","x-trustbill-catalog-key":["buyer.address.line1","seller.address.line1"],"x-trustbill-class":["M","M"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-line1","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-line1"],"x-trustbill-fta-key":["IBT-048","IBT-028"],"x-trustbill-source":["erp","profile"]},"line2":{"description":"<!-- catalog --> **O** · `IBT-048` · `cac:PostalAddress / cbc:AdditionalStreetName`\n\n→ `GET /v1/partner/field-schema/buyer.address.line2` for full detail.","type":"string","x-trustbill-catalog-key":["buyer.address.line2","seller.address.line2"],"x-trustbill-class":["O","O"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-line2","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-line2"],"x-trustbill-fta-key":["IBT-048","IBT-029"],"x-trustbill-source":["profile","profile"]},"postalCode":{"description":"<!-- catalog --> **O** · `IBT-050` · `cac:PostalAddress / cbc:PostalZone`\n\n→ `GET /v1/partner/field-schema/buyer.address.postalCode` for full detail.","type":"string","x-trustbill-catalog-key":["buyer.address.postalCode","seller.address.postalCode"],"x-trustbill-class":["O","O"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-postalCode","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-postalCode"],"x-trustbill-fta-key":["IBT-050","IBT-031"],"x-trustbill-source":["erp","profile"]},"state":{"description":"<!-- catalog --> **CM** · `IBT-051` · `cac:PostalAddress / cbc:CountrySubentity`\n\nConditional-Mandatory — becomes required when its trigger evaluates true. Call `POST /v1/partner/invoices/validate` with a candidate body to see whether this field fires for your invoice shape.\n\nValidation:\n  - one of: AUH, DXB, SHJ, AJM, UAQ, RAK, FUJ\n\n→ `GET /v1/partner/field-schema/buyer.address.state` for full detail.\n\nUAE emirate code (Microvista uaeStateCodes, FTA IBT-063): AUH=Abu Dhabi, DXB=Dubai, SHJ=Sharjah, AJM=Ajman, UAQ=Umm Al Quwain, RAK=Ras Al Khaimah, FUJ=Fujairah.","enum":["AUH","DXB","SHJ","AJM","UAQ","RAK","FUJ"],"type":"string","x-trustbill-catalog-key":["buyer.address.state","seller.address.state"],"x-trustbill-class":["CM","CM"],"x-trustbill-doc-url":["https://trustbill.ae/en/documentation/erp-partner-api#field-buyer-address-state","https://trustbill.ae/en/documentation/erp-partner-api#field-seller-address-state"],"x-trustbill-fta-key":["IBT-051","IBT-032"],"x-trustbill-source":["profile","profile"]}},"required":["line1","city"],"type":"object"},"PingResponse":{"properties":{"mode":{"enum":["test","live"],"type":"string"},"ok":{"example":true,"type":"boolean"},"timestamp":{"format":"date-time","type":"string"}},"required":["ok","mode","timestamp"],"type":"object"},"ProblemError":{"properties":{"code":{"example":"validation_failed","type":"string"},"detail":{"type":"string"},"meta":{"additionalProperties":true,"type":"object"},"status":{"type":"integer"},"title":{"type":"string"},"type":{"format":"uri","type":"string"}},"required":["type","title","status"],"type":"object"},"ReplayResponse":{"properties":{"deliveryId":{"format":"uuid","type":"string"},"status":{"example":"pending","type":"string"}},"required":["deliveryId","status"],"type":"object"},"StatusCode":{"properties":{"code":{"type":"string"},"help":{"type":"string"},"label":{"type":"string"},"nextStates":{"items":{"type":"string"},"type":"array"},"stage":{"enum":["pipeline","terminal","ingestion","webhook_event"],"type":"string"},"terminal":{"type":"boolean"}},"required":["code","stage","label","help","terminal","nextStates"],"type":"object"},"StatusCodesResponse":{"properties":{"catalogVersion":{"type":"string"},"generatedAt":{"format":"date-time","type":"string"},"locale":{"enum":["en","ar"],"type":"string"},"statusCodes":{"items":{"$ref":"#/components/schemas/StatusCode"},"type":"array"}},"required":["catalogVersion","locale","generatedAt","statusCodes"],"type":"object"},"TrnValidateResponse":{"properties":{"cachedAt":{"format":"date-time","type":"string"},"legalName":{"description":"Present when status=verified","type":"string"},"reason":{"description":"Present when status=rejected","type":"string"},"status":{"enum":["verified","rejected","pending"],"type":"string"},"trn":{"type":"string"}},"required":["trn","status","cachedAt"],"type":"object"},"ValidateIssue":{"properties":{"catalogDocUrl":{"nullable":true,"type":"string"},"catalogKey":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"},"severity":{"enum":["error","warn"],"type":"string"}},"required":["code","severity","path","message"],"type":"object"},"ValidateResponse":{"properties":{"catalogVersion":{"type":"string"},"errors":{"items":{"$ref":"#/components/schemas/ValidateIssue"},"type":"array"},"ok":{"type":"boolean"},"warnings":{"items":{"$ref":"#/components/schemas/ValidateIssue"},"type":"array"}},"required":["ok","errors","warnings","catalogVersion"],"type":"object"},"WebhookDelivery":{"properties":{"attempts":{"type":"integer"},"createdAt":{"format":"date-time","type":"string"},"deliveredAt":{"format":"date-time","nullable":true,"type":"string"},"deliveryId":{"format":"uuid","type":"string"},"event":{"type":"string"},"lastError":{"nullable":true,"type":"string"},"lastResponseStatus":{"nullable":true,"type":"integer"},"maxAttempts":{"type":"integer"},"mode":{"enum":["test","live"],"type":"string"},"nextAttemptAt":{"format":"date-time","type":"string"},"status":{"enum":["pending","delivered","failed","exhausted"],"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["deliveryId","status","event","mode","attempts","maxAttempts","nextAttemptAt","createdAt","updatedAt"],"type":"object"},"WebhookDeliveryList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookDelivery"},"type":"array"}},"required":["data"],"type":"object"},"WhoamiResponse":{"description":"Introspection summary for the authenticated partner. When the request ALSO carries `x-erp-partner-secret`, the response adds a `sme` block with the resolved SME's TRN + submission mode so a fresh integration can discover its connected SME without opening the admin UI (DX finding F1 2026-10-31).","properties":{"connectedSmes":{"description":"Count of SMEs currently connected to this ERP.","type":"integer"},"erpName":{"type":"string"},"lastTestAt":{"format":"date-time","nullable":true,"type":"string"},"mode":{"enum":["test","live"],"type":"string"},"partnerId":{"format":"uuid","type":"string"},"signatureVersion":{"description":"HMAC signature version this partner is pinned to. Current pinning: `1` (`t=<unix>,v1=<hex>` scheme described on the webhook endpoint docs).","nullable":true,"type":"integer"},"sme":{"description":"Resolved SME summary. Present only when the request carried `x-erp-partner-secret` AND it resolved to a connected SME under this partner.","properties":{"name":{"nullable":true,"type":"string"},"submissionMode":{"description":"The SME's company-config submission mode (sandbox / live). Must match the `mode` of the API key used.","nullable":true,"type":"string"},"tenantId":{"format":"uuid","type":"string"},"trn":{"description":"The connected SME's TRN. This is the exact value to send on the top-level `trn` property of `POST /v1/partner/invoices`.","nullable":true,"type":"string"}},"required":["tenantId","name","trn","submissionMode"],"type":"object"},"status":{"enum":["test","live_pending","live_active","live_rejected","revoked","unknown"],"type":"string"},"timestamp":{"format":"date-time","type":"string"},"webhookUrl":{"description":"Mode-appropriate webhook URL registered for this partner. Null when no URL is configured for the current mode — register one in the admin UI before expecting delivery callbacks.","nullable":true,"type":"string"}},"required":["partnerId","erpName","status","mode","connectedSmes","lastTestAt","webhookUrl","signatureVersion","timestamp"],"type":"object"}},"securitySchemes":{"apiKeyAuth":{"in":"header","name":"X-API-Key","type":"apiKey"},"apiSecretAuth":{"in":"header","name":"X-API-Secret","type":"apiKey"},"connectionSecret":{"in":"header","name":"x-erp-partner-secret","type":"apiKey"}}},"info":{"contact":{"email":"info@trustbill.ae"},"description":"Public API for ERP integrators pushing invoices, managing customers, and receiving webhooks under a connected SME. Every mutation is Idempotency-Key protected; every list is cursor-paginated; every webhook is HMAC-signed and retried with backoff.","license":{"name":"Proprietary"},"title":"TrustBill Partner API","version":"2026-10","x-trustbill-catalog-version":"2026-10"},"openapi":"3.1.0","paths":{"/.well-known/oauth-authorization-server":{"get":{"deprecated":true,"description":"Discovery document for OAuth-aware SDK generators. OAuth is not enabled on the current prod environment — this metadata is served for completeness but any token request will 503. See `POST /v1/partner/oauth/token` for the current status.","operationId":"getOAuthMetadata","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthMetadata"}}},"description":"Discovery doc for OAuth-aware SDK generators."}},"security":[],"summary":"RFC 8414 authorization-server metadata (deprecated — see /oauth/token for status)","tags":["auth"]}},"/v1/partner/catalog/changelog":{"get":{"description":"Returns changelog entries for the FTA field catalog, oldest first. Each entry describes added / removed / deprecated / renamed catalog keys and any doc-only corrections. Partners pin against `?since=<version>` to receive strictly-after entries; an unknown `since` returns the full history.\n\n**Tenant-neutral** — authenticates with API-Key + API-Secret only; no `x-erp-partner-secret` required.\n\n**Caching**: `Cache-Control: public, max-age=300`. The `X-Catalog-Version` response header lets SDKs invalidate their cache precisely on a catalog bump — key your cache off that header rather than the generated timestamp.","operationId":"getCatalogChangelog","parameters":[{"description":"Return entries strictly AFTER this catalog version. Omit to receive the full history. Unknown values fall through to the full history.","in":"query","name":"since","required":false,"schema":{"type":"string"}},{"description":"Reserved for a future per-locale translation layer. The payload is currently English-only; the parameter is validated for forward compatibility.","in":"query","name":"locale","required":false,"schema":{"enum":["en","ar"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"catalogVersion":"2026-10","entries":[{"added":[],"breakingContract":false,"deprecated":[],"docCorrections":[{"note":"Server now accepts the six UBL document-type codes the OpenAPI has always advertised.","target":"InvoiceCreateBody.documentType"}],"releasedAt":"2026-10-31","removed":[],"renamed":[],"summary":"First partner-facing catalog revision — 130 FTA invoice fields, generated OpenAPI, `partnerApiAddressable` chip, `/catalog/changelog` endpoint, widened `documentType` enum.","version":"2026-10"}],"generatedAt":"2026-10-31T00:00:00.000Z","locale":"en","since":null},"schema":{"$ref":"#/components/schemas/PartnerCatalogChangelogResponse"}}},"description":"Changelog entries matching the `since` filter.","headers":{"Cache-Control":{"$ref":"#/components/headers/CatalogCacheControl"},"Vary":{"$ref":"#/components/headers/CatalogVary"},"X-Catalog-Version":{"$ref":"#/components/headers/CatalogVersion"}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Invalid ?locale value."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Missing or invalid API credentials."}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]},{"bearerAuth":[]}],"summary":"Catalog version history (append-only)","tags":["catalog"]}},"/v1/partner/catalog/version":{"get":{"description":"Returns the current `FIELD_SPEC_VERSION` + server timestamp. Partners who don't receive the `catalog.updated` webhook (behind a firewall, during an outage) can poll here cheaply.\n\n**Tenant-neutral** — authenticates with API-Key + API-Secret only; no `x-erp-partner-secret` required.","operationId":"getCatalogVersion","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogVersionResponse"}}},"description":"Current catalog version + server timestamp.","headers":{"Cache-Control":{"$ref":"#/components/headers/CatalogCacheControl"},"Vary":{"$ref":"#/components/headers/CatalogVary"},"X-Catalog-Version":{"$ref":"#/components/headers/CatalogVersion"}}}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]},{"bearerAuth":[]}],"summary":"Catalog-version polling fallback for the webhook","tags":["catalog"]}},"/v1/partner/customers":{"post":{"description":"Idempotent on (tenant_id, externalRef). Requires Idempotency-Key.","operationId":"upsertCustomer","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"address":{"city":"Dubai","country":"AE","emirate":"Dubai","line1":"Office 501, Building 5"},"country":"AE","email":"billing@acme.example","externalRef":"acme-2024-001","kind":"buyer","name":"ACME Trading LLC","phone":"+971 4 000 0000","trn":"100000000000003"},"schema":{"$ref":"#/components/schemas/CustomerUpsertBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"description":"created or updated"},"400":{"$ref":"#/components/responses/InvalidBody"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"summary":"Upsert a customer under the connected SME","tags":["customers"]}},"/v1/partner/customers/{externalRef}":{"get":{"operationId":"getCustomer","parameters":[{"example":"acme-2024-001","in":"path","name":"externalRef","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}},"description":"ok"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Read a customer by externalRef","tags":["customers"]}},"/v1/partner/error-codes":{"get":{"description":"Every `DomainError.code` a partner can receive on any endpoint, with HTTP status + title + user-facing detail + retriable flag + docUrl.\n\n**Tenant-neutral** — authenticates with API-Key + API-Secret only; no `x-erp-partner-secret` required.","operationId":"listErrorCodes","parameters":[{"description":"Reserved for a future per-locale translation layer. The payload is currently English-only; the parameter is validated for forward compatibility.","in":"query","name":"locale","required":false,"schema":{"enum":["en","ar"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorCodesResponse"}}},"description":"Error dictionary with HTTP status, title, detail, retriable flag + docUrl per code.","headers":{"Cache-Control":{"$ref":"#/components/headers/CatalogCacheControl"},"Vary":{"$ref":"#/components/headers/CatalogVary"},"X-Catalog-Version":{"$ref":"#/components/headers/CatalogVersion"}}}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]},{"bearerAuth":[]}],"summary":"List partner-reachable error codes","tags":["catalog"]}},"/v1/partner/field-schema":{"get":{"description":"Returns every FTA invoice field with class (M/CM/O), effective source for the active partner_kind, rules, example value, Partner-API addressability, and per-partner adapter binding. The authoritative read of the catalog partners build against.\n\n**Tenant-neutral** — authenticates with API-Key + API-Secret only; no `x-erp-partner-secret` required.","operationId":"listFieldSchema","parameters":[{"description":"Partner ERP kind. Defaults to `custom` when absent. Determines `source.effective` on each row.","in":"query","name":"partner","required":false,"schema":{"enum":["business_central","sap_business_one","quickbooks_online","zoho_books","xero","custom"],"type":"string"}},{"description":"Reserved for a future per-locale translation layer. The payload is currently English-only; the parameter is validated for forward compatibility.","in":"query","name":"locale","required":false,"schema":{"enum":["en","ar"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldSchemaResponse"}}},"description":"Catalog projection for the given partner + locale.","headers":{"Cache-Control":{"$ref":"#/components/headers/CatalogCacheControl"},"ETag":{"$ref":"#/components/headers/CatalogETag"},"Vary":{"$ref":"#/components/headers/CatalogVary"},"X-Cache":{"$ref":"#/components/headers/CatalogXCache"},"X-Catalog-Version":{"$ref":"#/components/headers/CatalogVersion"}}},"304":{"description":"Not Modified — the client's cached ETag matches."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Invalid ?partner or ?locale value."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Missing or invalid API credentials."}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]},{"bearerAuth":[]}],"summary":"List the full FTA invoice field catalog","tags":["catalog"]}},"/v1/partner/field-schema/{fieldKey}":{"get":{"description":"Deep-link lookup for one catalog field. The response body is the same `FieldSchemaRow` shape as the list endpoint, wrapped in a single-row envelope.\n\n**Tenant-neutral** — authenticates with API-Key + API-Secret only; no `x-erp-partner-secret` required.","operationId":"getFieldByKey","parameters":[{"description":"Catalog field key (e.g. `doc.invoiceNumber`).","in":"path","name":"fieldKey","required":true,"schema":{"type":"string"}},{"in":"query","name":"partner","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldSchemaOneResponse"}}},"description":"The single field row.","headers":{"Cache-Control":{"$ref":"#/components/headers/CatalogCacheControl"},"ETag":{"$ref":"#/components/headers/CatalogETag"},"Vary":{"$ref":"#/components/headers/CatalogVary"},"X-Cache":{"$ref":"#/components/headers/CatalogXCache"},"X-Catalog-Version":{"$ref":"#/components/headers/CatalogVersion"}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"No catalog field with that key."}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]},{"bearerAuth":[]}],"summary":"Fetch a single field entry by catalog key","tags":["catalog"]}},"/v1/partner/invoices":{"get":{"operationId":"listInvoices","parameters":[{"example":["delivered","rejected"],"in":"query","name":"status","schema":{"items":{"type":"string"},"type":"array"}},{"in":"query","name":"from","schema":{"format":"date","type":"string"}},{"in":"query","name":"to","schema":{"format":"date","type":"string"}},{"in":"query","name":"number","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}},"description":"ok"},"401":{"$ref":"#/components/responses/Unauthorized"}},"summary":"List invoices you have submitted for the connected SME","tags":["invoices"]},"post":{"description":"Server-side POST → transform → validate → deliver runs automatically; you get status via webhook or by polling GET :id.\n\n**Response `status` (create-only vocabulary):**\n- `queued` — invoice entered the delivery pipeline.\n- `held` — pre-submit validation refused it. `heldReason` + `heldErrors[]` tell you which fields to fix. To retry: DELETE the held invoice and POST the corrected body.\n- `draft` — auto-submit crashed. Recover via `POST /v1/partner/invoices/{id}/retry`.\n\n**Reserved test TRNs (test / sandbox modes only):**\n- `seller.trn = \"100000000000000\"` → **always accepts** end-to-end. Skips validation + delivery + status-poll, lands the invoice at the TERMINAL success state `acknowledged` synchronously (visible under the SME's \"Approved\" tab, not \"Awaiting FTA\"), and fires the HMAC `invoice.status_changed` webhook within ~5s. Full audit trail (`submitted → delivered → acknowledged`) is emitted so your logs look identical to a real pipeline run. `POST /v1/partner/invoices/validate` honours the same short-circuit so a CI loop around this TRN won't flag errors the live POST will ignore.\n- `seller.trn = \"100000000000666\"` → **always rejects** with `403 test_trn_reject`. Use to exercise your rejection code path.\nLive mode ignores both — TRN cross-check applies as normal.\n\n**Test-mode (`erp_test_*` key) behaviour on a real seller TRN:** every row created via a test key is stamped `is_demo=true` and routed through the sandbox submission pool. Demo rows **cannot progress beyond `draft` on a real TRN** — the submit pipeline holds them with `heldReason=\"invoice_asp_not_ready\"` (even when the SME has Microvista fully linked), because test-mode is intentionally isolated from any live FTA registration. The two paths that let a test-mode invoice reach the terminal success state are (a) using the reserved success TRN above (fast-path to `acknowledged`), or (b) rotating the integration to a `erp_live_*` key once your account has been approved for live mode (full pipeline to `acknowledged` via real FTA ack). If you need the full queue → ack → webhook round-trip against your real TRN, request live-mode approval; `erp_test_*` keys are capped at the smoke-test fast-path by design.","operationId":"createInvoice","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCreateBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceQueued"}}},"description":"queued"},"400":{"$ref":"#/components/responses/InvalidBody"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Submit one invoice and auto-queue it for FTA delivery","tags":["invoices"]}},"/v1/partner/invoices/bulk":{"post":{"description":"Per-item idempotency keys are derived from the batch's Idempotency-Key as `${batchKey}:${index}`. To recover from a partial failure, RESEND THE ORIGINAL BODY (same items, same order, same batch key) — the API will replay each item's stored result deterministically. Do NOT retry a subset with a fresh index range: the derived per-item keys would collide with completed items and hash-mismatch to 409.","operationId":"createInvoicesBulk","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"invoices":[{"buyer":{"address":{"city":"Abu Dhabi","country":"AE","line1":"Al Reem Island, Marina Square","state":"AUH"},"country":"AE","name":"Buyer Company LLC","trn":"100000160500003"},"currency":"AED","externalRef":"acme-batch-1","issueDate":"2026-10-29","lines":[{"description":"Item","itemType":"goods","quantity":1,"taxCategory":"standard_5","unitOfMeasureCode":"EA","unitPrice":100,"vatRate":0.05}],"number":"INV-2026-1001","seller":{"address":{"city":"Dubai","country":"AE","line1":"Office 2201, Boulevard Plaza","state":"DXB"},"country":"AE","name":"Al Noor Trading LLC","trn":"100000000000003"},"trn":"100000000000003"}]},"schema":{"$ref":"#/components/schemas/BulkInvoiceBody"}}},"required":true},"responses":{"207":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkResponse"}}},"description":"per-item results"},"400":{"$ref":"#/components/responses/InvalidBody"},"401":{"$ref":"#/components/responses/Unauthorized"}},"summary":"Submit up to 100 invoices in one call","tags":["invoices"]}},"/v1/partner/invoices/received":{"get":{"description":"Read-only view of the SME's Peppol inbox — same data that powers the SME's /sme/inbox portal page. Scoped to the SME behind the `x-erp-partner-secret` header. Partners mirror this list into their ERP's incoming-bills workspace.","operationId":"listReceivedInvoices","parameters":[{"in":"query","name":"limit","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","required":false,"schema":{"default":0,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerReceivedInvoicesList"}}},"description":"Paginated list + unread count."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"Missing / invalid API or connection credentials."}},"summary":"List Peppol invoices delivered to the connected SME","tags":["invoices"]}},"/v1/partner/invoices/received/{id}":{"get":{"operationId":"getReceivedInvoice","parameters":[{"description":"received_invoices.id (UUID).","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerReceivedInvoiceDetail"}}},"description":"Summary row + the full lazy-loaded payload fetched from Microvista."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemError"}}},"description":"No received invoice with that id for this SME."}},"summary":"Fetch one received invoice + its full UBL / PINT-AE detail","tags":["invoices"]}},"/v1/partner/invoices/validate":{"post":{"description":"Accepts the same body as `POST /v1/partner/invoices` and returns the pre-submit validator's verdict without writing anything. CI partners wire this to catch catalog-rule changes before shipping.\n\n**TRN cross-check (opt-in):** when you ALSO pass `x-erp-partner-secret`, validate runs the same TRN check that `POST /v1/partner/invoices` runs — the top-level `trn` must match the SME bound to your connection secret. Without the header, validate is a pure body check so stateless CI integrators (no connected SME) can still exercise fixtures. Returning `ok: true` with the connection secret attached means `POST /v1/partner/invoices` will accept the same body modulo rate limits + the submission-mode guard.","operationId":"validateInvoice","parameters":[{"description":"Optional. When set, validate adds the live-POST TRN cross-check (see description).","in":"header","name":"x-erp-partner-secret","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCreateBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateResponse"}}},"description":"Validation verdict. 200 regardless of ok=true/false — the body carries the verdict."}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]}],"summary":"Dry-run an invoice body against the catalog","tags":["validation"]}},"/v1/partner/invoices/{id}":{"delete":{"description":"Deletes draft / queued / blocked_no_credit / rejected. Post-delivery invoices must be reversed with a credit note.","operationId":"deleteInvoice","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}},"summary":"Cancel a pre-delivery invoice","tags":["invoices"]},"get":{"operationId":"getInvoice","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceStatus"}}},"description":"ok"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Fetch one invoice's current status","tags":["invoices"]}},"/v1/partner/invoices/{id}/replay-webhook":{"post":{"description":"Creates a fresh delivery row with a refreshed timestamp so the HMAC signature stays inside your anti-replay window. Original history is preserved.","operationId":"replayInvoiceWebhook","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayResponse"}}},"description":"replay queued"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"summary":"Force-resend the last webhook payload for an invoice","tags":["webhooks"]}},"/v1/partner/invoices/{id}/retry":{"post":{"description":"Same rate-limit the SME UI uses (3/hour/invoice).","operationId":"retryInvoice","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceQueued"}}},"description":"requeued"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Retry a rejected or blocked-no-credit invoice","tags":["invoices"]}},"/v1/partner/invoices/{id}/webhook-deliveries":{"get":{"operationId":"listWebhookDeliveries","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}},"description":"ok"},"401":{"$ref":"#/components/responses/Unauthorized"}},"summary":"Audit trail of outbound webhook attempts for one invoice","tags":["webhooks"]}},"/v1/partner/oauth/token":{"post":{"deprecated":true,"description":"**Status (2026-10-31):** this endpoint returns `503 oauth_not_configured` on the current prod environment — the OAuth shim is not enabled. **Use the three-header auth (`X-API-Key` + `X-API-Secret` + `x-erp-partner-secret`) instead.** When OAuth is enabled on a future environment this endpoint will exchange your API-Key credentials for a 24h JWT bearer that encodes `(partnerId, consultancyTenantId, mode)`. The `bearerAuth` + `oauth2ClientCredentials` security schemes were stripped from the spec in the same release to prevent SDK generators from emitting unusable OAuth client code — until the shim is enabled, don't code against this flow. If you have a hard OAuth-only constraint, contact support.","operationId":"issueOAuthToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/OAuthTokenRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}},"description":"Signed JWT bearer token."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorResponse"}}},"description":"RFC 6749 error — unsupported_grant_type or invalid_request."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorResponse"}}},"description":"invalid_client."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorResponse"}}},"description":"oauth_not_configured — the shim is disabled on this environment. Use X-API-Key."}},"security":[],"summary":"OAuth 2.0 client-credentials grant (deprecated — not enabled on this environment)","tags":["auth"]}},"/v1/partner/ping":{"get":{"description":"Confirms API key + secret work. Does NOT require x-erp-partner-secret.","operationId":"ping","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PingResponse"}}},"description":"ok"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]}],"summary":"Round-trip health check","tags":["meta"]}},"/v1/partner/status-codes":{"get":{"description":"Dictionary of every `InvoiceStatus` value a partner can receive — pipeline states, terminal states, ingestion states, and webhook event names — with human labels + reachable `nextStates` hints.\n\n**Tenant-neutral** — authenticates with API-Key + API-Secret only; no `x-erp-partner-secret` required.","operationId":"listStatusCodes","parameters":[{"description":"Reserved for a future per-locale translation layer. The payload is currently English-only; the parameter is validated for forward compatibility.","in":"query","name":"locale","required":false,"schema":{"enum":["en","ar"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusCodesResponse"}}},"description":"Status catalog: pipeline + terminal + ingestion + webhook event names.","headers":{"Cache-Control":{"$ref":"#/components/headers/CatalogCacheControl"},"Vary":{"$ref":"#/components/headers/CatalogVary"},"X-Catalog-Version":{"$ref":"#/components/headers/CatalogVersion"}}}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]},{"bearerAuth":[]}],"summary":"List invoice status codes partners can see","tags":["catalog"]}},"/v1/partner/validate-trn":{"get":{"description":"Verifies a 15-digit TRN against the FTA registry before you build the invoice payload. Results are cached for 24h. Not scoped to an SME — no x-erp-partner-secret required.","operationId":"validateTrn","parameters":[{"example":"100000000000003","in":"query","name":"trn","required":true,"schema":{"pattern":"^\\d{15}$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrnValidateResponse"}}},"description":"ok"},"400":{"$ref":"#/components/responses/InvalidQuery"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]}],"summary":"Pre-flight TRN validation against the FTA registry","tags":["validation"]}},"/v1/partner/whoami":{"get":{"description":"Returns which ERP partner + which mode (test/live) the current API credentials belong to. When the caller ALSO passes `x-erp-partner-secret`, the response adds a `sme` block with the resolved SME's TRN, name, and submission mode — call this with your connection secret attached to discover which TRN to send on `POST /v1/partner/invoices`. The header is optional; bare `whoami` returns the partner-level shape only.","operationId":"whoami","parameters":[{"description":"Optional. When set to a valid per-SME connection secret, the response adds the `sme` block (tenantId, name, trn, submissionMode). An invalid or mismatched secret is treated the same as absent — the write-path endpoints are where a bad connection secret 401s.","in":"header","name":"x-erp-partner-secret","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhoamiResponse"}}},"description":"ok"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[]}],"summary":"Introspect the API key (and optionally the connection)","tags":["meta"]}}},"security":[{"apiKeyAuth":[],"apiSecretAuth":[],"connectionSecret":[]}],"servers":[{"description":"Production (use test API keys `erp_test_...` for a safe sandbox against the same host)","url":"https://trustbill.ae/api"}],"tags":[{"name":"invoices"},{"name":"customers"},{"name":"validation"},{"name":"webhooks"},{"name":"meta"},{"description":"Catalog discovery endpoints — fields, status codes, error codes, catalog version.","name":"catalog"},{"description":"OAuth 2.0 client-credentials shim + RFC 8414 discovery. SDK generators that only speak OAuth use this instead of the X-API-Key headers.","name":"auth"}],"webhooks":{"invoiceStatusChanged":{"post":{"description":"When an invoice you pushed reaches a terminal state (`delivered` or `rejected`), TrustBill POSTs this payload to your registered webhook URL. Deliveries are durable — persisted in `erp_partner_webhook_deliveries` and retried on the schedule below until 2xx or exhaustion.\n\n**Verification (required):**\n1. Read `X-Webhook-Timestamp` and `X-Webhook-Signature: t=<unix>,v1=<hex>`.\n2. Reject if `|now - t| > 300` seconds.\n3. Compute `hmac_sha256(webhook_secret, `${t}.${raw_body}`)` and constant-time-compare to `v1=` value.\n4. Only after both checks pass, parse the JSON and update your record.\n\n**Retry schedule** (on non-2xx or transport failure): 30 s → 2 m → 10 m → 30 m → 1 h → 3 h. After 6 attempts the delivery is marked `exhausted`; use `POST /v1/partner/invoices/{id}/replay-webhook` to fire a fresh attempt manually.\n\n**Headers you should trust:**\n- `X-Webhook-Signature: t=<unix>,v1=<hex>` — HMAC-SHA256 over `${t}.${raw_body}`.\n- `X-Webhook-Timestamp: <unix>` — the same `t` (convenience for logging).\n\nThe legacy `x-webhook-secret` header is no longer emitted; if you see it in old logs, it was retired.","requestBody":{"content":{"application/json":{"example":{"erpPartnerId":"3e7f2b6e-9c4a-4c8f-9d1e-8a6b5c4d3e2f","event":"invoice.status_changed","invoiceId":"5a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d","reason":null,"status":"delivered","timestamp":"2026-09-16T09:30:00.000Z"},"schema":{"$ref":"#/components/schemas/InvoiceStatusChangedPayload"}}},"required":true},"responses":{"200":{"description":"ACK. Any 2xx body is accepted."},"4XX":{"description":"TrustBill treats any non-2xx as a delivery failure and re-tries per the backoff schedule above."},"5XX":{"description":"Same as 4xx — retryable."}},"summary":"invoice.status_changed — TrustBill → your ERP","tags":["webhooks"]}}}}