Codat Get Create Directcosts Model Example is an example object payload from Codat, with 6 top-level fields. It illustrates the shape of data this provider's APIs accept or return.
Top-level fields
operationIdmethodpathsummaryrequestExamplesresponseExamples
Example Payload
{
"operationId": "get-create-directCosts-model",
"method": "GET",
"path": "/companies/{companyId}/connections/{connectionId}/options/directCosts",
"summary": "Get create direct cost model",
"requestExamples": [],
"responseExamples": [
{
"status": "200",
"contentType": "application/json",
"name": "Dynamics 365 Business Central",
"example": {
"type": "Object",
"displayName": "Direct Cost",
"description": "",
"properties": {
"reference": {
"type": "String",
"displayName": "Reference",
"description": "User friendly reference for the direct transaction",
"required": false
},
"note": {
"type": "String",
"displayName": "Note",
"description": "The note attached to the direct transaction",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Note",
"details": "is not supported and will be ignored"
}
]
}
},
"contactRef": {
"type": "Object",
"displayName": "Contact Ref",
"description": "The contact associated with the direct transaction, if known",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "ContactRef",
"details": "is not supported and will be ignored"
}
]
}
},
"issueDate": {
"type": "DateTime",
"displayName": "Issue Date",
"description": "The date the direct transaction was issued",
"required": true
},
"currency": {
"type": "String",
"displayName": "Currency",
"description": "The currency of the direct transaction",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Currency",
"details": "If unspecified, base currency is assumed. Must agree with the bank account in PaymentAllocations"
}
]
}
},
"currencyRate": {
"type": "Number",
"displayName": "Currency Exchange Rate",
"description": "The exchange rate between the currency of the direct transaction and the base currency of the company",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "CurrencyRate",
"details": "Required if the currency is not the base currency"
}
]
}
},
"subTotal": {
"type": "Number",
"displayName": "Sub Total Amount",
"description": "The total amount of the direct transaction excluding any taxes",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "SubTotal",
"details": "is not supported and will be ignored"
}
]
}
},
"taxAmount": {
"type": "Number",
"displayName": "Tax Amount",
"description": "The total amount of tax on the direct transaction",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "TaxAmount",
"details": "is not supported and will be ignored"
}
]
}
},
"totalAmount": {
"type": "Number",
"displayName": "Total Amount",
"description": "The amount of the direct transaction, inclusive of tax",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "TotalAmount",
"details": "is not supported and will be ignored"
}
]
}
},
"lineItems": {
"type": "Array",
"displayName": "Direct Transaction Lines",
"description": "A collection of lines that detail items related to the direct transaction",
"properties": {
"description": {
"type": "String",
"displayName": "Description",
"description": "Friendly name of the goods or services purchased",
"required": false
},
"unitAmount": {
"type": "Number",
"displayName": "Unit Amount",
"description": "The price of each unit of goods or services",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "LineItems.UnitAmount",
"details": "is not supported and will be ignored"
}
]
}
},
"quantity": {
"type": "Number",
"displayName": "Quantity",
"description": "The number of units of goods or services purchased",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "LineItems.Quantity",
"details": "is not supported and will be ignored"
}
]
}
},
"discountAmount": {
"type": "Number",
"displayName": "Discount Amount",
"description": "The value, in the given currency, of any discounts applied",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "LineItems.DiscountAmount",
"details": "is not supported and will be ignored"
}
]
}
},
"discountPercentage": {
"type": "Number",
"displayName": "Discount Percentage",
"description": "The percentage rate of any discount that has been applied",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "LineItems.DiscountPercentage",
"details": "is not supported and will be ignored"
}
]
}
},
"subTotal": {
"type": "Number",
"displayName": "Sub Total Amount",
"description": "The amount of the line, inclusive of discounts but exclusive of tax",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "LineItems.SubTotal",
"details": "Required if totalAmount is not specified"
}
]
}
},
"taxAmount": {
"type": "Number",
"displayName": "Tax Amount",
"description": "The amount of tax for the line",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "LineItems.TaxAmount",
"details": "is not supported and will be ignored"
}
]
}
},
"totalAmount": {
"type": "Number",
"displayName": "Total Amount",
"description": "The total amount of the line, inclusive of discounts and tax",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "LineItems.TotalAmount",
"details": "Required if subTotal is not specified"
}
]
}
},
"accountRef": {
"type": "Object",
"displayName": "Nominal Account Reference",
"description": "Reference to the nominal account the line item is linked to",
"properties": {
"id": {
"type": "String",
"displayName": "Account ID",
"description": "The identifier for the account",
"required": true
},
"name": {
"type": "String",
"displayName": "Name",
"description": "Name of the account",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "AccountRef.Name",
"details": "is not supported and will be ignored"
}
]
}
}
},
"required": true
},
"taxRateRef": {
"type": "Object",
"displayName": "Tax Rate Reference",
"description": "Reference to the tax rate code the line item is linked to",
"properties": {
"id": {
"type": "String",
"displayName": "Identifier",
"description": "The reference identifier for the tax rate",
"required": true
},
"name": {
"type": "String",
"displayName": "Name",
"description": "The name of the tax rate referenced by the identifier",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "TaxRateRef.Name",
"details": "is not supported and will be ignored"
}
]
}
},
"effectiveTaxRate": {
"type": "Number",
"displayName": "Effective Tax Rate",
"description": "The total applied tax percentage, including compounding details",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "TaxRateRef.EffectiveTaxRate",
"details": "is not supported and will be ignored"
}
]
}
}
},
"required": true
},
"itemRef": {
"type": "Object",
"displayName": "Item Reference",
"description": "Reference to the product or service type, or inventory item",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "LineItems.ItemRef",
"details": "is not supported and will be ignored"
}
]
}
},
"trackingCategoryRefs": {
"type": "Array",
"displayName": "Tracking Category References",
"description": "A collection of categories this item is being tracked against",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "LineItems.TrackingCategoryRefs",
"details": "is not supported and will be ignored"
}
]
}
}
},
"required": true,
"validation": {
"warnings": [
{
"field": "LineItems",
"details": "Only one line is supported"
}
],
"information": []
}
},
"paymentAllocations": {
"type": "Array",
"displayName": "Payment Allocations",
"description": "A collection of payments allocated to the direct transaction",
"properties": {
"payment": {
"type": "Object",
"displayName": "Payment",
"description": "The payment to be allocated",
"properties": {
"accountRef": {
"type": "Object",
"displayName": "Account Reference",
"description": "Reference to the account associated with the allocated payment",
"properties": {
"id": {
"type": "String",
"displayName": "Account ID",
"description": "The identifier for the account",
"required": true
},
"name": {
"type": "String",
"displayName": "Name",
"description": "Name of the account",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "AccountRef.Name",
"details": "is not supported and will be ignored"
}
]
}
}
},
"required": true
},
"currency": {
"type": "String",
"displayName": "Currency",
"description": "The currency for the payment",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Payment.Currency",
"details": "is not supported and will be ignored"
}
]
}
},
"currencyRate": {
"type": "Number",
"displayName": "Currency Exchange Rate",
"description": "The exchange rate between the currency of the allocated payment and the currency of the base company",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Payment.CurrencyRate",
"details": "is not supported and will be ignored"
}
]
}
},
"paidOnDate": {
"type": "DateTime",
"displayName": "Paid On Date",
"description": "The date the payment was paid",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Payment.PaidOnDate",
"details": "is not supported and will be ignored"
}
]
}
},
"totalAmount": {
"type": "Number",
"displayName": "Total Amount",
"description": "The total amount that has been paid",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Payment.TotalAmount",
"details": "is not supported and will be ignored"
}
]
}
}
},
"required": true
},
"allocation": {
"type": "Object",
"displayName": "Allocation",
"description": "The allocation information",
"properties": {
"currency": {
"type": "String",
"displayName": "Currency",
"description": "The currency of the transaction",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Allocation.Currency",
"details": "is not supported and will be ignored"
}
]
}
},
"currencyRate": {
"type": "Number",
"displayName": "Currency Exchange Rate",
"description": "The exchange rate between the currency of the allocated payment and the currency of the transaction",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Allocation.CurrencyRate",
"details": "is not supported and will be ignored"
}
]
}
},
"allocatedOnDate": {
"type": "DateTime",
"displayName": "Allocated On Date",
"description": "The date the payment was allocated",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Allocation.AllocatedOnDate",
"details": "is not supported and will be ignored"
}
]
}
},
"totalAmount": {
"type": "Number",
"displayName": "Total Amount",
"description": "The total amount that has been allocated",
"required": false,
"validation": {
"warnings": [],
"information": [
{
"field": "Allocation.TotalAmount",
"details": "is not supported and will be ignored"
}
]
}
}
},
"required": true
}
},
"required": true,
"validation": {
"warnings": [
{
"field": "PaymentAllocations",
"details": "Only one line is supported"
}
],
"information": []
}
}
},
"required": true
}
},
{
"status": "200",
"contentType": "application/json",
"name": "FreeAgent",
"example": {
"type": "Object",
"displayName": "Direct Cost",
"description": "",
"properties": {
"id": {
"type": "String",
"displayName": "Unique Direct Transaction ID",
"description": "The identifier for the direct transaction, unique to the company",
"required": false,
"validation": {
"warnings": [
{
"field": "Id",
"details": "will be ignored on push. "
}
],
"information": []
}
},
"reference": {
"type": "String",
"displayName": "Reference",
"description": "User friendly reference for the direct transaction",
"required": false,
"validation": {
"warnings": [
{
"field": "Reference",
"details": "is not supported by FreeAgent and will not be mapped. "
}
],
"information": []
}
},
"note": {
"type": "String",
"displayName": "Note",
"description": "The note attached to the direct transaction",
"required": true,
"validation": {
"warnings": [],
"information": [
{
"field": "Note",
"details": "must be provided"
}
]
}
},
"contactRef": {
"type": "Object",
"displayName": "Contact Ref",
"description": "The contact associated with the direct transaction, if known",
"properties": {
"id": {
"type": "String",
"displayName": "Identifier",
"description": "The reference identifier for the record",
"required": false,
"validation": {
"warnings": [
{
"field": "ContactRef.Id",
"details": "is not supported by FreeAgent and will be ignored on push. "
}
],
"information": []
}
},
"dataType": {
"type": "String",
"displayName": "DataType",
"description": "The name of the data type for which the ID is valid.",
"required": false,
"validation": {
"warnings": [
{
"field": "ContactRef.DataType",
"details": "is not supported by FreeAgent and will be ignored on push. "
}
],
"information": []
}
}
},
"required": false
},
"issueDate": {
"type": "DateTime",
"displayName": "Issue Date",
"description": "The date the direct transaction was issued",
"required": true,
"validation": {
"warnings": [],
"information": [
{
"field": "IssueDate",
"details": "must be provided"
}
]
}
},
"currency": {
"type": "String",
"displayName": "Currency",
"description": "The currency of the direct transaction",
"required": false
},
"currencyRate": {
"type": "Number",
"displayName": "Currency Exchange Rate",
"description": "The exchange rate between the currency of the direct transaction and the base currency of the company",
"required": false,
"validation": {
"warnings": [
{
"field": "CurrencyRate",
"details": "will be ignored on push. "
}
],
"information": []
}
},
"lineItems": {
"type": "Array",
"displayName": "Direct Transaction Lines",
"description": "A collection of lines that detail items related to the direct transaction",
"properties": {
"description": {
"type": "String",
"displayName": "Description",
"description": "Friendly name of the goods or services purchased",
"required": false,
"validation": {
"warnings": [
{
"field": "LineItems.Description",
"details": "If a Note is provided, this field will be ignored on push. "
}
],
"information": []
}
},
"unitAmount": {
"type": "Number",
"displayName": "Unit Amount",
"description": "The price of each unit of goods or services",
"required": false,
"validation": {
"warnings": [
{
"field": "LineItems.UnitAmount",
"details": "will be ignored on push. "
}
],
"information": []
}
},
"quantity": {
"type": "Number",
"displayName": "Quantity",
"description": "The number of units of goods or services purchased",
"required": false,
"validation": {
"warnings": [
{
"field": "LineItems.Quantity",
"details": "will be ignored on push. "
}
],
"information": []
}
},
"subTotal": {
"type": "Number",
"displayName": "Sub Total Amount",
"description": "The amount of the line, inclusive of discounts but exclusive of tax",
"required": false
},
"taxAmount": {
"type": "Number",
"displayName": "Tax Amount",
"description": "The amount of tax for the line",
"required": false
},
"totalAmount": {
"type": "Number",
"displayName": "Total Amount",
"description": "The total amount of the line, inclusive of discounts and tax",
"required": false
},
"accountRef": {
"type": "Object",
"displayName": "Nominal Account Reference",
"description": "Reference to the nominal account the line item is linked to",
"properties": {
"id": {
"type": "String",
"displayName": "Account ID",
"description": "The identifier for the account",
"required": true,
"validation": {
"warnings": [],
"information": [
{
"field": "AccountRef.Id",
"details": "must be provided"
}
]
}
},
"name": {
"type": "String",
"displayName": "Name",
"description": "Name of the account",
"required": false,
"validation": {
"warnings": [
{
"field": "AccountRef.Name",
"details": "will be ignored on push. "
}
],
"information": []
}
}
},
"required": true
},
"taxRateRef": {
"type": "Object",
"displayName": "Tax Rate Reference",
"description": "Reference to the tax rate code the line item is linked to",
"properties": {
"id": {
"type": "String",
"displayName": "Identifier",
"description": "The reference identifier for the tax rate",
"required": false,
"validation": {
"warnings": [
{
"field": "TaxRateRef.Id",
"details": "will be ignored on push. "
}
],
"information": []
}
},
"name": {
"type": "String",
"displayName": "Name",
"description": "The name of the tax rate referenced by the identifier",
"required": false,
"validation": {
"warnings": [
{
"field": "TaxRateRef.Name",
"details": "will be ignored on push. "
}
],
"information": []
}
},
"effectiveTaxRate": {
"type": "Number",
"displayName": "Effective Tax Rate",
"description": "The total applied tax percentage, including compounding details",
"required": false,
"validation": {
"warnings": [
{
"field": "TaxRateRef.EffectiveTaxRate",
"details": "will be ignored on push. "
}
],
"information": []
}
}
},
"required": false
}
},
"required": true,
"validation": {
"warnings": [
{
"field": "LineItems",
"details": "Exactly one line item must be specified"
}
],
"information": []
}
},
"paymentAllocations": {
"type": "Array",
"displayName": "Payment Allocations",
"description": "A collection of payments allocated to the direct transaction",
"properties": {
"payment": {
"type": "Object",
"displayName": "Payment",
"description": "The payment to be allocated",
"properties": {
"id": {
"type": "String",
"displayName": "Identifier",
"description": "The identifier for the allocated payment",
"required": false
},
"note": {
"type": "String",
"displayName": "Note",
"description": "Any additional text based information associated with the allocated payment",
"required": false
},
"reference": {
"type": "String",
"displayName": "Reference",
"description": "Reference associated with the allocated payment",
"required": false
},
"accountRef": {
"type": "Object",
"
# --- truncated at 32 KB (145 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/codat/refs/heads/main/examples/codat-get-create-directcosts-model-example.json