API Reference > Define settings for data collections > Cost centers
  

Cost centers

A cost center is an area or department within an organization that is generally represented by a unique identifier to which business expenses are allocated. If there is a cost required to deliver the data to a Data User or if the there is a cost required to create the data collection that was requested by a Data User, the cost can be charged to the cost center of the Data User.

Create cost centers

Use a REST API to create cost centers in Data Marketplace.

Endpoint and method

The following table describes the connection properties for the API:
Property
Description
Endpoint
/api/v1/integration/costCenters
Method
POST

Request

The following table describes the parameters that you enter in the body of the API payload:
Parameter
Description
Additional Information
name
Required. Enter a name for the cost center.
Ensure that you enter a unique value.
Data Marketplace doesn't consider the letter case when it verifies the uniqueness of the name parameter's value. For example, if you try to name a cost center as "MKT010" while a cost center called "mkt0101" already exists, the API call fails.
description
Optional. Enter a description for the cost center.
-
Note: You can create only 30 cost centers per API call.

Example request

The following example shows how you can use an API to create a cost center:
{
"items": [
{
"name": "RTL-367APJ",
"description": "The cost center for the APJ retail department."
},
{
"name": "RTL-367EMEA",
"description": "The cost center for the EMEA retail department."
}
]
}

Response

When you pass the API payload in the REST client, the client displays a response for the parameter values that you have entered.
The following example shows the response of an API call to create a cost center:
{
"processingTime": 23297,
"objects": [
{
"index": 1,
"id": "980dfbc0-c7c0-4e24-ba47-4477bb9bf19c",
"refId": "320dnbc0-e4r0-4r15-by42-3457bg7hf11x",
"name": "RTL-367APJ"
},
{
"index": 2,
"id": "8039d329-46fa-4048-b8e0-9e52a6d73583",
"refId": "783rebc4-c7v5-6e23-xz17-4937bb3nm13t",
"name": "RTL-367EMEA"
}
]
}
The following table describes the parameters of each cost center that is created:
Parameter
Description
index
The position of the cost center in the objects JSON array. This value does not impact how the cost center is used by a Data Marketplace user.
id
System generated unique identifier of the cost center.
refId
Reference identifier of the cost center.
name
Name of the cost center.

Retrieve cost centers

Use a REST API to retrieve the details of cost centers in Data Marketplace.

Endpoint and method

The following table describes the connection properties for the API:
Property
Description
Endpoint
/api/v1/integration/costCenters
Method
GET
Note: Before you call this API, consider the following:
For more information, see How to call a Data Marketplace API.

Request

The following table describes the parameters that you enter in the request query:
Parameter
Description
Additional Information
ids
Optional. Enter the system generated unique identifier of a cost center.
To enter more than one value, use the following format:
ids=<value1>&ids=<value2>
search
Optional. Enter the search term that you want to use to find a cost center.
Ensure that the search term that you enter don't contain an asterisk (*).
fields
Optional. Enter the fields on which the search term applies. The terms that you entered in the search field parameter are used to search the fields that you specify here.
Enter the following values:
  • - NAME
  • - DESCRIPTION
createdDateFrom
Optional. To find cost centers that were created between a date range, enter the initial date when the cost center were created.
To specify a date, use the YYYY-MM-DD format. The value that you specify is automatically converted and stored in the Coordinated Universal Time (UTC) time standard.
If you have specified a value for the createdDateFrom parameter, ensure that you also enter a value for the createdDateTo parameter.
createdDateTo
Optional. To find cost centers that were created between a date range, enter the latest date when the cost center were created.
To specify a date, use the YYYY-MM-DD format. The value that you specify is automatically converted and stored in the Coordinated Universal Time (UTC) time standard.
If you have specified a value for the createdDateTo parameter, ensure that you also enter a value for the createdDateFrom parameter.
modifiedDateFrom
Optional. To find cost centers that were modified between a date range, enter the initial date when the cost center were modified.
To specify a date, use the YYYY-MM-DD format. The value that you specify is automatically converted and stored in the Coordinated Universal Time (UTC) time standard.
If you have specified a value for the modifiedDateFrom parameter, ensure that you also enter a value for the modifiedDateTo parameter.
modifiedDateTo
Optional. To find cost centers that were modified between a date range, enter the latest date when the cost center were modified.
To specify a date, use the YYYY-MM-DD format. The value that you specify is automatically converted and stored in the Coordinated Universal Time (UTC) time standard.
If you have specified a value for the modifiedDateTo parameter, ensure that you also enter a value for the modifiedDateFrom parameter.
sortByField
Optional. Specify the parameters to sort the search results.
To sort the search results, enter one of the following values:
  • - NAME
  • - ID
  • - CREATED_BY
  • - CREATED_ON
  • - MODIFIED_BY
  • - MODIFIED_ON
