title: Mailchimp Insert custom form fields to list
body: <p>I'm trying to insert data to mailchip using below code but its not working, Problem with my new field  <code>'Q1'     =&gt; "50000",</code> when I'll remove this then able to add successfully but I need to insert extra fields. I need to insert Email, Name, Q1, Q2, Q3, Q4 and Q5.</p>
  
  <p>Here is Q1 field setting in mailchimp form</p>
  
  <p><a href="https://i.stack.imgur.com/XhSDX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XhSDX.png" alt="enter image description here"></a></p>
  
  <p>And My PHP code is: </p>
  
  <pre><code> $data = [
              'email'     =&gt; 'johndoe@example.com',
              'status'    =&gt; 'subscribed',
              'firstname' =&gt; 'john',
              'lastname'  =&gt; 'doe'
          ];
  
          Mailchimp($data);
  
  
      function Mailchimp($data) {
          $apiKey = 'XXXXXXXXXXXXXXXXX';
          $listId = 'XXXXXXXX';
          $memberId = md5(strtolower($data['email']));
          $dataCenter = substr($apiKey,strpos($apiKey,'-')+1);
          $url = 'https://' . $dataCenter . '.api.mailchimp.com/3.0/lists/' . $listId . '/members/' . $memberId;
          $json = json_encode([
              'email_address' =&gt; $data['email'],
              'status'        =&gt; $data['status'], // "subscribed","unsubscribed","cleaned","pending"
              'merge_fields'  =&gt; [
                  'FNAME'     =&gt; $data['firstname'],
                  'LNAME'     =&gt; $data['lastname'],
                  'Q1'     =&gt; "50000",
              ],
  
          ]);
          $ch = curl_init($url);
          curl_setopt($ch, CURLOPT_USERPWD, 'user:' . $apiKey);
          curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
          curl_setopt($ch, CURLOPT_TIMEOUT, 10);
          curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
          curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
          curl_setopt($ch, CURLOPT_POSTFIELDS, $json);                                                                                                             
          $result = curl_exec($ch);
          $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
          curl_close($ch);
          return $httpCode;
      }
  </code></pre>
  
  <p>Any Help will be appreciated </p>