martinamps / shopify-private-apis Goto Github PK
View Code? Open in Web Editor NEWHelper to access closed shopify api's
Home Page: ma.rtin.so/reverse-engineering-shopify-private-apis
Helper to access closed shopify api's
Home Page: ma.rtin.so/reverse-engineering-shopify-private-apis
I'm glad someone has done the hard work to research this technique. I was wondering if someone would be so kind to let me know if it still works? Thanks
I am getting an error page when trying to login. Shopify will not allow me to login using this app it seems.
I am debugging.
You’re using version 49.0.2623.111 of Chrome, which is not supported by Shopify. You can update to the latest version by selecting "Update Google Chrome" from your browser’s toolbar and restarting Chrome. If you continue using the current version some features may not work correctly.
Im getting a really weird error. I've been programming this in localhost so far and it worked out fine, but when I upload it to the server I couldn't use it anymore. The error came out that "Failed to set token." Does this have something to do with the server permissions or am I doing something wrong? Has anyone stumbled upon this error?
Just wanted to put it out there. The creation of the discount does not work anymore. I managed to get the get function to work by changing the way the CSRF token get's parsed, but that's about it.
Is it at all possible to delete coupons dynamically in Shopify?
{
EDIT:
Issue resolved after syncing repo.
this line changed.
meta name="csrf-token" content="(.*)" /
}
The CSRF token is unable to be set any longer using this application.
this may have to do with filter_var in the set token function. (I have not fully debugged.)
Also, Shopify Plus accounts now have the ability to use the Discounts API.
Shopify may have also closed the door on this "feature" as it is not offered to accounts that are not Plus accounts.
Using the code below I'm getting the login screen, but the strange thing is that it DID work once and I saw the discount within Shopify. I'm logged in, but every time I hit my example.php script I get the login screen now. Any ideas?
-Aaron
<?php
require 'shopify.php';
$api = new \Shopify\PrivateAPI('[email protected]', 'AdminPassword', 'https://mystore.myshopify.com/admin');
if (!$api->isLoggedIn() && !$api->login()) {
echo '<p>invalid credentials</p>';
} else {
# Create a 5% discount coupon
$new_discount = ['discount' => [
'applies_to_id' => '',
'code' => 'automatic_coupon',
'discount_type' => 'percentage',
'value' => 5,
'usage_limit' => 1,
'starts_at' => date('Y-m-d\TH:i:sO', mktime(0, 0, 0)),
'ends_at' => null,
'applies_once' => false
]];
# Set the CSRF token for the POST request
try { $api->setToken('https://mystore.myshopify.com/admin/discounts/new'); }
catch (\Exception $ex) { }
$do_discount = $api->doRequest('POST', 'discounts.json', $new_discount);
print_r($do_discount);
}
Hello Im getting an error while trying to use the POST method, each time it returns "Failed to set token" Ive tried many ways of solving this with the ideas posted before, but with no luck. I can actually use the get but I cant use the post, apparently the token is not being made. Any ideas why? Here si part of the code:
try { $api_shopify->setToken('https://myshop.myshopify.com/admin/discounts/new'); } catch (\Exception $ex) { echo "Error: " . $ex} $responseOrderShopify = $api_shopify->doRequest('POST', 'orders.json', $MLOrder);
I tried with the url https://myshop.myshopify.com/admin/draft_orders/new
And I get this error:
Error: exception 'Exception' with message 'Failed to set token' in /home/mysite/public_html/mysite.com/app/Plugin/Shopify/Controller/InstallController.php:1026
Also on the print for $responseOrderShopify
I get the webadmin login. Im not sure if Im doing anything wrong here? Could someone help me ? :D
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.