» Custom Attribute Module SDK Documentation

Getting Custom Attributes

Function: custom_attributes()

Purpose

This function is used to retrieve all configured custom attributes in the system. Custom attributes define additional metadata fields that can be attached to various resources such as accounts, contacts, items, invoices, orders, and custom objects. This API allows SDK users to fetch a complete list of configured custom attributes including their type, status, options (for dropdown types), usage rules, and pagination details. It is typically used when building forms, validation rules, UI rendering logic, or workflow automation that depends on available custom attribute definitions.

Parameters

ParameterTypeDescription
limitintegerOptional parameter used to control how many records are returned per request.
offsetintegerOptional parameter used for pagination to skip a number of records.

Use Case

This function is used to load all custom attribute definitions to dynamically build form fields, validate user inputs, or verify that the correct configuration exists before creating or updating records. For example, when constructing a dynamic UI for a custom object, the application must know which attributes are required, what input types they use (text, number, dropdown), whether uniqueness rules apply, and what dropdown options exist. The SDK function for this endpoint allows retrieving all such attributes in a single call, enabling systems to adapt without hardcoding configurations.

def custom_attributes():
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = False

    token_file_path = "PATH_TO_SHARED_TOKEN_FILE.json"
    file_token_mgr = FileTokenManager(token_file_path)

    exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
        request_token_dto=CommonData.get_request_token_dto(),
        file_token_mgr=file_token_mgr
    )

    try:
        response = exsited_sdk.custom_attributes.custom_attributes(limit=PLACEHOLDER_LIMIT, offset=PLACEHOLDER_OFFSET)
        print(response)
    except ABException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

The response contains a list of custom attributes with their configurations, including attribute identifiers, names, display names, types, validation rules, dropdown options, encryption flags, and usage details defining which resources the custom attribute applies to. Pagination information is also returned to allow clients to fetch additional pages when large numbers of custom attributes exist.

{
    "custom_attributes": [
        {
            "uuid": "CUSTOM_ATTRIBUTE_UUID_1",
            "status": "STATUS_VALUE",
            "name": "ATTRIBUTE_NAME_1",
            "display_name": "DISPLAY_NAME_1",
            "type": "ATTRIBUTE_TYPE",
            "min_value": "",
            "max_value": "",
            "max_length": "",
            "use_in": [
                {
                    "resource": "RESOURCE_NAME_1",
                    "required": "false",
                    "unique": "false",
                    "associated_account_groups": [],
                    "associated_user_groups": [],
                    "associated_item_groups": [],
                    "enabled": "true"
                }
            ],
            "options": [
                {
                    "name": "OPTION_NAME_1",
                    "display_order": PLACEHOLDER_ORDER
                }
            ],
            "encrypt_data": "false"
        },
        {
            "uuid": "CUSTOM_ATTRIBUTE_UUID_2",
            "status": "STATUS_VALUE",
            "name": "ATTRIBUTE_NAME_2",
            "display_name": "DISPLAY_NAME_2",
            "type": "ATTRIBUTE_TYPE",
            "min_value": "",
            "max_value": "",
            "max_length": "",
            "use_in": [
                {
                    "resource": "RESOURCE_NAME_2",
                    "required": "false",
                    "unique": "false",
                    "associated_account_groups": [],
                    "associated_user_groups": [],
                    "associated_item_groups": [],
                    "enabled": "true"
                }
            ],
            "options": [],
            "encrypt_data": "false"
        }
    ],
    "pagination": {
        "records": PLACEHOLDER_RECORDS_TOTAL,
        "limit": PLACEHOLDER_LIMIT,
        "offset": PLACEHOLDER_OFFSET,
        "previous_page": "PREVIOUS_PAGE_URL_PLACEHOLDER",
        "next_page": "NEXT_PAGE_URL_PLACEHOLDER"
    }
}