Codat · Example Payload

Codat Create Direct Cost Example

Unified_API

Codat Create Direct Cost 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

Raw ↑
{
  "operationId": "create-direct-cost",
  "method": "POST",
  "path": "/companies/{companyId}/connections/{connectionId}/push/directCosts",
  "summary": "Create direct cost",
  "requestExamples": [
    {
      "contentType": "application/json",
      "name": "QuickBooks Desktop",
      "example": {
        "reference": "test ref",
        "note": "directCost 21/03 09.20",
        "contactRef": {
          "id": "80000001-1671793885",
          "dataType": "suppliers"
        },
        "issueDate": "2023-03-21T10:19:52.223Z",
        "currency": "USD",
        "lineItems": [
          {
            "description": "test description line 1",
            "unitAmount": 7,
            "quantity": 1,
            "discountAmount": 0,
            "discountPercentage": 0,
            "subTotal": 99,
            "taxAmount": 360,
            "totalAmount": 70,
            "accountRef": {
              "id": "8000000D-1671793811",
              "name": "Purchases - Hardware for Resale"
            },
            "itemRef": {
              "id": "80000001-1674566705",
              "name": "item test"
            },
            "trackingCategoryRefs": [
              {
                "id": "80000001-1674553252",
                "name": "Class 1"
              }
            ]
          }
        ],
        "paymentAllocations": [
          {
            "payment": {
              "note": "payment allocations note",
              "reference": "payment allocations reference",
              "accountRef": {
                "id": "80000028-1671794219",
                "name": "Bank Account 1"
              },
              "paidOnDate": "2023-01-28T10:19:52.223Z",
              "totalAmount": 54
            },
            "allocation": {
              "currencyRate": 0,
              "allocatedOnDate": "2023-01-29T10:19:52.223Z",
              "totalAmount": 88
            }
          }
        ],
        "subTotal": 362,
        "taxAmount": 4,
        "totalAmount": 366
      }
    },
    {
      "contentType": "application/json",
      "name": "Xero",
      "example": {
        "reference": "Scenario One neg DC",
        "contactRef": {
          "id": "699f0091-b127-4796-9f15-41a2f42abeb2",
          "dataType": "suppliers"
        },
        "issueDate": "2023-02-25",
        "currency": "GBP",
        "lineItems": [
          {
            "description": "negative direct cost",
            "unitAmount": 35,
            "quantity": -1,
            "subTotal": -35,
            "taxAmount": -7,
            "totalAmount": -42,
            "itemRef": {
              "id": "965cfc0e-4d80-4059-9641-4a392f9ad549"
            },
            "taxRateRef": {
              "id": "INPUT2"
            }
          }
        ],
        "paymentAllocations": [
          {
            "payment": {
              "accountRef": {
                "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4"
              },
              "currency": "GBP"
            },
            "allocation": {
              "totalAmount": -42
            }
          }
        ],
        "subTotal": -35,
        "taxAmount": -7,
        "totalAmount": -42
      }
    },
    {
      "contentType": "application/json",
      "name": "FreeAgent",
      "example": {
        "issueDate": "2023-02-12",
        "currency": "GBP",
        "lineItems": [
          {
            "unitAmount": 15,
            "quantity": 1,
            "subTotal": 15,
            "accountRef": {
              "id": "288"
            }
          }
        ],
        "paymentAllocations": [
          {
            "payment": {
              "accountRef": {
                "id": "750-1"
              }
            },
            "allocation": {}
          }
        ],
        "subTotal": 15,
        "taxAmount": 0,
        "totalAmount": 15
      }
    },
    {
      "contentType": "application/json",
      "name": "Sage Intacct",
      "example": {
        "reference": "test ref",
        "note": "Test 1",
        "issueDate": "2023-03-31T00:00:00",
        "currency": "USD",
        "currencyRate": 0.5,
        "lineItems": [
          {
            "accountRef": {
              "id": "195"
            },
            "unitAmount": 9.99,
            "quantity": 1,
            "subTotal": 9.99,
            "taxAmount": 2,
            "totalAmount": 11.99
          }
        ],
        "paymentAllocations": [
          {
            "payment": {
              "id": "4355",
              "note": "test note",
              "reference": "test reference",
              "accountRef": {
                "id": "348",
                "name": "CMRR Renewal"
              },
              "currency": "USD",
              "paidOnDate": "2023-03-31T00:00:00",
              "totalAmount": 11.99
            },
            "allocation": {
              "currency": "USD",
              "allocatedOnDate": "2023-03-31T00:00:00",
              "totalAmount": 11.99
            }
          }
        ],
        "subTotal": 9.99,
        "taxAmount": 2,
        "totalAmount": 11.99
      }
    }
  ],
  "responseExamples": [
    {
      "status": "200",
      "contentType": "application/json",
      "name": "FreeAgent",
      "example": {
        "changes": [],
        "data": {
          "id": "372060709",
          "issueDate": "2023-02-12T00:00:00",
          "currency": "GBP",
          "currencyRate": 1,
          "lineItems": [
            {
              "accountRef": {
                "id": "288"
              },
              "unitAmount": 15,
              "quantity": 1,
              "subTotal": 15,
              "taxAmount": 3,
              "totalAmount": 18,
              "trackingCategoryRefs": []
            }
          ],
          "paymentAllocations": [
            {
              "payment": {
                "id": "372060709",
                "accountRef": {
                  "id": "750-1"
                },
                "currency": "GBP",
                "paidOnDate": "2023-02-12T00:00:00",
                "totalAmount": 18
              },
              "allocation": {
                "currency": "GBP",
                "allocatedOnDate": "2023-02-12T00:00:00",
                "totalAmount": 18
              }
            }
          ],
          "subTotal": 15,
          "taxAmount": 3,
          "totalAmount": 18,
          "sourceModifiedDate": "2023-02-12T15:15:53Z"
        },
        "dataType": "directCosts",
        "companyId": "a23f79d6-7cc9-486c-b388-8ab88faea947",
        "pushOperationKey": "0659a24d-2b66-4979-971e-4b98c3ed7f61",
        "dataConnectionKey": "35e38cd5-66ea-41b8-b555-9efd5b792b68",
        "requestedOnUtc": "2023-02-12T15:15:51.1723204Z",
        "completedOnUtc": "2023-02-12T15:15:54.7161036Z",
        "status": "Success",
        "statusCode": 200
      }
    },
    {
      "status": "200",
      "contentType": "application/json",
      "name": "Sage Intacct",
      "example": {
        "changes": [
          {
            "type": "Created",
            "recordRef": {
              "dataType": "directCosts"
            }
          }
        ],
        "data": {
          "reference": "test ref",
          "note": "Test 1",
          "issueDate": "2023-03-31T00:00:00",
          "currency": "USD",
          "currencyRate": 0.5,
          "lineItems": [
            {
              "accountRef": {
                "id": "195"
              },
              "taxRateRef": {
                "id": "95"
              },
              "unitAmount": 9.99,
              "quantity": 1,
              "subTotal": 9.99,
              "taxAmount": 2,
              "totalAmount": 11.99,
              "trackingCategoryRefs": []
            }
          ],
          "paymentAllocations": [
            {
              "payment": {
                "id": "4355",
                "note": "test note",
                "reference": "test reference",
                "accountRef": {
                  "id": "348",
                  "name": "CMRR Renewal"
                },
                "currency": "USD",
                "paidOnDate": "2023-03-31T00:00:00",
                "totalAmount": 11.99
              },
              "allocation": {
                "currency": "USD",
                "allocatedOnDate": "2023-03-31T00:00:00",
                "totalAmount": 11.99
              }
            }
          ],
          "subTotal": 9.99,
          "taxAmount": 2,
          "totalAmount": 11.99
        },
        "dataType": "directCosts",
        "companyId": "d7f743a9-1804-4116-8c8a-e606f7e2f66c",
        "pushOperationKey": "0d74c1ad-00ad-4731-9e6e-98a86056959a",
        "dataConnectionKey": "fa139396-523a-4a58-bf2b-8da82c8a673f",
        "requestedOnUtc": "2023-03-31T12:49:51.6503324Z",
        "status": "Pending",
        "statusCode": 202
      }
    },
    {
      "status": "200",
      "contentType": "application/json",
      "name": "Xero",
      "example": {
        "changes": [],
        "data": {
          "reference": "Scenario One neg DC",
          "contactRef": {
            "id": "699f0091-b127-4796-9f15-41a2f42abeb2",
            "dataType": "suppliers"
          },
          "issueDate": "2023-02-25T00:00:00",
          "currency": "GBP",
          "lineItems": [
            {
              "description": "negative direct cost",
              "taxRateRef": {
                "id": "INPUT2"
              },
              "unitAmount": 35,
              "quantity": -1,
              "subTotal": -35,
              "taxAmount": -7,
              "totalAmount": -42,
              "itemRef": {
                "id": "965cfc0e-4d80-4059-9641-4a392f9ad549"
              },
              "trackingCategoryRefs": []
            }
          ],
          "paymentAllocations": [
            {
              "payment": {
                "accountRef": {
                  "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4"
                },
                "currency": "GBP",
                "paidOnDate": "0001-01-01T00:00:00",
                "totalAmount": 0
              },
              "allocation": {
                "totalAmount": -42
              }
            }
          ],
          "subTotal": 0,
          "taxAmount": -7,
          "totalAmount": -42
        },
        "dataType": "directCosts",
        "companyId": "b5efee61-3fab-4a5d-9247-de03d6eda6db",
        "pushOperationKey": "33347930-fcc5-4f95-aa13-4a0f7291b559",
        "dataConnectionKey": "1e355304-4476-422e-95cb-fa2a6d47fab4",
        "requestedOnUtc": "2023-02-24T13:43:26.5109173Z",
        "status": "Pending",
        "validation": {
          "errors": [],
          "warnings": []
        },
        "statusCode": 202
      }
    }
  ]
}