Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// create the association object with the final data
associations = {
"elements": elements
}
// create all of the associations
request({
url: 'https://api.clover.com:443/v3/merchants/'+process.env.CLOVER_MERCHANT_ID+'/category_items',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + _accessToken
},
body: JSON.stringify(associations)
}, function(error, response, body){
console.log('DEBUG[CLOVER]: Creating all associations for items in ' + categoryId + ' for ' + elements.length + ' items.');
if(error) {
console.log('ERROR[CLOVER]: Could not create all associations for category items in: '+categoryId);
console.log(error);
reject(error);
} else {
console.log('DEBUG[CLOVER]: Made clover callout to create all category association successfully for: '+categoryId);
resolve(true);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.