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"
}
}
]
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. Example: P |
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. |
OK
{- "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": {
- "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
}
}