Using API to add people to marketing

Hello, 

 

I'm currently setting up my website separately to square's tools. The issue im having is setting up box to allow people to sign up to marketing emails. Currently the signup box adds their email to the customer director but their marketing status is set to Not Subscribed. I'm currently using this code: 

      const createResponse = await client.customersApi.createCustomer({
        emailAddress: email,
        preferences: {
          emailUnsubscribed: false
        },
        referenceId: 'newsletter-signup',
        note: 'Subscribed to newsletter from website'
      });
 
Any help would be appreciated
475 Views
Message 1 of 3
Report
2 REPLIES 2

Right, on reading the customer API documentation, it looks like this is not possible to do through API calls as the marketing box is read only. Instead it can be set up so that the newsletter box on the website adds the person signing up to the customer directory with nothing but their email and then add them to a group called newsletter subscriber, then I believe we can use that information with the square marketing feature. I have not purchased square marketing yet as the website is not live yet. 

 

Hopefully the above information is useful to someone else who had the same question as me. 

460 Views
Message 2 of 3
Report
Square Community Moderator

Thank you for providing an update here, @MedicDesignCo!

if you haven't already checked it out, the best place to find API-related information and discussions would be on our Square Developer Forum. Our Developers are active on the forum and would be happy to address any questions you have. 😊

456 Views
Message 3 of 3
Report