BMGetInventory API Operation (NVP)

APIDeprecatedLast updated: December 4th 2023, @ 6:19:30 am


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

Important:

The Button Manager API is deprecated. For new integrations, see the associated topic.

Button See

Buy Now

PayPal Checkout Overview

Add to Cart

Solution Providers

Donate

Create a Donate button

Automatic Billing

Subscribe

Subscriptions Overview

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

BMGetInventory request

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

BMGetInventory request parameters

Field

Description

METHOD

(Required) BMGetInventory

HOSTEDBUTTONID

(Required) The ID of the hosted button whose inventory information you want to obtain.

L_DIGITALDOWNLOADKEYSn

(Optional) One or more digital download keys, up to a maximum of 1,000 keys.

The variable n in the field name is a number between 0 and 999, inclusive, that specifies the key.

Character length and limitations: 1,000 single-byte alphanumeric characters each.

BMGetInventory response

The response fields contain inventory information related to the button.

BMGetInventory response fields

Field

Description

HOSTEDBUTTONID

The ID of the hosted button whose inventory you want to set.

TRACKINV

Whether to track inventory levels associated with the button. Value is:

  • 0. Do not track inventory

  • 1. Track inventory.

TRACKPNL

Whether to track the gross profit associated with inventory changes. Value is:

  • 0. Do not track the gross profit

  • 1. Track the gross profit.

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.

OPTIONNAMEINDEX

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.

Character length and limitations: One single-byte alphanumeric character.

SOLDOUTURL

The URL to which the buyer's browser is redirected when the inventory drops to 0

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

Item tracking details fields

ITEMNUMBER

The ID for an item associated with this button

ITEMQTY

The current inventory level of the item associated with this button

ITEMQTYDELTA

Not used

ITEMALERT

The quantity of the item associated with this button below which PayPal sends you an email notification

ITEMCOST

The cost of the item associated with this button

Option tracking details fields

L_OPTIONNUMBERn

The menu item's ID for an option in a drop-down menu

Lists variables for each menu item, where n is a digit between 0 and 9, inclusive.

L_OPTIONQTYn

The current inventory level of the option associated with this menu item

Lists variables for each menu item, where n is a digit between 0 and 9, inclusive.

L_OPTIONSELECTn

The menu item's name in a drop-down menu

Lists variables for each menu item, where n is a digit between 0 and 9, inclusive.

L_OPTIONQTYDELTAn

Not used

Lists variables for each menu item, where n is a digit between 0 and 9, inclusive.

L_OPTIONALERTn

The quantity of the option associated with this menu item below which PayPal sends you an email notification

Lists variables for each menu item, where n is a digit between 0 and 9, inclusive.

L_OPTIONCOSTn

The cost of the option associated with this menu item

Lists variables for each menu item, where n is a digit between 0 and 9, inclusive.

BMGetInventory errors

Error codeShort and long messagesUser action
10001Internal Error
Internal Error
To learn more about possible causes and corrective actions, see What is API error code 10001?.
11950Invalid Data
A hosted button ID must be specified.
11951Invalid Argument
The hosted button ID specified is invalid.
11953Invalid Data
You can only track inventory and profit & loss for buy now, cart or subscription buttons.
11991Invalid Data
The hosted button id specified does not have any inventory or cost associated with it.
11992Invalid Argument
You do not have permissions to access this button. Please check the hosted button ID and try again.