updateInventory
This call allows you to update the price and quantity of many items in one request.
Notes:
- Only items owned by the API token's booth will be updated.
- Include up to 99 items for an immediate, synchronous update. Sending more than 99 items will trigger an asynchronous update.
- Items with multiple variations are not supported.
- An invalid or 0 quantity will put the item into "Missing required fields" state.
updateInventory Examples
updateInventory Input
updateInventory is a secure API method with the following URL and HTTP header requirements:
Submit to URL: | https://api.bonanza.com/api_requests/secure_request |
Required in HTTP header: | X-BONANZLE-API-DEV-NAME set to your dev_id |
X-BONANZLE-API-CERT-NAME set to your cert_id |
Note that all secure methods except for fetchToken and getBoothItems require you to submit a user token so that we know what user account you are acting on behalf of. For details about setting up and submitting user tokens, see our intro to user tokens.
The name for your request should be updateInventoryRequest.
Here are the available input parameters that can be serialized into JSON:
Argument | Type | Occurrence | Meaning |
---|---|---|---|
requesterCredentials | Container | Required | Container for user credentials |
requesterCredentials .bonanzleAuthToken | string | Required | The verified user token for the user who you are acting on behalf of. |
Call-specific Input Fields | |||
updates | Container | Required | A nested hash that will include the items to update. |
updates.itemId.price | float | Conditionally | Include price to update the item's price. |
updates.itemId.quantity | integer | Conditionally | Include 0 or positive integer to update the item's quantity. |
updateInventory Output
The name for the output returned from this request is updateInventoryResponse. So, after parsing the serialized response into JSON, you can access the data with something like my_json_hash['updateInventoryResponse']
Here are all the possible output parameters:
Return Value | Type | Occurrence | Meaning |
---|---|---|---|
Standard Output Fields | |||
errorMessage | Container | Conditionally | Description of an error or warning that occurred when Bonanza processed the request. Not returned if the ack value is Success. |
errorMessage.error | Container |
Conditionally, repeatable: [0..*] |
|
errorMessage.error.category | ErrorCategory | Conditionally | Currently unused. |
errorMessage.error.message | string | Conditionally | A description of the error |
errorMessage.error.type | ErrorType | Conditionally | A unique descriptive name for the error. |
timestamp | dateTime | Always | This value represents the date and time when Bonanza processed the request. The time zone of this value is GMT and the format is the ISO 8601 date and time format (YYYY-MM-DDTHH:MM:SS.SSSZ). See the "dateTime" type for information about this time format and converting to and from the GMT time zone. |
warnings | Container | Conditionally | Description of a warning that occurred when Bonanza processed the request. |
warnings.unrecognized_parameters | Container |
Conditionally, repeatable: [0..*] |
An array of unrecognized parameters. |
Call-specific Output Fields | |||
updateInventoryResponse | Container | Always | Contains a mapping of of Item ID to response details. |
updateInventoryResponse.itemId.success | boolean | Always | Whether the item was updated. |
updateInventoryResponse.itemId.message | string | Conditionally | Contains an error message if the update was unsuccessful. |
If an asynchronous update was triggered | |||
resultMessage | string | Always | Result message will be "Updates queued" |
success | boolean | Always | success will be true |