Upserts an object (the object type must be specified by Type Code in the path).
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 field values 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
endpoint (Upsert a Product) 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 Specify field names and values you want to insert or update. |
Returns full record details.
{- "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",
- "startRow": 0,
- "data": [
- {
- "version": 8,
- "label": "Label One",
- "attribute1": "23"
}, - {
- "version": 11,
- "label": "Label Two",
- "attribute1": "33"
}, - {
- "version": 8,
- "label": "Label Three",
- "attribute1": "56"
}, - {
- "version": 13,
- "label": "Label Four",
- "attribute1": "20"
}, - {
- "version": 0,
- "label": "Label Five",
- "attribute1": "123"
}, - {
- "version": 0,
- "label": "Tofu",
- "attribute1": "2"
}
], - "endRow": 8,
- "totalRows": 8,
- "status": 0
}
}