NAME
WWW::Shopify - Main object representing acess to a particular Shopify store.
DESCRIPTION
WWW::Shopify represents a way to grab and upload data to a particular shopify store. All that's required is the access token for a particular app, its url, and the API key, or altenratively, if you have a private app, you can substitue the app password for the api key. If you want to use make a private app, use WWW::Shopify::Private. If you want to make a public app, use WWW::Shopify::Public.
EXAMPLES
In order to get a list of all products, we can do the following:
# Here we instantiate a copy of the public API object, with all the necessary fields.
my $SA = new WWW::Shopify::Public($ShopURL, $APIKey, $AccessToken);
# Here we call get_all, OO style, and specify the entity we want to get.
my @Products = $SA->get_all('WWW::Shopify::Product');
In this way, we can get and modify all the different types of shopify stuffs.
If you don't want to be using a public app, and just want to make a private app, it's just as easy:
# Here we instantiate a copy of the private API object this time, which means we don't need an access token, we just need a password.
my $sa = new WWW::Shopify::Private($shop_url, $api_key, $password);
my @Products = $SA->get_all('WWW::Shopify::Model::Product');
Easy enough.
To insert a Webhook, we'd do the following.
my $webhook = new WWW::Shopify::Webhook({topic => "orders/create", address => $URL, format => "json"});
$SA->create($Webhook);
And that's all there is to it. To delete all the webhooks in a store, we'd do:
my @Webhooks = $SA->get_all('WWW::Shopify::Webhook');
for (@Webhooks) {
$SA->delete($_);
}
Very easy.
METHODS
api_key
Gets/sets the applciation api key to use for this particular app.
shop_url
Gets/sets the shop url that we're going to be making calls to.
SEE ALSO
WWW::Shopify::Public, WWW::Shopify::Private, WWW::Shopify::Test, WWW::Shopify::Item, WWW::Shopify::Common::DBIx
AUTHOR
Adam Harrison (adamdharrison@gmail.com)
LICENSE
See LICENSE in the main directory.