Supported Data Types

Overview

This topic lists the supported data types for the resource attributes in REST API services.

ClosedGeneric Data Types

JSON Syntax for CPQ Attributes

This section shows the JSON syntax for CPQ attributes.

ClosedArray Sets

ClosedCommerce Array Sets (Transaction Arrays)

ClosedConfiguration Array Sets


ClosedAuto Lock Objects

Configuration attributes that have the Set Type property set to "Set" require a composite lock mode object. The lock mode object contains two items:

  • "value" is used for the attribute value
  • "locked" defines the lock status of the attribute. Acceptable values are 'true' or 'false'.
"oSLicenses": {
  "value": 3,
  "locked": true
}

If you send an attribute with lock mode enabled as a name-value pair, you will receive the following error.

"Attribute osLicenses has an invalid payload."

Note:  To identify attributes that have the Set Type property set to "Set", navigate to the Attributes Administration List page for the applicable Configuration model: 

Admin > Products > Catalog Definition > Product Families > Product Lines > Models > Attributes


ClosedBoolean Attributes

Boolean attributes are expressed as JSON name-value pairs. Name-value pairs consist of a field name (in double quotes), followed by a colon, and then followed by a value. Acceptable values for Boolean attributes are: 'true' or 'false'

"redundantPowerSupply": true

If an unacceptable value is sent, you will receive the following error:

Unrecognized token 'yes': was expecting ('true', 'false' or 'null')

ClosedCountry and State Attributes

Country and State attributes are composite JSON objects that allow customers to request the list of Countries as well as the list of States for the selected Country.

{
  "criteria": {
    "state": true,
    "actions": [],
    "groups": [],
    "fields": ["_id", "_bill_to_country", "_bill_to_state"]
  },
  "documents": {
    "_bill_to_country": {
      "value": "United States"
    },
    "_bill_to_state": {
      "value": "Utah"
    }
  }
}

The available values are returned in the response "_state" object. The "domainRestricted" property indicates if Country and State domain values are restricted by the "availableElements" list.

  • If a list of elements is not available for a Country or State object, the "availableElements" array will be empty, and "domainRestricted" will be set to "false" to allow entry of values.
  • "domainRestricted" is also set to "false" if the corresponding Country or State objects are set up as text fields in Oracle CPQ Administration.
{
  "documents": {
    "_bill_to_country": {
      "value": "United States",
      "displayValue": "United States"
    },
    "_id": 19642780,
    "_bill_to_state": {
      "value": "Utah",
      "displayValue": "Utah"
    },
    ...
    "_state": {
      ...
      "attributes": {
        "_bill_to_country": {
          ...
          "hasError": false,
          "domain": {
            ...
            "availableElements": [{
                "value": "United States",
                "displayValue": "United States"
              },
              ...]
          }
        },
        "_bill_to_state": {
          ...
          "hasError": false,
          "domain": {
            ...
            "availableElements": [{
                "value": "Alabama",
                "displayValue": "Alabama"
              }, {
                "value": "Alaska",
                "displayValue": "Alaska"
              }, ...]
          }
        }
      }
    }
  }
}

ClosedCurrency Attributes

Currency attributes are expressed as composite JSON objects that contain "value" and "currency" items.

"price": {
  "value": 3.33,
  "currency":
  "USD"
}

If you send a currency attribute as a name-value pair, you will receive the following error.

"Attribute
 price has an invalid payload."

ClosedDate Attributes

Date attributes are expressed as name-value pairs that consist of a field name (in double quotes), followed by a colon, and then followed by a value.

Note: You should ensure that the date complies with the application settings and the user profile.

"dateModified": "01/18/2019"

If the date is not formatted correctly, you will receive the following error:

"Attribute dateModified has an invalid payload."

ClosedFloat Attributes

Float attributes are floating point numbers with decimal values that are expressed as JSON name-value pairs. The name-value pairs consist of a field name (in double quotes), followed by a colon, and then followed by a value.

"duration": 6.5

