Set up paid trials

Trials are normally used to offer users the opportunity to test products, free of charge, for a limited number of days. At the end of the trial period, we will automatically charge the payment method the user provided upon signing up.

By default when you enable the trial feature on a subscription plan it will be a free trial, but if you wish to charge for the trial you can do so by overriding the initial checkout price.

Trial Example

Let’s say you want to create a $50 monthly subscription plan with a trial period of 10 days and charge $9.99 for that trial period.

First you’ll need to create the subscription plan with a 10 day trial period. See how to create a plan here

Using paddle.js

  • If using paddle.js you’ll need the following to be able to override the checkout price:
  • The amount you wish to override the product to (in the plan base currency), which in this case will $9.99.
  • The “Checkout Secret Key” for the product. (This can be found by clicking on the ‘Checkout Link’ button next to the Product/Subscription in your Paddle Dashboard).
  • The Auth code, simply MD5 hash the new product price with the ‘Checkout Secret Key’ from your dashboard above.
<script type="text/javascript">
  Paddle.Checkout.open({
    product: 1234567,
    price: 9.99,
    auth: 'c91d2e54d5c85970a9c3e5c146f0d053'
});
</script>

Note: You can find the Subscription ID by clicking the Checkout Link button in your Seller Dashboard and copying the Checkout Product ID number.

If you wish to use buttons and checkout links, please have look at the complete price override documentation here.

Using the Custom Checkout API

<?php
$data['vendor_id'] = 123;
	$data['vendor_auth_code'] = '456bd...';
	$data['product_id'] = 1234567;
    $data['prices'] = ['USD:9.99'];
	$data['custom_message'] = '100% Money Back Guarantee!';
	$data['return_url'] = 'http://mysite.com/thanks';
	
// Here we make the request to the Paddle API
	$url = 'https://vendors.paddle.com/api/2.0/product/generate_pay_link';
	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
	$response = curl_exec($ch);		

// And handle the response...
	$data = json_decode($response);	
	if($data->success) {
      echo "Success! Checkout URL:".$data->response->url;
    } 	
	else {
      echo "Your request failed with error: ".$data->error->message;
    }
?>

Bash Example


curl -X POST 
	-d 'vendor_id=123'
	-d 'vendor_auth_code=456bd...'
	-d 'product_id=456bd...'
	-d 'prices[0]=USD:9.99'
	-d 'custom_message=100% Money Back Guarantee!'
	-d 'return_url=http://mysite.com/thanks'
https://vendors.paddle.com/api/2.0/product/generate_pay_link

Example Response


{  
  "success": true,
  "response": {      
    "url": "https://checkout.paddle.com/checkout/custom/eyJ0IjoiUHJvZ……."
  }
}

You can find the complete custom checkout API documentation here

Questions about Paddle?

If you need any help regarding your Paddle integration, please get in touch with our Customer Success team using the form below.