{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "#/components/schemas/Bill",
"title": "Bill",
"type": "object",
"x-apideck-schema-id": "Bill",
"additionalProperties": false,
"x-apideck-weights": {
"id": "critical",
"downstream_id": "low",
"display_id": "low",
"bill_number": "high",
"supplier": "high",
"company_id": "middle",
"location_id": "low",
"department_id": "low",
"currency": "medium",
"currency_rate": "low",
"tax_inclusive": "low",
"bill_date": "critical",
"due_date": "critical",
"paid_date": "high",
"po_number": "low",
"reference": "low",
"line_items": "critical",
"terms": "low",
"terms_id": "edge-case",
"balance": "high",
"deposit": "low",
"sub_total": "high",
"total_tax": "high",
"total": "critical",
"tax_code": "medium",
"notes": "low",
"status": "critical",
"approved_by": "low",
"amortization_type": "edge-case",
"tax_method": "edge-case",
"template_id": "edge-case",
"ledger_account": "low",
"payment_method": "low",
"channel": "low",
"language": "low",
"accounting_by_row": "edge-case",
"bank_account": "low",
"discount_percentage": "medium",
"tracking_categories": "low",
"updated_by": "low",
"created_by": "low",
"created_at": "edge-case",
"updated_at": "high",
"row_version": "edge-case",
"accounting_period": "low",
"custom_fields": "medium",
"document_received": "low",
"attachments": "edge-case",
"source_document_url": "low"
},
"x-apideck-strict-required": [
"id",
"bill_date",
"due_date",
"line_items",
"total",
"status"
],
"properties": {
"id": {
"$ref": "#/components/schemas/Id"
},
"downstream_id": {
"$ref": "#/components/schemas/DownstreamId"
},
"display_id": {
"$ref": "#/components/schemas/DisplayId"
},
"bill_number": {
"type": "string",
"title": "Bill number",
"example": "10001",
"description": "Reference to supplier bill number",
"nullable": true
},
"supplier": {
"$ref": "#/components/schemas/LinkedSupplier"
},
"company_id": {
"$ref": "#/components/schemas/AccountingCompanyId"
},
"location_id": {
"$ref": "#/components/schemas/LocationId"
},
"department_id": {
"$ref": "#/components/schemas/DepartmentId"
},
"currency": {
"$ref": "#/components/schemas/Currency"
},
"currency_rate": {
"$ref": "#/components/schemas/CurrencyRate"
},
"tax_inclusive": {
"$ref": "#/components/schemas/TaxInclusive"
},
"bill_date": {
"type": "string",
"title": "Bill date",
"description": "Date bill was issued - YYYY-MM-DD.",
"format": "date",
"example": "2020-09-30",
"nullable": true
},
"due_date": {
"$ref": "#/components/schemas/DueDate"
},
"paid_date": {
"type": "string",
"title": "Paid date",
"description": "The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD.",
"format": "date",
"example": "2020-10-30",
"nullable": true
},
"po_number": {
"type": "string",
"title": "Purchase Order number",
"description": "A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order.",
"example": "90000117",
"nullable": true
},
"reference": {
"$ref": "#/components/schemas/Reference"
},
"line_items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BillLineItem"
}
},
"terms": {
"type": "string",
"title": "Terms",
"description": "Terms of payment.",
"example": "Net 30 days",
"nullable": true
},
"terms_id": {
"$ref": "#/components/schemas/TermsId"
},
"balance": {
"type": "number",
"title": "Balance",
"description": "Balance of bill due.",
"example": 27500,
"nullable": true
},
"deposit": {
"type": "number",
"title": "Deposit",
"description": "Amount of deposit made to this bill.",
"example": 0,
"nullable": true
},
"sub_total": {
"$ref": "#/components/schemas/SubTotal"
},
"total_tax": {
"$ref": "#/components/schemas/TotalTax"
},
"total": {
"type": "number",
"title": "Total amount",
"description": "Total amount of bill, including tax.",
"example": 27500,
"nullable": true
},
"tax_code": {
"$ref": "#/components/schemas/TaxCode"
},
"notes": {
"type": "string",
"title": "Notes",
"example": "Some notes about this bill.",
"nullable": true
},
"status": {
"type": "string",
"title": "Status",
"description": "Invoice status",
"example": "draft",
"x-apideck-enum-id": "invoices.status",
"enum": [
"draft",
"submitted",
"authorised",
"partially_paid",
"paid",
"void",
"credit",
"deleted",
"posted"
],
"nullable": true
},
"ledger_account": {
"$ref": "#/components/schemas/LinkedLedgerAccount"
},
"payment_method": {
"$ref": "#/components/schemas/PaymentMethod"
},
"channel": {
"$ref": "#/components/schemas/Channel"
},
"language": {
"$ref": "#/components/schemas/Language"
},
"accounting_by_row": {
"$ref": "#/components/schemas/AccountingByRow"
},
"bank_account": {
"$ref": "#/components/schemas/BankAccount"
},
"discount_percentage": {
"$ref": "#/components/schemas/DiscountPercentage"
},
"template_id": {
"type": "string",
"title": "Template",
"description": "Optional bill template",
"example": "123456",
"nullable": true
},
"approved_by": {
"type": "string",
"title": "Approved by",
"description": "The user who approved the bill",
"example": "John Doe",
"nullable": true
},
"amortization_type": {
"type": "string",
"title": "Amortization Type",
"description": "Type of amortization",
"x-apideck-enum-id": "bills.amortization-type",
"enum": [
"manual",
"receipt",
"schedule",
"other"
],
"nullable": true
},
"tax_method": {
"type": "string",
"title": "Tax method",
"description": "Method of tax calculation",
"example": "Due to supplier",
"nullable": true
},
"document_received": {
"type": "boolean",
"title": "Document received",
"description": "Whether the document has been received",
"example": true,
"nullable": true
},
"source_document_url": {
"type": "string",
"title": "Source document URL",
"description": "URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero.",
"example": "https://www.invoicesolution.com/bill/123456",
"nullable": true
},
"tracking_categories": {
"$ref": "#/components/schemas/LinkedTrackingCategories"
},
"updated_by": {
"$ref": "#/components/schemas/UpdatedBy"
},
"created_by": {
"$ref": "#/components/schemas/CreatedBy"
},
"updated_at": {
"$ref": "#/components/schemas/UpdatedAt"
},
"created_at": {
"$ref": "#/components/schemas/CreatedAt"
},
"row_version": {
"$ref": "#/components/schemas/RowVersion"
},
"custom_fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomField"
}
},
"custom_mappings": {
"$ref": "#/components/schemas/CustomMappings"
},
"pass_through": {
"$ref": "#/components/schemas/PassThroughBody"
},
"accounting_period": {
"$ref": "#/components/schemas/AccountingPeriod"
},
"attachments": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LinkedAttachment"
}
}
}
}