PHP code example of breadhead / paddle

1. Go to this page and download the library: Download breadhead/paddle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

breadhead / paddle example snippets


$api = new \Breadhead\Paddle\Api();
$api->authorizeVendor($vendorId, $vendorAuthCode);

$api->setTimeout(60);

$api = new \Breadhead\Paddle\Api($vendorId, $vendorAuthCode, 60);

// define $vendorId and $vendorAuthCode first
$api = new \Breadhead\Paddle\Api($vendorId, $vendorAuthCode, 60);
$productId = 100;
$licenseCode = $api->generateLicense($productId);

string generateProductPayLink (int $productId, [array $optionalArguments = array()])

string generateCustomProductPayLink (string $title, float $price, string $imageUrl, string $webhookUrl, array $optionalArguments)

string generateLicense (int $productId)

array getProducts ([int $limit = 1], [int $offset = 0])

array generateCustomersReport ([int $productId = null])

array generateLicenseActivationsReport ([int $productId = null], [int $startTimestamp = null], [int $endTimestamp = null])

array generateOrdersReport ([int $productId = null], [int $startTimestamp = null], [int $endTimestamp = null])

array generateSentLicensesReport ([int $productId = null])

array generateAuthCode (string $vendorEmail, string $vendorPassword)

string registerExternalApplication (string $applicationName, string $applicationDescription, string $applicationIconUrl)

string getVendorPublicKey ()