const url = 'https://api.sureshake.com/v2/entities/<entityId>/references';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
toEntityId: 'c7699d66-6699-43d4-9906-91b0d00fa0a4',
referenceType: 'credit',
relationshipStatus: 'active',
rating: 'excellent',
paymentTerms: 'string',
creditLimit: 0,
relationshipSince: 'string',
notes: 'string',
contactName: 'string',
contactTitle: 'string',
contactEmail: 'user@example.com',
contactPhone: 'string'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));