# BMGetInventory API Operation (SOAP) (/api/nvp-soap/get-inventory-soap)



> **Note:** **Important:** NVP/SOAP is a legacy integration method. We accept new integrations and support existing integrations, but there are newer solutions. If you're starting an integration, [we recommend our latest solutions](/).

Shows the inventory levels and other inventory-related information for a button and menu items associated with the button.

> **Note:** **Important:**
>
> The Button Manager API is deprecated. For new integrations, see the associated topic.
>
> | Button                                          | See                                                                                  |
> | ----------------------------------------------- | ------------------------------------------------------------------------------------ |
> | **Buy Now**<br />                               | [PayPal Checkout Overview](/checkout)<br />                                          |
> | **Add to Cart**<br />                           | [Solution Providers](https://www.paypal.com/us/webapps/mpp/solution-providers)<br /> |
> | **Donate**<br />                                | [Create a Donate button](/api/nvp-soap/paypal-payments-pro)<br />                    |
> | **Automatic Billing**<br /> **Subscribe**<br /> | [Subscriptions Overview](/subscriptions/about)<br />                                 |

Typically, you call `BMGetInventory` to obtain field values before calling `BMSetInventory` to change the inventory levels.

## BMGetInventory request [#bmgetinventory-request]

The hosted button ID identifies the button for which to track inventory.

<img src="https://www.paypalobjects.com/webstatic/en_US/developer/docs/api/BMGetInventoryRequest.gif" />

### BMGetInventory request parameters [#bmgetinventory-request-parameters]

| Field<br />                 | Description<br />                                                                                                                                                                                        |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `HostedButtonID`<br />      | `xs:string`<br /&#x3E; &#x2A;(Required)* The ID of the hosted button whose inventory information you want to obtain.<br />                                                                               |
| `DigitalDownloadKeys`<br /> | `xs:string`<br /&#x3E; &#x2A;(Optional)* One or more digital download keys, up to a maximum of 1,000 keys.<br /> Character length and limitations: 1,000 single-byte alphanumeric characters each.<br /> |

## BMGetInventory response [#bmgetinventory-response]

The response fields contain inventory information related to the button.

<img src="https://www.paypalobjects.com/webstatic/en_US/developer/docs/api/BMGetInventoryResponse.gif" />

### BMGetInventory response fields [#bmgetinventory-response-fields]

| Field<br />            | Description                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `HostedButtonID`<br /> | `xs:string`<br /> The ID of the hosted button whose inventory you want to set.<br />                                                                                                                                                                                                                                                                                         |
| `TrackInv`<br />       | `xs:string`<br /> Whether to track inventory levels associated with the button. Value is:<br /> `0`. Do not track inventory<br />`1`. Track inventory.<br />                                                                                                                                                                                                                 |
| `TrackPnl`<br />       | `xs:string`<br /> Whether to track the gross profit associated with inventory changes. Value is:<br /> `0`. Do not track the gross profit<br />`1`. Track the gross profit.<br /> > **Note:** &#x2A;*Note:** The gross profit is calculated as the price of the item less its cost, multiplied by the change in the inventory level since the last call to `BMSetInventory`. |
|                        | `ebl:ItemTrackingDetails`<br /> Item tracking details for the button.<br />                                                                                                                                                                                                                                                                                                  |
| `OptionIndex`<br />    | `xs:string`<br /> Option index, which identifies the button. Option index 0 is the menu that contains the price if one exists; otherwise, it is the first menu without a price.<br /> Character length and limitations: One single-byte alphanumeric character.<br />                                                                                                        |
|                        | `ebl:OptionTrackingDetails`<br /> Option tracking details for menu items associated with the button.<br />                                                                                                                                                                                                                                                                   |
| `SoldoutURL`<br />     | `xs:string`<br /> The URL to which the buyer's browser is redirected when the inventory drops to 0<br /> > **Note:** &#x2A;*Note:** A value in this field also prevents a sale when the inventory drops to 0; otherwise, sales can continue even when inventory is unavailable. Character length and limitations: 127 single-byte alphanumeric characters<br />              |

### Item tracking details fields [#item-tracking-details-fields]

| Field                | Description                                                                                                                     |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `ItemNumber`<br />   | `xs:string`<br /> The ID for an item associated with this button<br />                                                          |
| `ItemQty`<br />      | `xs:string`<br /> The current inventory level of the item associated with this button<br />                                     |
| `ItemQtyDelta`<br /> | `xs:string`<br /> Not used<br />                                                                                                |
| `ItemAlert`<br />    | `xs:string`<br /> The quantity of the item associated with this button below which PayPal sends you an email notification<br /> |
| `ItemCost`<br />     | `xs:string`<br /> The cost of the item associated with this button<br />                                                        |

### Option tracking details fields [#option-tracking-details-fields]

| Field                  | Description                                                                                                                          |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `OptionNumber`<br />   | `xs:string`<br /> The menu item's ID for an option in a drop-down menu<br />                                                         |
| `OptionQty`<br />      | `xs:string`<br /> The current inventory level of the option associated with this menu item<br />                                     |
| `OptionSelect`<br />   | `xs:string`<br /> The menu item's name in a drop-down menu<br />                                                                     |
| `OptionQtyDelta`<br /> | `xs:string`<br /> Not used<br />                                                                                                     |
| `OptionAlert`<br />    | `xs:string`<br /> The quantity of the option associated with this menu item below which PayPal sends you an email notification<br /> |
| `OptionCost`<br />     | `xs:string`<br /> The cost of the option associated with this menu item<br />                                                        |

## BMGetInventory errors [#bmgetinventory-errors]

| Error code | Short and long messages                                                                                                   | User action                                                                                                                                                                                    |
| ---------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 10001      | Internal Error<br />Internal Error                                                                                        | To learn more about possible causes and corrective actions, see [What is API error code 10001?](https://www.paypal.com/us/selfhelp/article/what-is-api-error-code-10001-ts1041/3?channel=MTS). |
| 11950      | Invalid Data<br />A hosted button ID must be specified.                                                                   |                                                                                                                                                                                                |
| 11951      | Invalid Argument<br />The hosted button ID specified is invalid.                                                          |                                                                                                                                                                                                |
| 11953      | Invalid Data<br />You can only track inventory and profit & loss for buy now, cart or subscription buttons.               |                                                                                                                                                                                                |
| 11991      | Invalid Data<br />The hosted button id specified does not have any inventory or cost associated with it.                  |                                                                                                                                                                                                |
| 11992      | Invalid Argument<br />You do not have permissions to access this button. Please check the hosted button ID and try again. |                                                                                                                                                                                                |
