Request Body Objects

Overview

When query REST calls need to be more specific, Oracle CPQ can interpret several request parameters for applicable REST APIs. Refer to the following topics for CPQ objects and parameters:

Request body data must be written in JSON and adhere to standard JSON syntax rules.

ClosedJSON Syntax for Request Body Objects

Request body data is written in JSON and adhere to standard JSON syntax. The following table shows basic JSON syntax rules.

JSON Item Relation to Oracle CPQ REST Calls

:

Colons separate a name from its value in a name-value pair.

Colons must be placed between an attribute’s variable name and its value, and between an object and any values that are set within the object.

For example,

{
  "documents": {
     "_price_quantity":"74"
  }
}

{ }

Curly braces hold objects.

The entire request body input, as well as all objects, must be held by their own curly braces.

The main document {documents} and the sub-document {subDocName} are both objects.

Note: “documents” always refers to the main document, regardless of what the main document’s name is. To reference the sub-document, use “{subDocName}”, where {subDocName} is the variable name of the sub-document.

For example,

{
  "documents": {
     "_price_quantity": "74"
  }
}

[ ]

Square brackets hold arrays.

Each line item is an array, and therefore must have its value defined within square brackets.

For example,

{
   "lineItem":{
     "items": [
        {
           "_part_number": "part10",
           "_price_quantity": "1",
           "_price_book_var_name": "pb1"
        }
     ]
  }
}

,

Commas separate data.

Attribute name-value pairs must be separated by commas. Additionally, line items must be separated by commas.

For example,

{
  "lineItem": {
     "items": [
       {
           "_part_number": "part10",
           "_price_quantity": "1",
           "_price_book_var_name": "pb1"
        },
        {
           "_part_number": "part1",
           "_price_quantity": "5",
           "_price_book_var_name": "pb1"
        }
     ]
   }
}

Related Topics

Related Topics Link IconSee Also