I thought I would document how this works (as the documentation is vague), and ask for an enhancement.
To delete a custom field from an opportunity or party, you need to update the entity by including this within it:
"fields": [ {
"_delete": true,
"definition": { "id": 1 }
}
]
The definition number is the id of the field you want to delete.
Enhancement request:
A common requirement is, where you have been given a blank value for a custom field by your customer, you actually want to delete the custom field from that entity to ensure that it's no longer stored.
But if you ask for the custom field to be deleted and in fact that custom field was not currently set for that entity, you get an error. This is rather overly fussy. It forces you to load all the fields, check in a rather laborious way whether the field was there, and delete fields only where they are present. In my view, deleting a custom field for an entity should not be an error unless the field id is not a valid one for that entity type.