Hello IrfanA513,
Thank you for reaching out to Constant Contact API Developer Support, my name is Courtney. My team is here to assist outside software developers with questions about building into Constant Contact's API.
This can be accomplished by importing the contact data with the unique coupon code as a Custom Contact Field, and then setting up an Automated Series within your Constant Contact account that uses those Custom Contact variables to send out a personalized email automation.
To accomplish this using the V3 API (rather than doing it manually), when developing your application you’d want to set up a contacts sync that includes the unique coupon codes for each customer as a Custom Field, and to have them be added to a specific list associated with the automation that you are wanting to send.
Getting Started with V3 API
https://v3.developer.constantcontact.com/api_guide/index.html
Use this flow to add/update your contacts which incorporates three contact endpoints:
Step 1: Check to see if the contact exists in the account
GET a Contact
https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts
Step 2: If the contact comes back as non-existent, use POST to create the contact:
POST (create) a Contact
https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/createContact
Step 3: If the contact comes back as already existing in the account. You need to append the returned data with the desired list memberships and send that back with PUT to update the contact:
*When Updating a contact, we need to append the new information to the old information and send all of it back in the request, because when you update a contact using a PUT, all properties are updated, overwriting all existing property values. Any properties left blank or not included in the PUT will be overwritten with a null value.
PUT (update) a Contact
https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/putContact
The list join series and associated list will need to be created within the UI.
Create an automated email series
https://knowledgebase.constantcontact.com/articles/KnowledgeBase/27935-Choosing-a-Trigger-for-Your-Automated-Email-Series
Please have a look and let us know if you have any other questions!
Regards,
Courtney E.
Tier II API Support Specialist
... View more