APIs & Integrations

rchh
Member

LifeCycle changes through the API

Hi,

If I change the lifecycle of a contact through the API- for some reason, it turns into a ‘subscriber’. But if I run the same API call, then the lifecycle is then changed to ‘customer’. Can you let me if I am missing something? I want the lifecycle to change to ‘customer’ on my first attempt.

Thanks,
rchh

0 Upvotes
8 Replies 8
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

LifeCycle changes through the API

Hi @rchh,

Based on the property history of that particular contact, it looks like the Lifecycle Stage property was set to subscriber via API on 2/17, and was updated to customer on 2/21. I can see the contact was created using the 'Create or update a contact' endpoint; is it possible that the contact was created by a request without Lifecycle Stage (therefore resulting in the default Lifecycle Stage of subscriber) on the 17th?

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

LifeCycle changes through the API

Hi @rchh,

Did this request update an existing contact, or did it create a brand new contact? Can you send me a link to an example contact in your portal?

@ErikAugust an example contact would be helpful in troubleshooting your issue, in case they're not the same issue.

0 Upvotes
rchh
Member

LifeCycle changes through the API

Hi @Derek_Gervais This created a new contact. Here's the link to the contact:
https://app.hubspot.com/contacts/2998717/contact/9814201/?interaction=note

Thanks,
rchh

0 Upvotes
ErikAugust
Member

LifeCycle changes through the API

I am also receiving this behavior on the “https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/{$email}” endpoint.

0 Upvotes
rchh
Member

LifeCycle changes through the API

Hi @Derek_Gervais

Here's the same API request which changed the customer to 'subscriber' first and then 'customer' on the second attempt. First API call: Feb 17 at 3:12 AM EST, Second API call: Feb 21 at 11:40 AM EST. The only difference is that the second one was run manually as compared to using a cron job.

Thanks,
rchh

{"properties": [{"property":"email","value": "XXXX@XXX.edu"}, {"property":"lastordersummarycustomerfacinglifetimetotalvalue","value": "0.00"}, {"property":"lifecyclestage","value": "customer"},{"property":"lastordersummarycustomerfacingnumberoftitlespurchasedltd","value": "1"},{"property":"lastordersummarycustomerfacingnumberofformatspurchased","value": "1"},{"property":"lastordersummarycustomerfacingnumberofmailcodesused","value": "0"},{"property":"lastordersummarycustomerfacingnumberofauthorspurchasedltd","value": "1"},{"property":"lastordersummarycustomerfacingavgitemsperorder","value": "1.0000"},{"property":"lastordersummarycustomerfacingavgunitspertitle","value": "1.0000"},{"property":"lastordersummarycustomerfacingavgunitsperorder","value": "1.0000"},{"property":"lastordersummarycustomerfacingavgordervaluedollars","value": "0.000000"},{"property":"lastordersummarycustomerfacingavgordervalueperunits","value": "0.000000"}]}
{"vid":9814201,"isNew":false}

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

LifeCycle changes through the API

Hi @rchh,

I’m not sure; that’s certainly not what’s supposed to be happening. Can you send me a link to an example contact where you saw this behavior?

0 Upvotes
rchh
Member

LifeCycle changes through the API

Hi @Derek_Gervais,

Thanks for your response. I set the following property of a contact to ‘customer’
{“property”:“lifecyclestage”,“value”: “customer”}

For some reason, this does not work immediately- and on my first attempt the lifecycle is changed to ‘subscriber’. On my second attempt, the life cycle is then set correctly. Am I missing something?

Thanks,
rchh

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

LifeCycle changes through the API

Hi @rchh,

Can you post some more information on the API calls you’re making? You shouldn’t have to do anything different to update the Lifecycle Stage property.

0 Upvotes