Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
shopify-api-node
Advanced tools
Shopify API bindings for Node.js.
$ npm install --save shopify-api-node
This module exports a constructor function which takes an options object.
Shopify(options)
Creates a new Shopify
instance.
options
- Required - A plain JavaScript object that contains the
configuration options.shopName
- Required - A string that specifies the shop name.apiKey
- Required for private apps - A
string that specifies the API key of the app. This option must be used in
conjunction with the password
option and is mutually exclusive with the
accessToken
option.password
- Required for private apps -
A string that specifies the private app password. This option must be used in
conjunction with the apiKey
option and is mutually exclusive with the
accessToken
option.accessToken
- Required for public apps - A string representing the
permanent OAuth 2.0 access token. This option is mutually exclusive
with the apiKey
and password
options. If you are looking for a premade
solution to obtain an access token, take a look at the shopify-token
module.autoLimit
- Optional - This option allows you to regulate the request rate
in order to avoid hitting the rate limit. It can be a
boolean or a plain JavaScript object. When set to true
requests are limited
to 2 per second. When using an object, the calls
property specifies the
maximum number of allowed requests and the interval
property the timespan
in milliseconds where the limit is calculated. For example
{ calls: 4, interval: 1000 }
specifies a maximum of 4 requests per second.
Defaults to false
.timeout
- Optional - A number that specifies the milliseconds to wait for
the server to send response headers before aborting the request. Defaults to
60000
, or 1 minute.A Shopify
instance.
Throws an Error
exception if the required options are missing.
const Shopify = require('shopify-api-node');
const shopify = new Shopify({
shopName: 'your-shop-name',
apiKey: 'your-api-key',
password: 'your-app-password'
});
shopify.callLimits
The callLimits
property allows you to monitor the API call limit. The value
is an object like this:
{
remaining: 30,
current: 10,
max: 40
}
Values start at undefined
and are updated every time a request is made.
Every resource is accessed via your shopify
instance:
const shopify = new Shopify({
shopName: 'your-shop-name',
accessToken: 'your-oauth-token'
});
// shopify.<resouce_name>.<method_name>
Each method returns a Promise
that resolves with the result:
shopify.order.list({ limit: 5 })
.then(orders => console.log(orders))
.catch(err => console.error(err));
delete()
activate(id, params)
create(params)
get(id[, params])
list([params])
authors()
count(blogId[, params])
create(blogId, params)
delete(blogId, id)
get(blogId, id[, params])
list(blogId[, params])
tags([blogId][, params])
update(blogId, id, params)
create(themeId, params)
delete(themeId, params)
get(themeId, params)
list(themeId[, params])
update(themeId, params)
count()
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
create(params)
delete(id)
get(id)
list()
update(id, params)
count([params])
list([params])
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
approve(id)
count([params])
create(params)
get(id[, params])
list([params])
notSpam(id)
remove(id)
restore(id)
spam(id)
update(id, params)
count()
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
accountActivationUrl(id)
count()
create(params)
delete(id)
get(id[, params])
list([params])
search(params)
update(id, params)
create(customerId, params)
default(customerId, id)
delete(customerId, id)
get(customerId, id)
list(customerId[, params])
set(customerId, params)
update(customerId, id, params)
count([params])
create(params)
customers(id[, params])
delete(id)
get(id[, params])
list([params])
update(id, params)
create(params)
delete(id)
disable(id)
enable(id)
get(id)
list([params])
complete(id[, params])
count()
create(params)
delete(id)
get(id[, params])
list([params])
sendInvoice(id[, params])
update(id, params)
count([params])
get(id[, params])
list([params])
cancel(orderId, id)
complete(orderId, id)
count(orderId[, params)
create(orderId, params)
get(orderId, id[, params])
list(orderId[, params])
open(orderId, id)
update(orderId, id, params)
create(orderId, fulfillmentId, params)
delete(orderId, fulfillmentId, id)
get(orderId, fulfillmentId, id)
list(orderId, fulfillmentId[, params])
update(orderId, fulfillmentId, id, params)
create(params)
delete(id)
get(id)
list([params])
update(id, params)
count([params])
create(params)
disable(id)
get(id)
list([params])
search(params)
update(id, params)
get(id)
list()
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
cancel(id[, params])
close(id)
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
open(id)
update(id, params)
create(orderId, params)
delete(orderId, id)
get(orderId, id)
list(orderId)
update(orderId, id, params)
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
list([params])
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
count(productId[, params])
create(productId, params)
delete(productId, id)
get(productId, id[, params])
list(productId[, params])
update(productId, id, params)
count(productId)
create(productId, params)
delete(productId, id)
get(id[, params])
list(productId[, params])
update(id, params)
count(countryId[, params])
get(countryId, id[, params])
list(countryId[, params])
update(countryId, id, params)
activate(id, params)
create(params)
delete(id)
get(id[, params])
list([params])
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
get(orderId, id[, params])
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
list([params])
get([params])
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
order(id, params)
update(id, params)
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
count(orderId)
create(orderId, params)
get(orderId, id[, params])
list(orderId[, params])
create(recurringApplicationChargeId, params)
get(recurringApplicationChargeId, id[, params])
list(recurringApplicationChargeId[, params])
current()
get(id)
list()
count([params])
create(params)
delete(id)
get(id[, params])
list([params])
update(id, params)
where params
is a plain JavaScript object. See https://help.shopify.com/api/reference?ref=microapps
for parameters details.
Shopify Embedded App Frontend Framework
Used in our live products: MoonMail & MONEI
FAQs
Shopify API bindings for Node.js
The npm package shopify-api-node receives a total of 26,949 weekly downloads. As such, shopify-api-node popularity was classified as popular.
We found that shopify-api-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.