# checkProductAvailability(JSON dataProduct)

Al invocar este método, valida la disponibilidad de productos en inventario de onDelivery

<details class="mb-m" id="bkmrk-body-parametersparam"><summary class="text-muted">Esta función recibe como parámetro un objeto JSON con los siguientes atributos:</summary>

<div></div><div><table class="table" style="height: 656px; width: 619px;" width="811"><tbody><tr style="height: 41px;"><th style="width: 320px; height: 41px;">Atributos</th><th style="width: 301px; height: 41px;">Definición </th></tr><tr style="height: 41px;"><td style="width: 320px; height: 41px;">**products**</td><td style="width: 301px; height: 41px;"> JSON con los productos a consultar la disponibilidad</td></tr><tr style="height: 41px;"><td style="width: 320px; height: 41px;">**idProducto\_od**</td><td style="width: 301px; height: 41px;">ID del producto registrado en el sistema de OnDelivery

</td></tr><tr style="height: 41px;"><td style="width: 320px; height: 41px;">**cantidad**</td><td style="width: 301px; height: 41px;">Cantidad de productos a consultar</td></tr></tbody></table>

</div></details><div id="bkmrk-"></div><div id="bkmrk--0"></div><div id="bkmrk-ejemplo-de-json%3A"><span style="color: #bbbbbb; font-size: 1.4em; font-weight: 400;">Ejemplo de JSON:</span></div>```JavaScript
let dataProduct = {
  				   products: 
                   [
                     {
                       'idproducto_od':'1',
                       'cantidad':'1'
                     }
                   ]
                  }
```

<div id="bkmrk-ejemplo-de-solicitud"><span style="color: #bbbbbb; font-size: 1.4em; font-weight: 400;">Ejemplo de solicitud en JS:</span></div>```JavaScript
try {
      const product  = await _gpsApiv2.checkProductAvailability(dataProduct); 
 	} catch (error) {
	  console.error(error);
	}
```

<details class="mb-m" id="bkmrk-definici%C3%B3n-de-los-at"><summary class="text-muted">Definición de los atributos de respuesta:</summary>

<div></div><div><table class="table" style="height: 656px; width: 619px;" width="811"><tbody><tr style="height: 41px;"><th style="width: 320px; height: 41px;">Atributos</th><th style="width: 301px; height: 41px;">Definición </th></tr><tr style="height: 41px;"><td style="width: 320px; height: 41px;">**existencia**</td><td style="width: 301px; height: 41px;">Número de productos restantes en existencia</td></tr><tr style="height: 41px;"><td style="width: 320px; height: 41px;">**faltan**</td><td style="width: 301px; height: 41px;">Número de equipos faltantes

</td></tr><tr style="height: 41px;"><td style="width: 320px; height: 41px;">**pasa**</td><td style="width: 301px; height: 41px;">Bandera booleana indicando si sobrepasa las existencias</td></tr><tr><td style="width: 320px;">**solicitados  
</td><td style="width: 301px;">Número de productos solicitados</td></tr></tbody></table>

</div></details>##### Respuesta de ejemplo:

```JSON
{
	 status:'200',
	 data:'['
		 1:{
			 existencia:1,
			 faltan:0,
			 pasa:false,
			 solicitados:1,
		 },{..}
	 ]
}
```