Tutorial 2 - Creating Offers

In previous tutorial Protect your content, you learned how to implement PHP SDK and how protect your content. In this tutorial, you will take the last basic step to sell your content.

If you want to sell anything with Cleeng, you have to describe it, give it a name, price etc. You have to create an offer.

What is Cleeng offer ?

Get Offer Id

Combine everything

Testing payment

1. What is Cleeng offer?

Every user before purchasing your content, has to know precisely what this is about. So if you want to sell with Cleeng, you have to describe it, give a name, set a price, choose type of an offer etc. More info about parameters connected with the offer that we allow to change you can find in Offer API.

After purchasing user has access to every offer with tag included in accessToTags array parameter.Example: "Get unlimited access to all tutorials. Subscribe for only $49/month."Learn more about Subscriptions

After purchasing user has access to every offer with tag included in accessToTags array parameter.Example: "Buy Pass for one month access to all tutorials."Learn more about Passes

This tutorial will be based on Rental Offers.

2. Get Offer Id

2.1 Implementation

This is the second tutorial, so probably you have example files. If not, please download it and place them on your server.

Remember, you have to open publisher account first. All the information about further actions, you can find in Tutorials

Then, get a publisher token. Section 2.2.1 below shows how to use this token.

2.2 Creating offer

In the first tutorial, we described how you can protect your content. As you probably remember, we've been working on default offer. Right now, we are going to create our own offer.

Please open create_offer.php. This file will use Cleeng API to create new rental offer, then it will print offerId on your screen. This offerId you can use later in
purchase.php as we did with default offer id in Tutorial 1.

3. Combine everything.

At this time in purchase.php you have to set offer ID, which you get from point 2.

e.g. $offerId = 'R688881907_NL';

You are now ready to protect and sell digital content from your own website!

4. Testing payment

During testing, as you probably can see, you can't complete you purchase unless you pay with real money. In Tutorial How to use Cleeng sandbox, you can read how to use Sandbox to test payment and be able to finish the purchase process.