Upsert
Here we have an example where we upsert an account. The system will use the AccountID or AccountKey to identify the account object, if one doesn't exist it will be created.
On update, only the submitted fields will update so if you need to null out a property, you need to include it with a null value in the request body.
await fetch('https://core.sitemesh.com/v1/account/save',
{
body: JSON.stringify({
AccountID: 'A123',
AccountName: 'Northwind Traders'
}),
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': '#API-KEY#',
}
}
);