v1/containers/{containerId}/expenses
Creates an expense in the given project.
Resource Information
| Method and URI | POST https://developer.api.autodesk.com/cost/v1/containers/:containerId/expenses |
| Authentication Context | User context required |
| Required OAuth Scopes | data:write |
| Data Format | JSON |
Request
Headers
| Authorization* string | Must be Bearer <token>, where <token> is a three-legged access token obtained via an Authorization Code flow or a Secure Service Account (SSA) flow.
The SSA flow is designed for headless server-to-server operations. While it functions like a two-legged flow (no user interaction), it is classified as three-legged because it preserves user context. |
| Content-Type* string | Must be application/json |
| region string | Specifies the region where the project data resides.
By default, the request is routed automatically. However, specifying the region can improve performance by avoiding lookup overhead. Possible values: country or region codes such as To verify your project’s region, refer to the Working with BIM 360 Services in Different Regions section on the API Basics page. |
Request
URI Parameters
| containerId string: UUID | The ID of the project (the container ID is the same as the project ID). To obtain the project ID, see GET projects. |
Request
Body Structure
The Expense.
| id string | The unique identifier of the expense. |
| supplierId string,null | The supplier for the expense. This is the ID of a company managed by BIM 360 Admin. |
| supplierCompanyUid string,null | The unique ID (UUID) of the company in this hub. Detailed company information can be retrieved using this UUID by calling GET companies/:company_id in the response. |
| supplierName string,null | The supplier company name for the expense. Any company can be used regardless the ones added in Hub Administration. Required if supplierId is not set.
Max length: 255 |
| contractId string,null | The ID of the contract from which to create expense items. Expense items are generated from the contract’s root schedule of values; use scheduleOfValueIds to include only a subset. |
| number string | The auto-generated sequence number for the expense.
Max length: 255 |
| name* string | The name of the expense.
Max length: 1024 |
| description string | The detailed description of the expense.
Max length: 2048 |
| note string | The note attached to the expense, if returned. The note consists of Tiptap formatted rich text. For more information, see https://tiptap.dev. |
| term string | The term of the expense. This is customizable by the project administrator. |
| referenceNumber string | The user-provided reference number of the expense. |
| type string,null | The type of the expense. This is customizable by the project administrator.
Max length: 128 |
| scope string,null | The applicable scope of the expense. Possible values: full, partial. |
| purchasedBy string,null | The user who purchased the expense. This is the ID of a user managed by BIM 360 Admin. |
| status string,null | The status of the expense. Possible values: draft, pending, revise, rejected, approved, paid. |
| paymentDue string,null | The payment due date of the expense. |
| issuedAt string,null | The date and time when the expense was issued. |
| receivedAt string,null | The date and time when the expense was received. |
| 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:
For more information regarding integrations within the Cost Management system, see Integrations in Cost Management. |
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 | The unique identifier of the expense. |
| supplierId string,null | The ID of a company managed by a BIM 360 Admin. Detailed company information can be retrieved by calling GET projects/:project_id/companies and locating the member_group_id in the response. |
| supplierCompanyUid string,null | The unique ID (UUID) of the company in this hub. Detailed company information can be retrieved using this UUID by calling GET companies/:company_id in the response. |
| supplierName string,null | The supplier company name for the expense. Any company can be used regardless the ones added in Hub Administration.
Max length: 255 |
| mainContractId string | The ID of the Main Contract to which the expense belongs. |
| budgetPaymentId string,null | The ID of the Budget Pay App the expense amount will be aggregated to. |
| number string | The auto-generated sequence number for the expense.
Max length: 255 |
| name string | The name of the expense.
Max length: 1024 |
| description string | The detailed description of the expense.
Max length: 2048 |
| note string | The note attached to the expense, if returned. The note consists of Tiptap formatted rich text. For more information, see https://tiptap.dev. |
| term string | The term of the expense. This is customizable by the project administrator. |
| referenceNumber string | The user-provided reference number of the expense. |
| type string,null | The type of the expense. This is customizable by the project administrator.
Max length: 128 |
| scope string,null | The applicable scope of the expense. Possible values: full, partial. |
| creatorId string,null | The user who created the expense. This is the ID of a user managed by BIM 360 Admin. |
| changedBy string,null | The user who made the last change to the expense. This is the ID of a user managed by BIM 360 Admin. |
| purchasedBy string,null | The user who purchased the expense. This is the ID of a user managed by BIM 360 Admin. |
| status string,null | The status of the expense. Possible values: draft, pending, revise, rejected, approved, paid. |
| amount number,string,null | The total value of the subitems of the expense. |
| paymentDue string,null | The payment due date and time of the expense. |
| issuedAt string,null | The date and time when the expense was issued. |
| receivedAt string,null | The date and time when the expense was received. |
| approvedAt string,null | The date and time when the expense was approved. |
| paidAt string,null | The date and time when the expense was paid. |
| forecastDistributionAt string,null | The date and time determine which distribution period this expense belongs to, after the status of status is set to approved or paid. |
| aggregateBy string,null | Not relevant |
| customColumns object | Not relevant |
| budget object | Not relevant |
| contract object | Not relevant |
| 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:
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/Forma Admin. |
| 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. |
Example
Success
Request
curl -v 'https://developer.api.autodesk.com/cost/v1/containers/e94b9bc8-1775-4d76-9b1d-c613e120ccff/expenses' \
-X 'POST' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"id": "48934441-e392-49d7-bf58-8dea43d413ae",
"supplierId": "GF8XKPKWM38E",
"supplierCompanyUid": "683904a0-47ce-4146-ac2d-a3840f00e0f4",
"supplierName": "Supply US",
"contractId": "48934441-e392-49d7-bf58-8dea43d413af",
"number": 1,
"name": "Site Management Staff",
"description": "Site Management Staff",
"note": "Site Management Staff",
"term": " Net 30",
"referenceNumber": 20,
"type": "expense",
"scope": "full",
"purchasedBy": "CED9LVTLHNXV",
"status": "draft",
"paymentDue": "2019-05-05T01:00:12.989Z",
"issuedAt": "2019-02-05T01:00:12.989Z",
"receivedAt": "2019-02-05T01:00:12.989Z",
"externalId": "10010-99-AB",
"externalSystem": "Sage300",
"externalMessage": "Success.",
"lastSyncTime": "2019-09-05T01:00:12.989Z",
"integrationState": "locked"
}'
Response
{
"id": "efcc4961-6115-4147-84c7-51b37be933c8",
"supplierId": "GF8XKPKWM38E",
"supplierCompanyUid": "683904a0-47ce-4146-ac2d-a3840f00e0f4",
"supplierName": "Supply US",
"mainContractId": "48934441-e392-49d7-bf58-8dea43d413ae",
"budgetPaymentId": "ce4af4e1-d14c-4c9b-89fb-0d932306f093",
"number": 1,
"name": "Site Management Staff",
"description": "Site Management Staff",
"note": "Site Management Staff",
"term": " Net 30",
"referenceNumber": 20,
"type": "expense",
"scope": "full",
"creatorId": "CED9LVTLHNXV",
"changedBy": "CED9LVTLHNXV",
"purchasedBy": "CED9LVTLHNXV",
"status": "draft",
"amount": "1000.0000",
"paymentDue": "2019-05-05T01:00:12.989Z",
"issuedAt": "2019-02-05T01:00:12.989Z",
"receivedAt": "2019-02-05T01:00:12.989Z",
"approvedAt": "2019-02-05T01:00:12.989Z",
"paidAt": "2019-02-05T01:00:12.989Z",
"forecastDistributionAt": "2019-02-05T01:00:12.989Z",
"aggregateBy": "workCompleted",
"customColumns": {
"budget": {},
"contract": {}
},
"externalId": "10010-99-AB",
"externalSystem": "Sage300",
"externalMessage": "Success.",
"lastSyncTime": "2019-09-05T01:00:12.989Z",
"integrationState": "locked",
"integrationStateChangedAt": "2019-09-05T01:00:12.989Z",
"integrationStateChangedBy": "CED9LVTLHNXV",
"createdAt": "2019-01-06T01:24:22.678Z",
"updatedAt": "2019-09-05T01:00:12.989Z"
}