• Resolved Sagar Tamang

    (@mi5t4n)


    I am trying to get the details of the customer using email using following url

    https://mamham.com/wp-json/wc/v2/[email protected]

    I have used the correct consumer key and secret. I am getting the other details like all customers. I am also getting customer details using id. But I want to get the customer details using email. I am getting following error.

    <span>Oops, something went wrong, please try again or contact the administrator to check more info.</span>
    <!DOCTYPE html>
    <html xmlns="https://www.w3.org/1999/xhtml" lang="en-US">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta name="viewport" content="width=device-width">
            <meta name='robots' content='noindex,follow' />
            <title>WordPress &rsaquo; Error</title>
            <style type="text/css">
    		html {
    			background: #f1f1f1;
    		}
    		body {
    			background: #fff;
    			color: #444;
    			font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    			margin: 2em auto;
    			padding: 1em 2em;
    			max-width: 700px;
    • This topic was modified 6 years, 4 months ago by Sagar Tamang.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Shane Eckert

    (@shaneeckert)

    Automattic Happiness Engineer

    Hi!

    I just tested this out a bit with my own site and I am able to use the following to list a customer.

    https://sellanything.blog/wp-json/wc/v3/[email protected]

    This is what I get returned.

    [
    {
    “id”: 8,
    “date_created”: “2018-10-12T17:42:42”,
    “date_created_gmt”: “2018-10-12T17:42:42”,
    “date_modified”: null,
    “date_modified_gmt”: null,
    “email”: “[email protected]”,
    “first_name”: “John”,
    “last_name”: “Shepherd”,
    “role”: “customer”,
    “username”: “John Shepherd”,
    “billing”: {
    “first_name”: “”,
    “last_name”: “”,
    “company”: “”,
    “address_1”: “”,
    “address_2”: “”,
    “city”: “”,
    “state”: “”,
    “postcode”: “”,
    “country”: “”,
    “email”: “”,
    “phone”: “”
    },
    “shipping”: {
    “first_name”: “”,
    “last_name”: “”,
    “company”: “”,
    “address_1”: “”,
    “address_2”: “”,
    “city”: “”,
    “state”: “”,
    “postcode”: “”,
    “country”: “”
    },
    “is_paying_customer”: false,
    “avatar_url”: “https://secure.gravatar.com/avatar/hidden_for_example&#8221;,
    “meta_data”: [
    {
    “id”: 492,
    “key”: “_wc_customer_order_csv_export_is_exported”,
    “value”: “0”
    },
    {
    “id”: 493,
    “key”: “wc_points_balance”,
    “value”: “0”
    },
    {
    “id”: 494,
    “key”: “_wcs_subscription_ids_cache”,
    “value”: []
    },

    Can you try using V3 and see if that helps?

    Cheers!

    Thread Starter Sagar Tamang

    (@mi5t4n)

    I am getting the result from my other website. But I am not getting it in the https://mamham.com

    I was getting the result a few days ago, but what happened I don’t know. I stopped getting the response.

    How do I use V3?

    Shane Eckert

    (@shaneeckert)

    Automattic Happiness Engineer

    Hi!

    WooCommerce 3.5 has V3. If you are able to update to the latest version, that would be good.

    If it did work before, and the same is working on other sites, then something must have changed. Either server side or maybe a conflict was introduced?

    The best way to determine if the issue is being caused by a theme and/or plugin is to temporarily switch your theme to Storefront and disable all plugins except for WooCommerce. If you can install plugins, install Health Check. On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you while you’re logged in to that session without affecting normal visitors to your site. Note that Health Check may not count Storefront as a default theme, so you can also use Twenty Seventeen as well.

    If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, continue to the next step.5. Reactivate your other plugins one by one, testing after each, until you find the one causing conflict.

    Thread Starter Sagar Tamang

    (@mi5t4n)

    I will check it and let you know.

    • This reply was modified 6 years, 4 months ago by Sagar Tamang.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unable to get the customers details by email’ is closed to new replies.