Node JS Library for Interacting with Springboard Retail API. Uses the restler module as its foundation for querying the service.
This is a work on progress. I'll be adding more methods over time.
This is my first foray into Node. Forgive the lack of tests, I'm one of "those" people.
Installing and Configuring
npm install node-springboard
Require the module, passing in a valid domain, user, and password. Then experience Springboard API nirvana.
var springboard = 'mydomain' 'myuser' 'mypassword';
var springboard = 'mydomain' 'myuser' 'mypassword';springboard;
This module follows the Node callback convention of passing either null or an Error object as the first argument of the callback. See the basic example above.
All functions in this module expect a callback that accepts three parameters: err, data, and response.
An Error object if there was a problem; null if not. Always check for this first in your callbacks.
Varies based on the method call.
Methods beginning with "create" will return a hash with a "path" and "objectId" value. For example:
All other methods will return the JSON object returned by the Springboard API, easily accessible through dot notation or your preferred method of data access.
The raw response as returned by restler. Refer to restler documentation for info on how to interact with this object.
As a general rule, API method signatures begin with data required by Springboard, then accept a hash parameter for other data, and finally method callback. I'm not fully sold on this design yet but it works. For now, only parameters that are not self explanatory are documented.
The data parameter in the method calls is the catch all of capturing information not necessariliy required by the API. The following example creates an item that includes some custom fields:
createInventoryAdjustment(locationId, itemId, adjustmentReasonId, qtyAdjust, cost, data, callback)
Note: Undocumented API method.
Creates an inventory adjustment entry.
qtyAdjust: The quantity adjustment to make to current on hand counts. NOT the on hand count.
createItem(cost, data, callback)
Creates an item. Cost is the only field required by Springboard. However, if you have custom fields that are required, you will have to provide those via the data parameter.
createItemVendor(itemId, vendorId, data, callback)
Note: Undocumented API method.
Creates a vendor record for an item (sometimes called a source record).
Creates a sales ticket.
createTicketLine(ticketId, data, callback)
Note: The Springboard API does not currently provide the newly created ID for a ticket line. Not sure why Creates a line for a given ticket ID.
createVendor(name, data, callback)
Creates a vendor.
createVendorAddress(vendorId, city, state, country, postalCode, data, callback)
Note: Undocumented API method Creates an address for a vendor.
createVendorContact(vendorId, data, callback)
Note: Undocumented API method Creates a contact for a vendor.
Gets gift card with the given number. Springboard throws an error if the gift card is not found.
Gets inventory values. Recommend using convenience methods for retrieving inventory values for a given item ID by location.
getInventoryValuesByLocation(itemId, data, callback)
Gets inventory values for an item, grouped by location.
Retrieves an item based on its ID.
Retrieves an item based on its lookup code.
Retrieve items based on advanced JSON filter.
Retrieves vendor records for a given item ID.
Retrieves a ticket based on its ID.
Retrieves ticket lines based on a ticket ID.
Retrieves a vendor based on its ID.
Retrieve vendors based on advanced JSON filter.
searchItems(searchTerm, page, perPage, callback)
A basic way to query items using Springboard's standard search. Springboard has a sophisticated query system that is not yet implemented in this module.
searchVendors(searchTerm, page, perPage, callback)
A basic way to query vendors using Springboard's standard search. Springboard has a sophisticated query system that is not yet implemented in this module.
updateItem(id, data, callback)
Update an item.
updateVendor(id, data, callback)
Update a vendor.