Adding a contact after checkout through API - contact_add API call

We’ve got an e-commerce site running that has a checkbox “Subscribe to our newsletter” during the checkout process.

If I make an API call using contact_add will the system generate an error if that contact email already exists? Or will an existing contact record be updated to include the list and tags specified during the API call?

Edit: Another question - will these users added through the API receive the opt-in confirmation email that users who subscribe through forms receive?

Thanks in advance!

Hey @brewhouse,

You might want to take a look at the contact_sync API endpoint instead - http://www.activecampaign.com/api/example.php?call=contact_sync

Also, it might be helpful to check out the docs for the contact_tag_add endpoint - http://www.activecampaign.com/api/example.php?call=contact_sync

Contacts added via API will need to 2x opt-in if you pass a form id during the contact_sync call, otherwise they will not need to opt-in.

3 Likes

Yup, contact_sync is the way to go.

@jskole are you sure adding a form by itself is the trigger for double optin? I believe that depends on how you set that form up. If the form requires confirmation then it’ll be double optin. And if no confirmation, it’s single optin.

1 Like

Yes, @bizleverage that is correct, it will depend on the form id that you send along. If the form is setup for 2x opt-in the contact submitted via API will honor that.

1 Like

Hey all,

Biannca here from our CX team.

I just wanted to let anyone who comes across this post that we’ve updated our API version to “v3”.

These are the updated calls the contact_sync API endpoint
https://developers.activecampaign.com/reference/sync-a-contacts-data.

Please don’t hesitate to reply back out or email us at help@activecampaign.com if you have any further questions.