Description Arguments Details ShopifyShop Class Generator Usage Public Fields Public Functions Examples
The ShopifyShop
class fully encapsulates the Shopify API. It is an R6
class, and
as such is initialized via the ‘new’ function (see the example section for details).
shopURL |
the URL of your shop, as in shopname.myshopify.com |
password |
a Shopify API private app password or permanent access token (see Details) |
storeFrontToken |
a Storefront API access token |
quiet |
suppress output of API announcements |
In order to access the Shopify Admin API, users will need a set of authorized API access credentials. Tthese so-called ‘private app’ credentials can be created in the Shopify store admin section. More information about how to do this can be found here. Once the credentials are created, they remain valid and can be used in subsequent R sessions.
At the moment, the ShopifyShop
class does not support OAuth authentication. It is possible that
this may be implemented in the future. Note that users who possess a valid ‘permanent access token’
from a previous OAuth Authentication (see here) may
use it as the password
field of the ShopifyShop class as the private app password is essentially
analagous to the permanent token granted through successful OAuth authentication.
ShopifyShop$new(shopURL, password, quiet = FALSE)
if successful, will return a new ShopifyShop
object.
shopInfo
information about the shop as returned by getShop
createApplicationCharge
getApplicationCharge
getApplicationCharges
activateApplicationCharge
getArticles
getArticlesCount
getArticle
createArticle
modifyArticle
getArticleAuthors
getArticleTags
deleteArticle
getAssets
getAsset
createAsset
modifyAsset
deleteAsset
getBlogs
getBlogsCount
getBlog
createBlog
modifyBlog
deleteBlog
createCarrierService
modifyCarrierService
getCarrierServices
getCarrierService
deleteCarrierService
getCheckoutsCount
getCheckouts
createCollect
deleteCollect
getCollects
getCollectsCount
getCollect
getComments
getCommentsCount
getComment
createComment
modifyComment
markCommentAsSpam
markCommentAsNotSpam
approveComment
removeComment
restoreComment
getCountries
getCountriesCount
getCountry
createCountry
modifyCountry
deleteCountry
getCustomCollections
getCustomCollectionsCount
getCustomCollection
createCustomCollection
modifyCustomCollection
deleteCustomCollection
getCustomers
searchCustomers
getCustomer
createCustomer
modifyCustomer
deleteCustomer
getCustomersCount
getCustomerOrders
getCustomerSavedSearches
getCustomerSavedSearchesCount
getCustomerSavedSearch
getCustomerSavedSearchResults
createCustomerSavedSearch
modifyCustomerSavedSearch
deleteCustomerSavedSearch
createDiscountCode
modifyDiscountCode
getDiscountCodes
getDiscountCode
deleteDiscountCode
deleteDiscountCode
createDiscountCodesCreationJob
getDiscountCodesCreationJob
getDiscountCodesFromCreationJob
createDraftOrder
modifyDraftOrder
getDraftOrders
getDraftOrder
getDraftOrdersCount
sendDraftOrderInvoice
deleteDraftOrder
completeDraftOrder
getEvents
getEvent
getEventsCount
getFulfillments
getFulfillmentsCount
getFulfillment
createFulfillment
modifyFulfillment
completeFulfillment
cancelFulfillment
getFulfillmentEvents
getFulfillmentEvent
createFulfillmentEvent
deleteFulfillmentEvent
getFulfillmentServices
createFulfillmentService
getFulfillmentService
modifyFulfillmentService
deleteFulfillmentService
getGiftCards
getGiftCard
getGiftCardsCount
createGiftCard
modifyGiftCard
disableGiftCard
searchGiftCards
getLocations
getLocation
getMarketingEvents
getMarketingEventsCount
getMarketingEvent
createMarketingEvent
updateMarketingEvent
deleteMarketingEvent
createMarketingEventEngagements
getMetafields
getMetafieldsCount
getMetafield
createMetafield
modifyMetafield
deleteMetafield
getOrders
getOrder
getOrdersCount
closeOrder
openOrder
cancelOrder
createOrder
modifyOrder
deleteOrder
createOrderRisk
getOrderRisks
getOrderRisk
modifyOrderRisk
deleteOrderRisk
getPages
getPagesCount
getPage
createPage
modifyPage
deletePage
getPriceRules
getPriceRulesCount
getPriceRule
createPriceRule
modifyPriceRule
deletePriceRule
getPolicies
getProducts
getProductsCount
getProduct
createProduct
modifyProduct
deleteProduct
getProductImages
getProductImagesCount
getProductImage
createProductImage
modifyProductImage
deleteProductImage
getProductListings
getProductListingProducts
getProductListingsCount
getProductListing
createProductListing
deleteProductListing
getProductVariants
getProductVariantsCount
getProductVariant
createProductVariant
modifyProductVariant
deleteProductVariant
getProvinces
getProvincesCount
getProvince
modifyProvince
createRecurringCharge
getRecurringCharge
getRecurringCharges
activateRecurringCharge
cancelRecurringCharge
getRedirects
getRedirectsCount
getRedirect
createRedirect
modifyRedirect
deleteRedirect
getRefund
getReports
getReport
createReport
modifyReport
deleteReport
createResourceFeedback
getResourceFeedbacks
getScriptTags
getScriptTagsCount
getScriptTag
createScriptTag
modifyScriptTag
deleteScriptTag
getShippingZones
getShop
getSmartCollections
getSmartCollectionsCount
getSmartCollection
createSmartCollection
modifySmartCollection
orderSmartCollection
deleteSmartCollection
getThemes
getTheme
createTheme
modifyTheme
deleteTheme
getTransactions
getTransactionsCount
getTransaction
createTransaction
createUsageCharge
getUsageCharge
getUsageCharges
getUsers
getUser
getCurrentUser
getWebhooks
getWebhooksCount
getWebhook
createWebhook
modifyWebhook
deleteWebhook
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
# Before you can access the API, you must create a ShopifyShop object using your credentials
shop <- ShopifyShop$new("yourstore.myshopify.com","private_app_password")
# Get all smart collections
collections <- shop$getSmartCollections()
# Search for customers named Bob from the United States
bobs <- shop$searchCustomers("Bob country:United States")
# Create a new product
product <- list(title="The R Inferno",
body="<b>The R Inferno</b><i>by Patrick Burns</i>",
vendor="Burns Statistics",
product_type="Paperback",
images=list(list(src="http://www.burns-stat.com/wp-content/
uploads/2012/12/R_inferno_cover.jpg")))
newProduct <- shop$createProduct(product)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.