Download the PHP package luizsilva-dev/cj-sdk-php without Composer

On this page you can find all versions of the php package luizsilva-dev/cj-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cj-sdk-php

CJ Affiliate SDK for PHP

Latest Stable Version Total Downloads License: MIT PHP Version GitHub Stars

A comprehensive and fully tested PHP SDK for integrating with the CJ Affiliate (Commission Junction) API. Built with Guzzle HTTP client and tested with real CJ credentials to ensure 100% compatibility.

Developed by: Luiz Silva

🚀 Features

⚠️ Important Note About Product Search

CJ Affiliate does not offer a public Product Search API.

After extensive testing with real CJ credentials, we confirmed that:

Solution: Use the Link Search API instead. It returns affiliate links that include product information (names, URLs, commissions, etc.).

See API_CHANGES.md for details.

💻 Requirements

📦 Installation

Via Composer (Recommended)

Manual Installation

Then include in your project:

⚡ Quick Start

1. Get Your CJ API Credentials

  1. Visit CJ Developer Portal
  2. Sign in with your CJ Affiliate credentials
  3. Go to Authentication > Personal Access Tokens
  4. Create a new token
  5. Copy your Personal Access Token
  6. Get your Publisher ID (top right corner in CJ Members portal)
  7. Get your Website ID from Account → Websites

2. Initialize the Client

3. Search Affiliate Links

📖 API Reference

Link Search (Product Information)

The products() method actually uses the Link Search API, which returns affiliate links with product information:

Response:

Advertiser Lookup

Response:

Commission Details

Response:

Program Terms

Promotional Properties

🎯 Examples

See the examples/ directory for complete working examples:

⚙️ Configuration

Caching

Enable caching to reduce API calls:

Debug Mode

Enable debug mode to see request/response details:

Debug logs will be written to PHP's error log.

Timeout

Adjust request timeout:

🚨 Error Handling

The SDK throws CJException for all errors:

Common Errors

Error Cause Solution
HTTP 400 Invalid parameters Check parameter names and values
HTTP 401 Invalid access token Generate a new token at developers.cj.com
HTTP 403 No API access Contact CJ Affiliate support
HTTP 404 Endpoint not found Update SDK to latest version
HTTP 406 Invalid request format Check access token format

🎨 Performance Tips

  1. Enable Caching: Reduces API calls significantly
  2. Batch Requests: Request multiple items in single calls
  3. Pagination: Use records_per_page to limit response size
  4. Filter Results: Use specific parameters to reduce data transfer
  5. Connection Pooling: Reuse the same client instance

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

Development Setup

Running Tests

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

💬 Support

🔗 Useful Links

📝 Changelog

See CHANGELOG.md for a history of changes to this project.

🙏 Acknowledgments


Made with ❤️ by Luiz Silva


All versions of cj-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
ext-xml Version *
ext-simplexml Version *
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package luizsilva-dev/cj-sdk-php contains the following files

Loading the files please wait ...