node-sellsy
node-sellsy copied to clipboard
Search by custom Field
Hello,
I can not implement the Client.getList method with a custom field filter. Between the objects, the arrays, I am lost on the implementation.
Here is the code:
var params = {
search : {
customfields : {
0 : {cfid : "70596", unspecified : "N", value : "Y"}
},
},
};
sellsy.api({
method: 'Client.getList',
params: params
}).then(data => {
console.log(JSON.stringify(data.response.infos));
}).catch(e => {
console.log('error:', e);
});
I want to get customers with the custom field 70596 to "yes". This is a Yes / No field.
In my base today, I have only one customer having this field to "yes". Currently, the code returns to me 101 customers.
Regards,