Sometimes you may need to validate whether a customer has a valid membership, but this doesn't always happen on your Shopify store. To solve this use case, we offer a public endpoint to let you validate whether an email address has an active or cancelled membership on your store.
How it Works
We've made this as easy as possible so that you can add it to virtually any existing site, app, or service. Simply connect to this URL with a GET request, replacing the values for domain
and email
to represent your myshopify.com domain, and the email of the customer you are querying:
https://mem.simplee.best/api/v1/validateCustomer?domain=[myshopify domain]&email=[email]
A sample request with actual data could be:
https://mem.simplee.best/api/v1/validateCustomer?domain=mystore.myshopify.com&email=john.smith@gmail.com
This request could be submitted from a backend script using cURL, or could be added to some frontend Javascript to validate a customer as a page is loading.
Return Values
When sending a request to this URL, our app will return one of two possible responses. One will simply indicate that there is no match for the domain and customer you returned, while the other will send back a JSON object with all current and past memberships for the customer.
No Results
If there is no match for the email address and domain sent, a message will be sent in the format:
{
"message": "No results"
}
Results
If there has ever been any membership activity for the email address provided, you will see a JSON object with all past and present memberships. The format of the object will be:
{
"results": [
{
"valid": true,
"status": "active",
"next_billing_date": "2021-10-11 21:01:00",
"membership": "Gold Plan"
},
{
"valid": false,
"status": "cancelled",
"next_billing_date": "2020-09-02 21:01:00",
"membership": "Platinum Plan"
}
]
}
Here are the definitions of each value:
valid: whether this customer has a membership which should currently be considered as valid today. This could include members who have cancelled their membership but who still have time before the membership expires
βstatus: this is the current status of the membership. Possible options are active, paused, and cancelled
βnext_billing_date: the next planned billing date for this membership. Invalid memberships will have a billing date in the past
βmembership: the name of the membership plan this member has subscribed to. If the member has memberships to multiple plans, each will appear in their own object.