# Product Inventory

## zapiCheckProductInventory

<mark style="color:blue;">`GET`</mark> `https://{yourdomainname}.zaui.net/zapi/`

#### Request Body

| Name                                            | Type    | Description                                                                            |
| ----------------------------------------------- | ------- | -------------------------------------------------------------------------------------- |
| zapiToken<mark style="color:red;">\*</mark>     | integer | Token that must be used for a reseller to communicate with the supplier system.        |
| quantity                                        | integer | Number of items to search against. If not provided,  total inventory will be returned. |
| productId<mark style="color:red;">\*</mark>     | integer | ID of the product.                                                                     |
| methodName<mark style="color:red;">\*</mark>    | String  | The method being called.                                                               |
| zapiUserId<mark style="color:red;">\*</mark>    | integer | Generated by the supplier system when a new contact is created.                        |
| zapiAccountId<mark style="color:red;">\*</mark> | integer | Generated by the supplier system.                                                      |

{% tabs %}
{% tab title="200: OK " %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<response>
    <zapiVersion>2.1</zapiVersion>
    <error>0</error>
    <message>OK</message>
    <methodResponse>
        <methodName>zapiCheckProductInventory</methodName>
        <productId>6</productId>
        <productName>Ski Poles</productName>
        <totalRequested>0</totalRequested>
        <inventoryRemaining>10000</inventoryRemaining>
        <methodErrorCode>0</methodErrorCode>
        <methodErrorMessage/>
        <inventoryCheckCode>0</inventoryCheckCode>
        <inventoryCheckMessage>Inventory OK</inventoryCheckMessage>
    </methodResponse>
</response>
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request" %}

```html
<request>
	<zapiToken></zapiToken>
	<zapiAccountId></zapiAccountId>
	<zapiUserId></zapiUserId>
	<zapiMethod>
		<methodName>zapiCheckProductInventory</methodName>
		<productId></productId>
		<quantity></quantity>
	</zapiMethod>
</request>
```

{% endtab %}

{% tab title="Response" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<response>
	<zapiVersion>2.0</zapiVersion>
	<error>0</error>
	<message>OK</message>
	<methodResponse>
		<methodName>zapiCheckProductInventory</methodName>
		<methodErrorCode>0</methodErrorCode>
		<methodErrorMessage></methodErrorMessage>
		<productId></productId>
		<productName></productName>
		<totalRequested></totalRequested>
		<inventoryRemaining></inventoryRemaining>
		<inventoryCheckCode></inventoryCheckCode>
		<inventoryCheckMessage></inventoryCheckMessage>
	</methodResponse>
</response>
```

{% endtab %}
{% endtabs %}
