Create Asset

post

/rest/v16/assets

This operation creates a new asset.

Request

Supported Media Types
Body ()
Root Schema : Assets
Type: object
Title: Assets
Show Source
Nested Schema : Attributes
Type: object
Title: Attributes
A JSON collection of key/value pair attributes that define the configuration of this asset/component.
Nested Schema : Currency
Type: object
Title: Currency
The currency code for the asset.
Show Source
Nested Schema : Discount Amount
Type: object
Title: Discount Amount
The amount of discount received.
Show Source
Nested Schema : Fixed Recurring Amount
Type: object
Title: Fixed Recurring Amount
The recurring charge for the product. For example, $10 per month.
Show Source
Nested Schema : One Time Net Amount
Type: object
Title: One Time Net Amount
The price paid to purchase the product.
Show Source
Nested Schema : Parent Asset Id
Type: object
Title: Parent Asset Id
The parent component of the asset tree.
Show Source
  • Title: Asset Key
    An invariant key that uniquely identifies the asset / component for the lifetime of the asset. It will be unique across all asset repositories.
  • Title: Id
    Primary Key of Asset Resource.
Nested Schema : Root Asset Id
Type: object
Title: Root Asset Id
The root component in the asset tree.
Show Source
  • Title: Asset Key
    An invariant key that uniquely identifies the asset / component for the lifetime of the asset. It will be unique across all asset repositories.
  • Title: Id
    Primary Key of Asset Resource.
Nested Schema : Status
Type: object
Title: Status
The status of the asset.
Show Source
  • Title: Display Value
    Translated display name of the type for which fixed list of values can be defined.
  • Title: Id
    Primary Key of the fixed list of value resource.
  • Title: Lookup Code
    Language independent code of the fixed list of value.
Nested Schema : Usage Net Amount
Type: object
Title: Usage Net Amount
The variable, usage price for the product. For example, $0.10 per Copy.
Show Source
Back to Top

Response

Supported Media Types

Default Response

Body ()
Root Schema : Assets
Type: object
Title: Assets
Show Source
Nested Schema : Attributes
Type: object
Title: Attributes
A JSON collection of key/value pair attributes that define the configuration of this asset/component.
Nested Schema : Currency
Type: object
Title: Currency
Currency Code for the asset
Show Source
Nested Schema : descendantAssets-collection
Type: object
Title: descendantAssets-collection
Show Source
Nested Schema : Discount Amount
Type: object
Title: Discount Amount
The amount of discount received.
Show Source
Nested Schema : Fixed Recurring Amount
Type: object
Title: Fixed Recurring Amount
The recurring charge for the product. For example, $10 per month.
Show Source
Nested Schema : One Time Net Amount
Type: object
Title: One Time Net Amount
The price paid to purchase the product.
Show Source
Nested Schema : Parent Asset Id
Type: object
Title: Parent Asset Id
The parent component of the asset tree.
Show Source
  • Title: Asset Key
    An invariant key that uniquely identifies the asset / component for the lifetime of the asset. It will be unique across all asset repositories.
  • Title: Id
    Primary Key of Asset Resource.
Nested Schema : Root Asset Id
Type: object
Title: Root Asset Id
The root component in the asset tree.
Show Source
  • Title: Asset Key
    An invariant key that uniquely identifies the asset / component for the lifetime of the asset. It will be unique across all asset repositories.
  • Title: Id
    Primary Key of Asset Resource.
Nested Schema : Status
Type: object
Title: Status
The status of the asset.
Show Source
  • Title: Display Value
    The translated display name of the type for which fixed list of values can be defined.
  • Title: Id
    The primary key of the fixed list of value resource.
  • Title: Lookup Code
    Language independent code of the fixed list of value.
Nested Schema : Usage Net Amount
Type: object
Title: Usage Net Amount
The variable, usage price for the product. For example, $0.10 per Copy.
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : descendantAssetsDef
Type: object
Title: descendantAssetsDef
Show Source
Nested Schema : Attributes
Type: object
Title: Attributes
A JSON collection of key/value pair attributes that define the configuration of this asset/component.
Nested Schema : Currency
Type: object
Title: Currency
Currency Code for the asset
Show Source
Nested Schema : Discount Amount
Type: object
Title: Discount Amount
The amount of discount received.
Show Source
Nested Schema : Fixed Recurring Amount
Type: object
Title: Fixed Recurring Amount
The recurring charge for the product. For example, $10 per month.
Show Source
Nested Schema : One Time Net Amount
Type: object
Title: One Time Net Amount
The price paid to purchase the product.
Show Source
Nested Schema : Parent Asset Id
Type: object
Title: Parent Asset Id
The parent component of the asset tree.
Show Source
  • Title: Asset Key
    An invariant key that uniquely identifies the asset / component for the lifetime of the asset. It will be unique across all asset repositories.
  • Title: Id
    Primary Key of Asset Resource.
