Request

Response

    Expense Items
    POST

    v1/containers/{containerId}/expenses/{expenseId}/items

    Creates an expense item in the specified expense of a given project.

    Note that this endpoint is compatible with both BIM 360 and Autodesk Construction Cloud (ACC) projects.

    Resource Information

    Method and URI
    POST
    https://developer.api.autodesk.com/cost/v1/containers/:containerId/expenses/:expenseId/items
    Authentication Context
    user context required
    Required OAuth Scopes
    data:write
    Data Format
    JSON

    Request

    Headers

    Authorization*
    string
    Must be Bearer <token>, where <token> is obtained via a three-legged OAuth flow.
    Content-Type*
    string
    Must be application/json
    region
    string
    The region where the project data resides, to which this request is routed.

    This header is optional because the request is automatically routed to a target region based on the project ID or container ID. Using the header, though, can save lookup time on each API call. For information about verifying the region the data resides in, see the Working with BIM 360 Services in Different Regions section on the API Basics page.

    Possible values: EMEA, US. For the full list of supported regions, see the Regions page.

    * Required

    Request

    URI Parameters

    containerId
    string: UUID
    The ID of the cost container for the project. Each project is assigned a container that stores all of the cost data for the project.

    To find the container ID, see the Retrieve a Cost Container ID tutorial.

    In ACC projects, the container ID is the same as the project ID. To obtain a project ID, use GET projects.

    expenseId
    string: UUID
    The unique ID of the expense to which the new expense item belongs. You can obtain this ID from the response to the POST expenses or GET expenses endpoint.

    Request

    Body Structure

    The Expense Item.

    id
    string: UUID
    The unique identifier of the expense item.
    budgetId
    string: UUID
    The ID of the budget to which the expense item belongs.
    budgetCode
    string
    The code of an existing budget.
    contractId
    string,null
    The ID of the contract to which the expense item belongs.
    number
    string
    The sequence number for the expense item, which will be auto-generated if it is not passed

    Max length: 255

    name*
    string
    The name of the expense item.

    Max length: 1024

    description
    string
    A detailed description of the expense item.

    Max length: 2048

    note
    string
    A note to attach to the expense item. The note consists of Tiptap-formatted rich text.
    scope
    string,null
    The applicable scope of the expense item. Possible values: full, partial.
    quantity
    number
    The number of units of the expense item.
    unitPrice
    number,string,null
    The price per unit of the expense item.
    unit
    string
    The expense item’s unit of measure.
    amount
    number,string,null
    The total price of the expense item, equals to quantity * unitPrice.
    exchangeRate
    number,string,null
    The exchange rate that applies to the expense item’s base currency price. For example, provide the value 0.7455 for a foreign currency that’s worth 0.7455 of your base currency. Default:1. It’s also 1 if multi-currency is not enabled.
    externalId
    string
    The identifier assigned to an item in its original external ERP system. Use this ID to track and look up data within the integrated system. Note that this value comes from the item’s ID in the external system.

    Max length: 255

    externalSystem
    string
    The name of the external ERP system integrated with Cost Management. Use this name to identify and search for data within the integrated system.

    Max length: 255

    externalMessage
    string
    A message generated by the external ERP system that explains the sync status of the integration. For example, common values include success or fail to indicate the result of the integration operation.

    Max length: 255

    lastSyncTime
    datetime: ISO 8601
    The date and time when the item was last synchronized with the external ERP system. This value is updated by the external system and is in ISO 8601 format.
    integrationState
    string,null
    The state of the item during the integration with the external ERP system (such as SignNow). An item can be a budget, contract, main contract, main contract item, cost item, expense, expense item, change order, or schedule of value. For more details, see Integrate with External System tutorial. Possible values:

    locked: the item is currently locked within the ERP system, preventing modifications until unlocked. To unlock and modify the item, use the relevant PATCH endpoint to set integrationState to null. For example, for a budget, call PATCH budgets. For a contract, call PATCH contracts. For more details, see the Help documentation.

    integrated: the item has been successfully added to the ERP system.

    failed: the item encountered an error during the integration process and was not successfully added to the ERP system. For example, if a user tries to integrate contracts from an ERP system and the updates fail, the integrationState can be set to failed. Retry the sync process or analyze the issue if it continues to fail.

    null: The item has not been integrated with the ERP system. This is default value.

    For more information regarding integrations within the Cost Management system, see Integrations in Cost Management.

    * Required

    Response

    HTTP Status Code Summary

    201
    Created
    Success
    400
    Bad Request
    The parameters are invalid.
    401
    Unauthorized
    The provided bearer token is invalid.
    403
    Forbidden
    Forbidden. The user or service represented by the bearer token does not have permission to perform this operation.
    404
    Not Found
    The resource or endpoint cannot be found.
    409
    Conflict
    The request could not be completed due to a conflict with the current state of the resource.
    429
    Too Many Requests
    Rate limit exceeded. Retry your request after a few minutes.
    500
    Internal Server Error
    An unexpected error occurred on the server.
    503
    Service Unavailable
    Service unavailable.

    Response

    Body Structure (201)

    id
    string: UUID
    The unique identifier of the expense item.
    budgetId
    string,null
    The ID of the budget to which the expense item belongs.
    contractId
    string: UUID
    The ID of the contract to which the expense item belongs.
    number
    string
    The sequence number for the expense item.
    name
    string
    The name of the expense item.

    Max length: 1024

    description
    string
    The detailed description of the expense item.

    Max length: 2048

    note
    string
    The note attached to the expense item, if returned. The note consists of Tiptap formatted rich text. For more information, see https://tiptap.dev.
    scope
    string,null
    The applicable scope of the expense item. Possible values: full, partial.
    quantity
    number
    The number of units of the expense item.
    unitPrice
    number,string,null
    The price per unit of the expense item.
    unit
    string
    The expense item’s unit of measure.
    amount
    number,string,null
    The total price of the expense item.
    aggregateBy
    string,null
    The aggregate type of the expense item. Possible values: workCompleted, workCompletedQty, materialsOnSite
    exchangeRate
    number,string,null
    The exchange rate that applies to the expense item’s base currency price. For example, provide the value 0.7455 for a foreign currency that’s worth 0.7455 of your base currency. Default:1. It’s also 1 if multi-currency is not enabled.
    originalExchangeRate
    number,string,null
    The original exchange rate from the expense item’s associated contract. Default:1. It’s also 1 if multi-currency is not enabled.
    realizedGainOrLoss
    number,string,null
    The gain or loss on the expense item, calculated as follows:amount * exchangeRate / originalExchangeRate - amount
    externalId
    string
    The identifier assigned to an item in its original external ERP system. Use this ID to track and look up data within the integrated system. Note that this value comes from the item’s ID in the external system.

    Max length: 255

    externalSystem
    string
    The name of the external ERP system integrated with Cost Management. Use this name to identify and search for data within the integrated system.

    Max length: 255

    externalMessage
    string
    A message generated by the external ERP system that explains the sync status of the integration. For example, common values include success or fail to indicate the result of the integration operation.

    Max length: 255

    lastSyncTime
    datetime: ISO 8601
    The date and time when the item was last synchronized with the external ERP system. This value is updated by the external system and is in ISO 8601 format.
    createdAt
    datetime: ISO 8601
    The date and time that the item was created, in ISO 8601 format.
    updatedAt
    datetime: ISO 8601
    The date and time that the item was last updated, in ISO 8601 format.
    integrationState
    string,null
    The state of the item during the integration with the external ERP system (such as SignNow). An item can be a budget, contract, main contract, main contract item, cost item, expense, expense item, change order, or schedule of value. For more details, see Integrate with External System tutorial. Possible values:

    locked: the item is currently locked within the ERP system, preventing modifications until unlocked. To unlock and modify the item, use the relevant PATCH endpoint to set integrationState to null. For example, for a budget, call PATCH budgets. For a contract, call PATCH contracts. For more details, see the Help documentation.

    integrated: the item has been successfully added to the ERP system.

    failed: the item encountered an error during the integration process and was not successfully added to the ERP system. For example, if a user tries to integrate contracts from an ERP system and the updates fail, the integrationState can be set to failed. Retry the sync process or analyze the issue if it continues to fail.

    null: The item has not been integrated with the ERP system. This is default value.

    For more information regarding integrations within the Cost Management system, see Integrations in Cost Management.

    integrationStateChangedAt
    string,null
    The date and time that the item’s integration status was last changed.
    integrationStateChangedBy
    string,null
    The user who last changed the integration status. This is the ID of a user managed by the BIM 360/ACC Admin.

    Example

    Success

    Request

    curl -v 'https://developer.api.autodesk.com/cost/v1/containers/e94b9bc8-1775-4d76-9b1d-c613e120ccff/expenses/f6445638-ca68-4e3c-9160-15864de6b818/items' \
      -X 'POST' \
      -H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
      -H 'Content-Type: application/json' \
      -d '{
            "id": "494116a0-c45a-4066-8880-12a345622198",
            "budgetId": "48934441-e392-49d7-bf58-8dea43d413ae",
            "budgetCode": "84720010121001FEE",
            "contractId": "3c3392b0-b865-11e7-9d8a-1953dd8bcb31",
            "number": "0001",
            "name": "Site Management Staff",
            "description": "Site Management Staff",
            "note": "Site Management Staff",
            "scope": "full",
            "quantity": "The quantity of the expense item. For example 1.",
            "unitPrice": "1000.0000",
            "unit": "ls",
            "amount": "1000.0000",
            "exchangeRate": "1.0000",
            "externalId": "10010-99-AB",
            "externalSystem": "Sage300",
            "externalMessage": "Success.",
            "lastSyncTime": "2019-09-05T01:00:12.989Z",
            "integrationState": "locked"
          }'
    
    Show More

    Response

    {
      "id": "48934441-e392-49d7-bf58-8dea43d413ae",
      "budgetId": "48934441-e392-49d7-bf58-8dea43d413ae",
      "contractId": "48934441-e392-49d7-bf58-8dea43d413ae",
      "number": 1,
      "name": "Site Management Staff",
      "description": "Site Management Staff",
      "note": "Site Management Staff",
      "scope": "full",
      "quantity": "The quantity of the expense item. For example 1.",
      "unitPrice": "1000.0000",
      "unit": "ls",
      "amount": "1000.0000",
      "aggregateBy": "workCompleted",
      "exchangeRate": "1.0000",
      "originalExchangeRate": "1.0000",
      "realizedGainOrLoss": "1000.0000",
      "externalId": "10010-99-AB",
      "externalSystem": "Sage300",
      "externalMessage": "Success.",
      "lastSyncTime": "2019-09-05T01:00:12.989Z",
      "createdAt": "2019-01-06T01:24:22.678Z",
      "updatedAt": "2019-09-05T01:00:12.989Z",
      "integrationState": "locked",
      "integrationStateChangedAt": "2019-09-05T01:00:12.989Z",
      "integrationStateChangedBy": "CED9LVTLHNXV"
    }
    
    Show More