Default value is MODIFIED_ON.
sort
Optional. Set the sorting order of the search results.
Enter one of the following values:
  • - To sort the search results by ascending order, enter ASC.
  • - To sort the search results by descending order, enter DESC.
Default value is DESC.
offset
Optional. Enter the starting index for the paginated results.
Default value is 0.
limit
Optional. Enter the maximum number of results.
Default value is 50.
Maximum value is 100.
Note: The API has no payload.

Example request

The following example shows how you can use an API to retrieve cost centers:
https://{{CDMP_URL}}/api/v1/integration/costCenters?search=SK&fields=NAME&ids=8039d329-46fa-4048-b8e0-9e52a6d73583&createdDateFrom=2012-09-12&createdDateTo=2023-09-12&modifiedDateFrom=2012-09-12&modifiedDateTo=2023-09-12&sortByField=MODIFIED_ON&sort=DESC&offset=0&limit=1

Response

When you pass the API query parameters in the REST client, the client displays a response for the parameter values that you have entered.
The following example shows the response of an API call to retrieve a cost center:
{
"processingTime": 7986,
"offset": 0,
"limit": 1,
"totalCount": 1,
"objects": [
{
"id": "980dfbc0-c7c0-4e24-ba47-4477bb9bf19c",
"name": "RTL-367APJ",
"description": "The cost center for the APJ retail department."
"createdBy": "3q961bWdAHqjfSS7orgR8N",
"createdOn": "2022-07-26T11:18:20.029Z",
"modifiedBy": "3q961bWdAHqjfSS7orgR8N",
"modifiedOn": "2022-07-26T11:23:32.881Z"
}
]
}
The following table describes the parameters of each cost center that is retrieved:
Parameter
Description
offset
Starting index for the paginated results.
limit
Maximum number of results.
totalCount
Number of cost centers retrieved.
id
System generated unique identifier of the cost center.
name
Name of the cost center.
description
Description of the cost center.
createdBy
System generated unique identifier of the user account that created the cost center.
createdOn
Date when the cost center was created.
modifiedBy
System generated unique identifier of the latest user account that modified the cost center.
modifiedOn
Latest date when the cost center was modified.

Modify cost centers

Use a REST API to modify cost centers in Data Marketplace.

Endpoint and method

The following table describes the connection properties for the API:
Property
Description
Endpoint
/api/v1/integration/costCenters
Method
PUT

Request

The following table describes the parameters that you enter in the body of the API payload:
Parameter
Description
Additional Information
id
Required. Enter the system generated unique identifier of the cost center that you want to modify.
For more information about how you can use an API to get the system generated unique identifier of a cost center, see Retrieve cost centers.
name
Required. Enter a name for the cost center.
Ensure that you enter a unique value.
Data Marketplace doesn't consider the letter case when it verifies the uniqueness of the name parameter's value. For example, if you try to name a cost center as "MKT010" while a cost center called "mkt010" already exists, the API call fails.
description
Optional. Enter a description for the cost center.
-

Example request

The following example shows how you can use an API to modify a cost center:
{
"items": [
{
"id": "980dfbc0-c7c0-4e24-ba47-4477bb9bf19c",
"name": "RTL-367APJ",
"description": "The cost center for the APJ retail department."
},
{
"id": "8039d329-46fa-4048-b8e0-9e52a6d73583",
"name": "RTL-367EMEA",
"description": "The cost center for the EMEA retail department."
}
]
}

Response

When you pass the API payload in the REST client, the client displays a response for the parameter values that you have entered.
The following example shows the response of an API call to modify a cost center:
{
"processingTime": 23913,
"objects": [
{
"index": 1,
"id": "980dfbc0-c7c0-4e24-ba47-4477bb9bf19c",
"refId": "320dnbc0-e4r0-4r15-by42-3457bg7hf11x",
"name": "RTL-367APJ"
},
{
"index": 2,
"id": "8039d329-46fa-4048-b8e0-9e52a6d73583",
"refId": "783rebc4-c7v5-6e23-xz17-4937bb3nm13t",
"name": "RTL-367EMEA"
}
]
}
The following table describes the parameters of each cost center that is modified:
Parameter
Description
index
The position of the cost center in the objects JSON array. This value does not impact how the cost center is used by a Data Marketplace user.
id
System generated unique identifier of the cost center.
refId
Reference identifier of the cost center.
name
Name of the cost center.