Generate Loop access token to authenticate storefront API.
Endpoint:
POST /a/loop_subscriptions/storefront/auth/accessToken
Description:
This endpoint validates the Shopify customer session and returns a Loop access token if the customer is authenticated.
Behavior:
-
Returns
401 Unauthorized
if:- The customer is not logged into their Shopify account.
- The customer does not exist in the Loop.
-
On success, returns an
accessToken
in the response payload.
Response Example (200 OK):
{
"success": true,
"message": "Access token generated successfully",
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyVHlwZSI6IkNVU1RPTUVSIiwidXNlcklkIjo2Mjg2NzE5NywidXNlclNob3BpZnlJZCI6NzMwMjg0MzMzNDgyOSwic3RvcmVJZCI6ODE2MiwibXlzaG9waWZ5RG9tYWluIjoiYmVjYXVzZW1hcmtldC1wcmdhasdkjn2jdkhqdsajhjkd1klxhdndkndasXh0IjpudWxsLCJpYXQiOjE3NDg5NTE3OTgsImV4cCI6MTc0OTI5NzM5OH0.cWxEG00rYhhU3jEA3Xrh9DEUQiXYzRQ07ThwypVd7ZM"
}
}
Response Example (401 Unauthorized):
{
"success":false,
"message":"Unauthorized",
"data":{}
}
Usage:
Use the returned accessToken
to authenticate requests to the Loop Storefront API.
Note:
This endpoint only works on the Shopify storefront.