For anyone stumbling on this issue, it took me a while to find out, in the variations post also add the attribute 'name', as follows:

attributes: [
{
id: variation.attributeId,
name: "TheNameOfTheAttribute",
option: variation.option
}
]