Nested Schema : Root Asset Id
Type: object
Title: Root Asset Id
The root component in the asset tree.
Show Source
  • Title: Asset Key
    An invariant key that uniquely identifies the asset / component for the lifetime of the asset. It will be unique across all asset repositories.
  • Title: Id
    Primary Key of Asset Resource.
Nested Schema : Status
Type: object
Title: Status
The status of the asset
Show Source
  • Title: Display Value
    Translated display name of the type for which fixed list of values can be defined.
  • Title: Id
    The primary key of the fixed list of value resource.
  • Title: Lookup Code
    Language independent code of the fixed list of value.
Nested Schema : Usage Net Amount
Type: object
Title: Usage Net Amount
The variable, usage price for the product. For example, $0.10 per Copy.
Show Source
Back to Top

Examples

The following examples show how to create an asset by submitting a POST request to the REST resource using cURL. For more information about cURL, see Use cURL.

curl - X POST - i - H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQg" - H "Content-type: application/json"
https://sitename.oracle.com/rest/v16/assets

Request Body Sample

The following example is used to create and asset.

Note:

The "status": {"lookupCode": "ACTIVE"} parameter will activate the newly created asset.
{
  "partNumber": "part1",
  "quantity": "1.0",
  "displayKey": "display-100-2-1234",
  "customer": "SpecialAccount100",
  "assetKey": "abo_6da32e86-02be-487b-8e41-c4494a46e34c", 
  "rootAsset": {
    "assetKey": "abo_6da32e86-02be-487b-8e41-c4494a46e34c",
  }
  "discountPercent": "5.0",
  "discountAmount": {
    "currency": "USD",
    "value": 15.0
  },
  "currency": {
    "currencyCode": "USD"
  },
  "fixedRecurringAmount": {
    "currency": "USD",
    "value": 50.00
  },
  "oneTimeNetAmount": {
    "currency": "USD",
    "value": 300.00
  },
  "status": {
    "lookupCode": "ACTIVE"
  }
}

Asset Schema and Data Integrity

You should adhere to the following guidelines to ensure proper asset population. These guidelines are applicable to the following REST API endpoints: Create Asset, Update Asset, Synchronize Asset, Synchronize Assets, and Import Assets CSV File. This does not include the BOM projection approach in the sample update asset script.

  • The REST API schema definitions specify the basic attribute type (e.g. string, integer, number). The following guidelines describe additional requirements:
    • The acceptable length for string type attributes is 255, with the exception of the following attributes:
    • The acceptable length for the following attributes is 100: assetKey, displayKey, serialNumber
    • The acceptable length for the following attributes is 30: status, usageUnitOfMeasure, fixedRecurringPeriod.
    • The acceptable length for the "currency" attribute is 20.
    • The acceptable length for the "assetDescription" attribute is 1000.
  • The default format for the following of timestamp type attributes is ISO to eliminate any time zone ambiguity issues: startDate, endDate, suspendDate, resumeDate, purchaseDate.
  • Unless noted otherwise, number type attributes allow 22 digits with a precision or 7.
  • The following attributes are mandatory fields that should be populated with valid data: "Customer", "DisplayKey", "Part", and "Quantity".
  • Populate the "rootAsset" and "parentAsset" fields based on hierarchy.
    • Both fields should reference a valid asset.
    • The parent asset should be null for the root asset record.

      For example, assume A2 has A1 as a parent and A1 has A3 as a parent, therefore A2 would have A3 as a grandparent. It would be invalid for A3 to have A2 as a parent, because it would create a cycle in the hierarchy where A3 has A1 as a grandparent and A3 has A3 as a great grandparent.

    • Use the "assetKey" component fields to update the "rootAsset" and "parentAsset" fields.
    • The parent asset cannot be its own ancestor.
    • All amount attributes should have the same currency code.
  • The "attributes" field should contain a JSON object which typically stores a BOM attribute.
  • The parent asset cannot be its own ancestor.
  • If an order line is marked as deleted, use the asset repository to delete or end-date the asset.
  • With the exception of the action code available in the transaction_line_bom_attribute, the Attributes field should contain the same information as the transaction_line_bom_attribute.
  • The abo_updateAsset function available in the 18D and later ABO package supports the ability to copy information from a Commerce order line and paste it into an asset.
  • If ABO implementation package from 18D or later release is being used and abo_updateAsset is not being used to create/update assets, then Update Configuration REST API action should be invoked explicitly after asset creation or update.
Back to Top