Solved

Is there a Customer Login API

_chath_s_
Tourist
5 0 5

Hi,

 

I am trying to create a mobile app that connects to the storefront API and allows users to purchase items. 

The app has a login function, and I was wondering if shopify has an API for customer Login? Or is this something that needs to be handled on our server side, and use multipass to connect with shopify a user?

Additionally, does shopify support push notifications on order confirmations, order shipments etc.? 

Accepted Solution (1)
lramhudda
Shopify Partner
10 1 4

This is an accepted solution.

Replies 3 (3)

lramhudda
Shopify Partner
10 1 4

// Login Match

Storefront-Access-Token from app admin site
Email
Password
Shop URL

Just update your details and copy paste work 

its work fine


$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://djsoundss.myshopify.com/api/2022-01/graphql.json',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"query":"mutation SignInWithEmailAndPassword(\\n $email: String!, \\n $password: String!,\\n) {\\n customerAccessTokenCreate(input: { \\n email: $email, \\n password: $password,\\n }) {\\n customerAccessToken {\\n accessToken\\n expiresAt\\n }\\n customerUserErrors {\\n code\\n message\\n }\\n }\\n}","variables":{"email":"lram@mtoag.com","password":"123456"}}',
CURLOPT_HTTPHEADER => array(
'X-Shopify-Storefront-Access-Token: 8b330934c14b539fe97e4a7dc6bdd8f3',
'Content-Type: application/json'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

lramhudda
Shopify Partner
10 1 4

This is an accepted solution.

_chath_s_
Tourist
5 0 5

This is great. thanks a bunch!

Did you also do a registration with a social login?