Zoho subscription API to WordPress [closed]

If you believe that there won’t be frequent changes to the plans and
addons, you can hard code the HTML pages displaying the plans and
addons for your customer to select.

Once the customer selects the plans and addons, you can use the Plan Specific URL in to embed the Zoho Subscriptions’ checkout page.

https://subscriptions.zoho.com/subscribe/{{encryptedID}}/{{plan_code}}

Note that this encryptedID will be same for all the plans in an organization.

If you want to add addons to this page, you can simply append them as parameters.

https://subscriptions.zoho.com/subscribe/3b884751f87f05e584c3952b6388e7f96a2bba0f6b0532177e00f0ba8db832fc/mnthly-essential?addon_code[0]=wiki&addon_quantity[0]=2&addon_code[1]=chat&addon_quantity[1]=1

You can refer this Help Documentation for a detailed explanation.

Or, if you want to use the API for displaying the plans or if you have
custom requirements which cannot be achieved using Plan Specific URLs,
follow the below-mentioned steps.

You can use the Plan List API of Zoho Subscriptions to list the plans for your customer to select.

$headers = array('X-com-zoho-subscriptions-organizationid' => $organization_id , 'Authorization' => 'Zoho-authtoken '.$authtoken);

wp_remote_get("https://subscriptions.zoho.com/api/v1/plans", array('headers' => $headers));

Once the customer selects the plan, you can use the Addon List API with plan_code as a parameter to get all the addons associated with the selected plan.

wp_remote_get("https://subscriptions.zoho.com/api/v1/addons?plan_code=".$code, array('headers' => $headers));

Once you collect all the order details, you can use Hosted Page API for creating a subscription to retrieve the URL to be embedded in your checkout page to collect the customer information and payment information.

$headers = array('Content-Type' => 'application/json;charset=UTF-8', 'X-com-zoho-subscriptions-organizationid' => $organization_id , 'Authorization': 'Zoho-authtoken '.$authtoken);

$body = array('plan' => array('plan_code' => 'basic-monthly',  'price' => 400, 'quantity' => 1 ), 'addons' => array(...) );

wp_remote_post("https://subscriptions.zoho.com/api/v1/hostedpages/newsubscription", array('headers' => $headers, 'body' => $body));


```Request Example in JSON
    {
       "plan": {
        "plan_code": "basic-monthly",
        "price": 400,
        "quantity": 1
      },
      "addons": [
          {
            "addon_code": "Email-basic",
            "price": 50,
            "quantity": 5
          }
      ]
    }

You can also pass the customer details to this API if you want to collect only the payment information using Zoho Subscriptions’ checkout page.

You can also refer the API documentation of Zoho Subscriptions or write to us at support[at]zohosubscriptions[dot]com.