Chargify XML for Custom Field Wordpress

64 views Asked by At

I am using chargify plugin. I want added a custom field in chargify account want to save data using XML.

Presently XML is like which is used to send data to chrgify:-

<?xml version="1.0" encoding="UTF-8"?>
        <subscription>
            <product_id>' . $_POST["submit"] . '</product_id>
            <customer_attributes>
            <first_name>'.$_POST["chargifySignupFirst"].'</first_name>
            <last_name>'.$_POST["chargifySignupLast"].'</last_name>
            <email>'.$_POST["chargifySignupEmail"].'</email>
        </subscription>

Please let me know how to add custom field in this xml so that it automatically get saved in chargify.

Thanks in advance.

1

There are 1 answers

0
Wendy Smoak On BEST ANSWER

This is the format for custom fields in XML:

<subscription>
  <product_handle>monthly-plan</product_handle>
  [...]
  <metafields>
    <color>blue</color>
    <size>large</size>
  </metafields>
</subscription>