BMSetInventory API Operation (SOAP)

Use the BMSetInventory API operation to set the inventory level and inventory management features for the specified button. When you set the inventory level for a button, PayPal can track inventory, calculate the gross profit associated with sales, send you an alert when inventory drops below a specified quantity, and manage sold out conditions.

BMSetInventory Request

The request specifies inventory values related to a hosted button as well as inventory values that are specific to each menu item.

BMSetInventory Request Fields

Field

Description

HostedButtonID

xs:string

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

TrackInv

xs:string

(Required) Whether to track inventory levels associated with the button. It is one of the following values:


  • 0 - do not track inventory

  • 1 - track inventory

TrackPnl

xs:string

(Required) Whether to track the gross profit associated with inventory changes. It is one of the following values:


  • 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.

ebl:ItemTrackingDetails

(Optional) Item tracking details for the button

OptionIndex

xs:string

(Optional) 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: 1 single-byte alphanumeric character

SoldoutURL

xs:string

(Optional) The URL to which the buyer's browser is redirected when the inventory drops to 0.

Note: Specifying a URL 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

ebl:OptionTrackingDetails

(Optional) Option tracking details for menu items associated with the button

ReuseDigitalDownloadKeys

xs:string

(Optional) Whether to reuse download keys:


  • 0 - do not reuse keys (default)

  • 1 - reuse keys

Note: If you do not reuse the download keys, you must replenish the keys when you sell out of the product being downloaded.

AppendDigitalDownloadKeys

xs:string

(Optional) Whether to append download keys:


  • 0 - do not append keys (default)

  • 1 - append keys

Note: If you do not append the download keys, unused keys will be replaced.

DigitalDownloadKeys

xs:string

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

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

Item Tracking Details Fields

ItemNumber

xs:string

(Optional) The ID for an item associated with this button

ItemQty

xs:string

The quantity you want to specify for the item associated with this button. Specify either the absolute quantity in this field or the change in quantity in the quantity delta field

ItemQtyDelta

xs:string

The change in quantity you want to specify for the item associated with this button. Specify either the change in quantity in this field or the absolute quantity in the item quantity field

ItemAlert

xs:string

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

ItemCost

xs:string

(Optional) The cost of the item associated with this button

Option Tracking Details Fields

OptionNumber

xs:string

(Optional) The menu item's ID for an option in a dropdown menu

OptionQty

xs:string

The quantity you want to specify for the option associated with this menu item. Specify either the absolute quantity in this field or the change in quantity in the quantity delta field

OptionSelect

xs:string

(Optional) The menu item's name in a dropdown menu

OptionQtyDelta

xs:string

The change in quantity you want to specify for the option associated with this menu item. Specify either the change in quantity in this field or the absolute quantity in the quantity field

OptionAlert

xs:string

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

OptionCost

xs:string

(Optional) The cost of the option associated with this menu item

Limitations: Value must be a positive number, with no currency symbol. It must have two decimal places and the decimal separator must be a period (.). It may have an optional comma (,) for the thousands separator.

BMSetInventory Response

The response contains only the transaction ID.

BMSetInventory Response Fields

Field

Description

TransactionID

xs:string

Transaction ID

BMSetInventory Errors

Error Code

Short Message

Long Message

Correcting This Error...

10001 Internal Error Internal Error
11950 Invalid Data A hosted button ID must be specified.
11951 Invalid Argument The hosted button ID specified is invalid.
11951 Invalid Argument The hosted button ID specified is invalid.
11953 Invalid Data You can only track inventory and profit & loss for buy now, cart or subscription buttons.
11954 Invalid Data A TrackInv value must be specified.
11955 Invalid Data A TrackPnl value must be specified.
11956 Invalid Argument The TrackInv value specified is invalid.
11957 Invalid Argument The TrackPnl value specified is invalid.
11958 Invalid Data You cannot specify both an ItemQty and ItemQtyDelta value.
11959 Invalid Data You cannot specify both an OptionQty and OptionQtyDelta value.
11960 Invalid Data You cannot specify item level or option level inventory when TrackInv is 0.
11961 Invalid Data You must either track inventory by item or by option when TrackInv is 1. It cannot be tracked by both together or none at all.
11964 Invalid Data You must either track inventory and/or track profit & loss.
11965 Invalid Data You cannot track inventory by item and cost by option at the same time or vice versa.
11966 Invalid Argument Item number specified is invalid. It must be a string less than 127 characters.
11967 Invalid Data You cannot set inventory for more option selections than the number of option selections saved in the button.
11968 Invalid Data Option numbers must be unique within an individual button.
11969 Invalid Data An option name index value must be specified when tracking inventory or profit & loss by option.
11970 Invalid Argument Option name index value specified is invalid.
11971 Invalid Data Inventory and/or profit & loss must be managed by item or an option with price when one is defined.
11972 Invalid Data Option name index value specified does not exist.
11973 Invalid Data ItemQty and/or ItemQtyDelta must be an integer.
11974 Invalid Data An item quantity or item quantity delta value cannot be specified when TrackInv is 0.
11975 Invalid Data The number of option quantity or option quantity delta values specified is greater than the number of option selections in the saved button.
11976 Invalid Data You must specify either option quantity or option quantity delta values with a valid integer value.
11977 Invalid Data An option quantity or option quantity delta value must not be specified when TrackInv is 0.
11978 Invalid Argument Item alert must be specified as a positive integer.
11979 Invalid Argument Item alert must not be specified when TrackInv is 0.
11980 Invalid Data The number of option alert values specified is greater than the number of option selections in the saved button.
11981 Invalid Argument Option alert values must be specified as a positive integer.
11982 Invalid Argument Option alert values cannot be specified when TrackInv is 0.
11983 Invalid Argument Item cost value must be specified when tracking profit & loss by item.
11984 Invalid Argument The item cost value specified is invalid.
11985 Invalid Argument An item cost value cannot be specified when TrackPnl is 0.
11986 Invalid Data The number of option cost values specified is greater than the number of option selections in the saved button.
11987 Invalid Argument Option cost values must be specified when tracking profit & loss by option.
11988 Invalid Argument An option cost value specified is invalid.
11989 Invalid Argument An option cost value cannot be specified when TrackPnl is 0.
11990 Invalid Argument The sold out URL specified is invalid.

12210

Invalid Argument

The currency code value specified is invalid.