Insert Bulk Data

post/loaddata/{TypeCode}

Inserts multiple records to the Master Data table.

The /loaddata operation is a very efficient and quick way to insert bulk data to the Master Data table. The main advantage is its greater speed when loading thousands of records (compared to e.g. /integrate).

Use the ISO 8601 date format (YYYY-MM-DD) if a date is included in the table.

See the list of bulk-loadable objects.

If used in a Groovy logic, it is recommended to use the api.addOrUpdate() method instead of this loaddata endpoint within the boundCall().
For more details see the Avoid api.boundCall article.

Please note If no joinFields are provided in the request, then this operation will insert entire records. It means that in this case (without joinFields) with /loaddata it is not possible to update just some fields (for this use the /integrate endpoint instead). The source data must always contain the entire row’s content.

Securitybasic or X-PriceFx-jwt
Request
path Parameters
TypeCode
required
string

Enter the type code of the entity you want to insert a data to. See the list of Type Codes in the Pricefx Knowledge Base article.

Possible values: "ACTT" "AP" "APIK" "BD" "BPT" "BR" "C" "CA" "CAM" "CDESC" "CF" "CFS" "CFT" "CH" "CLLI" "CN" "CS" "CT" "CTAM" "CTLI" … 120 more
Example: P
Request Body schema: application/json

The /loaddata/P endpoint (Insert Bulk Products) is used in our example.

Information: Field names (columns) sent in your request might be different from our sample request schema. Custom fields (attribute1..attribute30) can be retrieved using the /fetch/<entity>AM (AttributeMeta) endpoint, for example, use /fetch/RBTAM to retrieve Rebate Type attribute fields.

required
object
header
required
Array of any

Specify header field names (table columns) of the record in the target table.

object

Specify options of the bulk data insertion.

detectJoinFields
required
boolean

Set to true to use join fields definitions from the server. Set to false to specify join fields with the joinFields parameter in the request.

joinFields
required
Array of strings

A list of fields (that also need to appear in header and data) that make up the business key.

Array of objects non-empty unique

Using the maxJoinFieldsLenghts parameter you can tell loaddata that it is not needed to reserve 255 chars; instead you put there the real lengths of join Fields (based on your knowledge of the data being loaded).

Array (non-empty)
joinField
string non-empty

A join field name.

maxLength
number

The maximum number of characters of the value in the joinFields parameter.

data
required
Array of any

Specify the field values in the same order as specified in the header object.

Responses
200

Returns the number of inserted or updated objects.

Response Schema: application/json
object
node
string non-empty
data
Array of any
status
number
Request samples
application/json
{
  • "data": {
    • "header": [
      • "sku",
      • "label",
      • "unitOfMeasure",
      • "currency"
      ],
    • "options": {
      • "detectJoinFields": false,
      • "joinFields": [
        • "sku"
        ],
      • "maxJoinFieldsLengths": [
        • {
          }
        ]
      },
    • "data": [
      • [
        • 11111,
        • "Label One",
        • "EA",
        • "USD"
        ],
      • [
        • 22222,
        • "Label Two",
        • "EA",
        • "EUR"
        ],
      • [
        • 33333,
        • "Label Three",
        • "EA",
        • "CZK"
        ]
      ]
    }
}
Response samples
application/json
{
  • "response": {
    • "node": "<the server>",
    • "data": [
      • 3
      ],
    • "status": 0
    }
}