node-snipcart-api
implementation of the snipcart api
Install
npm i --save snipcart-api
Configuration
The api requires a Secret API Key.
This can be set by using an environment variable SECRET_API_KEY
OR
const snipcart = ;snipcart;
Making API Calls
Once the Secret API Key
is set, you may go ahead and make api calls
Implemented Methods
api.orders.getAll
api.orders.getOne
api.orders.update
api.discounts.getAll
api.discounts.getOne
api.discounts.update
api.discounts.create
api.subscriptions.getAll
api.subscriptions.getOne
api.subscriptions.invoices
api.subscriptions.pause
api.subscriptions.resume
api.subscriptions.cancel
api.notifications.getAll
api.notifications.create
api.refunds.getAll
api.refunds.getOne
api.refunds.create
api.customers.getAll
api.customers.getOne
api.customers.orders
api.userSessions.getOne
api.products.getAll
api.products.getOne
api.products.create
api.products.update
api.abandonedCarts.getAll
api.abandonedCarts.getOne
api.domains.getDefaultDomain
api.domains.updateDefaultDomain
api.domains.getAllowedDomains
api.domains.createAllowedDomains
api.domains.deleteAllowedDomains
api.shippingMethods.getAll
api.shippingMethods.getOne
api.shippingMethods.update
api.shippingMethods.deleteOne
api.shippingMethods.create
All Methods accept a single param (options
{Object}).
Request Options
Property | Description |
---|---|
urlParams {Object} | Holds keys that may replace url paramaters that may need an id or token for eg. {id: '1234'} To know which methods need url parameters please view the api definition |
params {Object} | This is an object map of all query parameters that you wish to send with the request for eg. {limit:50, offset:0, status:'Active'} |
data {Object} | the body of the request, usually used for PUT and POST requests |
eg.
const snipcart = ;snipcartapirefunds ;
Notes
- Pull requests are welcome.