Upsert an Object (and return old data)

post/integrate/{TypeCode}/returnolddata

Upserts an object (the object type must be specified by Type Code in the path) and returns record details of the previous version. It allows you to check changes in the record.

To add a new object that does not exist, specify the sku parameter in the request.

To update an existing object, specify the sku or typedId parameter of the existing object. The /integrate method performs a partial update – it does not delete values from fields that have not been specified in the update request.


Please note: This method is intended to be used with one or two objects and it allows you to update particular fields. The request will overwrite the existing data of the record being updated, regardless of other changes. To insert more objects in bulk please use the /loaddata/{TypeCode} endpoint.


This operation is particularly useful if the caller does not (and should not) know about typed IDs and other internal data fields, i.e. typically in an integration scenario.

The only mandatory pre-requisite for this operation is that the object's defined business key fields (vary per object type) are present in every request. No typed ID or version fields are required. This also means that no version checking is performed, thus the request will overwrite existing data of that record, regardless of other changes.

Information: You can upsert multiple records using one request. To do so, add multiple data objects into your JSON. See the example below.

[
  {
    "data": {
      "sku": "111111",
      "typedId": "2147501227.P",
      "label": "The New Label",
      "unitOfMeasure": "EA",
      "currency": "USD",
      "formulaName": "priceLogic2",
      "attribute1": "1",
      "attribute2": "2",
      "userGroupEdit": "Administrators",
      "userGroupViewDetails": "PricingManagers"
    }
  },
  {
    "data": {
      "sku": "222222",
      "label": "The New Label 2",
      "unitOfMeasure": "EA",
      "currency": "EUR",
      "formulaName": "priceLogic2",
      "attribute1": "1",
      "attribute2": "2",
      "userGroupEdit": "Administrators",
      "userGroupViewDetails": "PricingManagers"
    }
  }
]

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" … 131 more
Example: P
Request Body schema: application/json

The /integrate/P/returnolddata endpoint (upserts a product) is used in our example.

Please note: 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/PAM endpoint.

required
object

Specify field names and values you want to insert or update.

sku
required
string non-empty
label
string non-empty
unitOfMeasure
string non-empty
currency
string non-empty
formulaName
string non-empty
attribute1
string non-empty
attribute2
string non-empty
userGroupEdit
string non-empty
userGroupViewDetails
string non-empty
Responses
200

OK

Response Schema: application/json
required
object
node
required
string non-empty
required
object
version
required
number
typedId
required
string non-empty
sku
required
string non-empty
label
required
string non-empty
unitOfMeasure
required
string non-empty
userGroupEdit
required
string non-empty
userGroupViewDetails
required
string non-empty
currency
required
string non-empty
formulaName
required
string non-empty
createDate
required
string non-empty
createdBy
required
number
lastUpdateDate
required
string non-empty
lastUpdateBy
required
number
attribute1
required
string non-empty
attribute2
required
string non-empty
csrfToken
required
string non-empty
required
Array of objects non-empty unique
Array (non-empty)
version
required
number
typedId
required
string non-empty
sku
required
string non-empty
label
required
string non-empty
unitOfMeasure
required
string non-empty
userGroupEdit
required
string non-empty
userGroupViewDetails
required
string non-empty
currency
required
string non-empty
formulaName
required
string non-empty
image
any
createDate
required
string non-empty
createdBy
required
number
lastUpdateDate
required
string non-empty
lastUpdateBy
required
number
attribute1
required
string non-empty
attribute2
required
string non-empty
attribute3
any
attribute4
any
attribute5
any
attribute6
any
attribute7
any
attribute8
any
attribute9
any
attribute10
any
attribute11
any
attribute12
any
attribute13
any
attribute14
any
attribute15
any
attribute16
any
attribute17
any
attribute18
any
attribute19
any
attribute20
any
attribute21
any
attribute22
any
attribute23
any
attribute24
any
attribute25
any
attribute26
any
attribute27
any
attribute28
any
attribute29
any
attribute30
any
status
required
number
Request samples
application/json
{
  • "data": {
    • "sku": "111111",
    • "typedId": "2147501227.P",
    • "label": "The New Label",
    • "unitOfMeasure": "EA",
    • "currency": "USD",
    • "formulaName": "priceLogic2",
    • "attribute1": "1",
    • "attribute2": "2",
    • "userGroupEdit": "Administrators",
    • "userGroupViewDetails": "PricingManagers"
    }
}
Response samples
application/json
{
  • "response": {
    • "node": "<node>",
    • "oldData": {
      • "version": 6,
      • "typedId": "2147501226.P",
      • "sku": "xxxxxx5",
      • "label": "The New Label4",
      • "unitOfMeasure": "EA",
      • "userGroupEdit": "Administrators",
      • "userGroupViewDetails": "Administrators",
      • "currency": "EUR",
      • "formulaName": "priceLogic2",
      • "createDate": "2021-09-16T12:31:18",
      • "createdBy": 2147490696,
      • "lastUpdateDate": "2021-09-17T08:40:33",
      • "lastUpdateBy": 2147490696,
      • "attribute1": "1",
      • "attribute2": "2"
      },
    • "csrfToken": "<token>",
    • "data": [
      • {
        • "version": 7,
        • "typedId": "2147501226.P",
        • "sku": "xxxxxx5",
        • "label": "The New Label4",
        • "unitOfMeasure": "EA",
        • "userGroupEdit": "Administrators",
        • "userGroupViewDetails": "Administrators",
        • "currency": "EUR",
        • "formulaName": "priceLogic2",
        • "image": null,
        • "createDate": "2021-09-16T12:31:18",
        • "createdBy": 2147490696,
        • "lastUpdateDate": "2021-09-17T08:41:11",
        • "lastUpdateBy": 2147490696,
        • "attribute1": "1",
        • "attribute2": "2",
        • "attribute3": null,
        • "attribute4": null,
        • "attribute5": null,
        • "attribute6": null,
        • "attribute7": null,
        • "attribute8": null,
        • "attribute9": null,
        • "attribute10": null,
        • "attribute11": null,
        • "attribute12": null,
        • "attribute13": null,
        • "attribute14": null,
        • "attribute15": null,
        • "attribute16": null,
        • "attribute17": null,
        • "attribute18": null,
        • "attribute19": null,
        • "attribute20": null,
        • "attribute21": null,
        • "attribute22": null,
        • "attribute23": null,
        • "attribute24": null,
        • "attribute25": null,
        • "attribute26": null,
        • "attribute27": null,
        • "attribute28": null,
        • "attribute29": null,
        • "attribute30": null
        }
      ],
    • "status": 0
    }
}