const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
stock_location: {
name: 'Warehouse 3',
default: true,
address1: 'South St. 8',
address2: 'South St. 109',
country_id: '2',
state_id: '4',
city: 'Los Angeles',
state_name: 'California',
zipcode: '90005',
phone: '23333456',
active: true,
backorderable_default: true,
propagate_all_variants: true,
admin_name: '<string>'
}
})
};
fetch('http://{defaultHost}/api/v2/platform/stock_locations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));