$.ajax({ type: "GET", url: '/cart.js', dataType: 'json', success: function(resp) { var nullHash = {}; for ([key, value] of Object.entries(resp.attributes)) { nullHash[key] = null; } $.ajax({ type: "POST", url: '/cart/update.js', data: {attributes:nullHash}, dataType: 'json' }); } }); Or if you want to delete them by name, you can do this: var nullHash = { 'someAtt1': null, 'someAtt2': null, 'someAtt3': null }; $.ajax({ type: "POST", url: '/cart/update.js', data: {attributes:nullHash}, dataType: 'json' });