If Data Validation is set for the attribute and an invalid value is sent, you will receive the following error:

"Invalid value from punchin. Float Attribute must be in the range of 0.0 to 12.0 inclusive. Attempt to set value 25.0 failed."

ClosedInteger Attributes

Integer attributes are whole numbers (i.e. numbers without decimal values) that are expressed as JSON name-value pairs. The name-value pairs consist of a field name (in double quotes), followed by a colon, and then followed by a value.

"quantity": 4

If a decimal value is sent, you will receive the following error:

"Invalid value from punchin. Value 2.5 for attribute Quantity should be a integer
 number.

ClosedLanguage Attributes

The current language value and the domain of all languages for an attribute can be requested using REST services.

{
  "cacheInstanceId": "-1",
  "delta": false,
  "criteria": {
    "state": true,
    "actions": [],
    "groups": [],
    "fields": ["bs_id", "displayHistoryLanguage"]
  }
}
{
  "documents": {
    "bs_id": "19638792",
    "displayHistoryLanguage": {
      "value": "en",
      "displayValue": "English"
    },
    "links": [{
        "rel": "self",
        "href": "https://sitename.oracle.com/rest/v13/commerceDocumentsTransaction/19638792"
      }, {
        "name": "lineItem",
        "rel": "child",
        "href": "https://sitename.oracle.com/rest/v13/commerceDocumentsTransaction/19638792/lineItem",
        "kind": ""
      }
    ],
    "_state": {
      "updatable": true,
      "hasError": false,
      "attributes": {
        "bs_id": {
          "updatable": false,
          "hasError": false,
          "visible": true,
          "hasConstraintViolation": false,
          "domain": {
            "constraintList": []
          }
        },
        "displayHistoryLanguage": {
          "updatable": true,
          "hasError": false,
          "visible": true,
          "hasConstraintViolation": false,
          "domain": {
            "constraintType": "DISALLOWED",
            "constraintList": [],
            "availableElements": [{
                "value": "no_NO",
                "displayValue": "Norwegian (Bokm??l)[Norway]"
              }, {
                "value": "fr_CA",
                "displayValue": "French [Canada]"
              }, {
                "value": "en",
                "displayValue": "English"
              }, {
                "value": "zh_TW",
                "displayValue": "Chinese (Traditional) [Taiwan]"
              }, {
                "value": "ru_RU",
                "displayValue": "Russian [Russia]"
              }
            }
            ]
          }
        }
      }
    },
    "cacheInstanceId": "Aq9z0FTm8gYbJk6gzBcY0p29YUH1bVHGhi4mhPeNR6dPBeohCZ6ixt8OMTkDuOh9"
  }

ClosedMulti-Select Menus

Multi-Select Menu attributes use an array of composite objects that contain "value" and "displayValue" items. Even if only one item is selected, the request must be sent as an array.

"servicesRequested": {
  "items": [{
      "value": "Network Technician",
      "displayValue": "Network Technician"
    }, {
      "value": "Security Analyst",
      "displayValue": " Security Analyst"
    }
  ]
}

If a Multi-Select Menu attribute is not sent as an array item, you will receive the following error:

"Attribute servicesRequested has an invalid payload."

ClosedSingle Select Menus

Single Select Menu attributes use composite objects that contain "value" and "displayValue" items.

"cloudStorage": {
  "value": "500 GB",
  "displayValue": "500 GB"
}

If you send a Single Select Menu attribute as a name-value pair, you will receive the following error.

"Attribute cloudStorage has an invalid payload."

ClosedText Attributes

Text attributes are expressed as JSON name-value pairs. Name-value pairs consist of a field name (in double quotes), followed by a colon, and then followed by a value. Enclose text string in double quotes.

"enclosure": "Vision Blade 6000 Chassis"

If the text string is not enclosed in quotes, you will receive the following error:

Unrecognized token 'Vision': was expecting ('true', 'false' or 'null')

Related Topics

Related Topics Link IconSee Also