When importing and exporting data, you may want to use CSV files. This allows you to list the data in multiple lines with headers.

The first row of the CSV contains the headers. If a field has a sub-field, it is referred with a dot separator (i.e. field.subfield)

Flat data is displayed in a single row. When the data is presented in a nested structure, it is repeated in multiple rows.

To export or import a CSV file, use csv in the format parameter. For example:

{
  "fileName": "profile.json",
  "mode" : "standalone",
  "id" : "bulkProfileHandler",
  "format" : "csv"
}

If you do not specify a set of headers, the export includes the default set of headers for the Oracle Commerce Cloud item.

To export all attributes, including dynamic attributes, set the headersList parameter as ALL. The following example shows how to include all headers in a standalone mode:

{
  "fileName": "inventory.json",
  "mode" : "standalone",
  "id" : "bulkInventoryHandler",
  "format" : "csv",
  "params": {
        "headersList": "ALL"
   }
}

The result of this request might be a CSV file resembling the following:

To export a specific list of attributes, use the following format:

{
  "fileName": "profile.json",
  "mode" : "standalone",
  "id" : "bulkProfileHandler",
  "format" : "csv",
  "params": {
        "headersList": "firstName,lastName,
                        shippingAddress.postalCode,shippingAddress.country"
   }
}

You can also use the default list of attributes and also include additional attributes. To do this, include a ‘+' sign before the list of additional headers. For example:

{
  "fileName": "profile.json",
  "mode" : "standalone",
  "id" : "bulkProfileHandler",
  "format" : "csv",
  "params": {
        "headersList": "+addedfield1,addedfield2,addedfield3.subField1 "
   }
}

Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices