fix: use correct vendedor.obter.php API endpoint
All checks were successful
Build and Deploy / build-and-push (push) Successful in 43s
All checks were successful
Build and Deploy / build-and-push (push) Successful in 43s
This commit is contained in:
@@ -65,14 +65,16 @@ export const handleTinyOrderUpdate = async (req: Request, res: Response): Promis
|
||||
vendorParams.append('id', idVendedor);
|
||||
vendorParams.append('formato', 'JSON');
|
||||
|
||||
const vendorResponse = await axios.post('https://api.tiny.com.br/api2/contato.obter.php', vendorParams, {
|
||||
const vendorResponse = await axios.post('https://api.tiny.com.br/api2/vendedor.obter.php', vendorParams, {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
});
|
||||
|
||||
if (vendorResponse.data?.retorno?.status === 'OK') {
|
||||
const contato = vendorResponse.data.retorno.contato;
|
||||
whatsappVendedor = contato?.celular || contato?.fone || "";
|
||||
const vendedor = vendorResponse.data.retorno.vendedor;
|
||||
whatsappVendedor = vendedor?.celular || vendedor?.fone || vendedor?.telefone || "";
|
||||
console.log(`Successfully fetched seller WhatsApp: ${whatsappVendedor || 'None'}`);
|
||||
} else {
|
||||
console.error('Failed to fetch seller details:', JSON.stringify(vendorResponse.data?.retorno?.erros || 'Unknown API error'));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user