const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
auth: {
type: 'oauth2_client_credentials',
token_url: '<string>',
client_id: '<string>',
client_secret: '<string>',
scope: '<string>'
},
name: 'Remote Order API',
payload_format: 'lula_order_v1',
order_id_path: '$.orderNumber',
store_ids: ['<string>'],
channels: [],
stations: [],
enabled: true
})
};
fetch('https://api.lulacommerce.com/v1/order-destinations/{destination_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));