BUG: phone_email not populated/returned from /api/invoices/(d+)/

markguertinmarkguertin Member Posts: 61
Reference:  https://www.lightspeedhq.com/onsite-docs/contract_docs/generated_docs/api.invoices.html#api-invoices-d

phone_email is always returning blank data on all of my lookups here across 13 stores.  Only way to get this information right now seems to be using an additional lookup for the full customer details via the API -- which works for new orders (although not liking have to use another full call to do so), but for historical purposes the customer email should be attached to the actual invoice at time of purchase and to be able to be looked up via API from the invoice details.

4 comments

  • markguertinmarkguertin Member Posts: 61
    Of note, the information seems to exist because the mainphone + the customer's email are being returned concatenated in the contact_info field. 
  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    @markguertin I get the same results. The phone_email can be set through the API, but it isn't set by the client app. I've filed this as a bug.

    You can get the email from the contact_info field. It will always contain the phone number and email address separated by a new line (
).

    Note that there will only be a newline if both are present. If there's no phone number on the invoice, but there is an email address, the contact_info field will contain just the email address with no newline character.
    James Ratcliffe
    Lightspeed HQ
  • markguertinmarkguertin Member Posts: 61
    Hi James, I also submitted a bug report as well and referenced this (just so we don't have dupes, didn't get a report number back on it yet).  I'd rather not do complicated parsing so I'm just sticking to lookup from the customer data in the API until this is resolved.  Thanks for responding.
  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    Yeah, it is pretty fiddly, but it's an option.
    James Ratcliffe
    Lightspeed HQ
Sign In or Register to comment.