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.

You can do this by generating a unique checkout URL using the Custom Checkout API, passing in prices to override the initial payment.

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.

See how to create a plan here

<?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……."
  }
}

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

Next Steps

Custom Checkout
Some use-cases require advanced functionality that simply isn't available via the dashboard. Custom checkouts allow you to access lots of advanced checkout functionality (such as overriding checkout prices, and splitting transaction earnings between multiple recipients).

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.