Download the PHP package cardtechie/tradingcardapi-sdk-php without Composer

On this page you can find all versions of the php package cardtechie/tradingcardapi-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 tradingcardapi-sdk-php

Trading Card API SDK for PHP

Latest Version on Packagist GitHub Tests Total Downloads

A modern PHP SDK for integrating with the Trading Card API. This Laravel package provides a clean, type-safe interface for accessing trading card data including cards, sets, players, teams, and more.

โœจ Features

๐Ÿ“‹ Requirements

๐Ÿš€ Installation

Install the package via Composer:

Publish the configuration file:

Add your API credentials to your .env file:

๐ŸŽฏ Quick Start

Using the Facade

Using the Helper Function

Error Handling

The SDK provides comprehensive error handling with specific exception classes:

Direct Class Usage

Meta and links

Top-level JSON:API meta and links are document-scoped โ€” they describe the whole response (pagination totals, self/next/prev links). The SDK attaches them to the main parsed object only, and you read them with getMeta() / getLinks():

Included relationship models do not carry the top-level meta/links โ€” calling getMeta() / getLinks() on an included model returns an empty stdClass by design. Document-scoped links describe the main collection, so copying them onto an included resource (e.g. a sideloaded Player) would be misleading.

๐Ÿ‘ฅ Working with Players

The Player resource provides comprehensive CRUD operations and relationship management:

Basic Operations

Listing and Searching

Player Relationships

Creating Player Hierarchies

Working with Deleted Players

Player Model Attributes

๐Ÿ“š Available Resources

The SDK provides access to the following Trading Card API resources:

Resource Description Methods
Cards Individual trading cards get(), create(), update(), delete()
Sets Card sets and collections get(), list(), create(), update(), delete(), checklist($id), workflow($id), addMissingCards($id), addChecklist($request, $id)
Players Player information get(), list(), all(), getList() (deprecated โ€” use all()), create(), update(), delete(), listDeleted(), deleted($id)
Teams Team data get(), list(), all(), getList() (deprecated โ€” use all()), create(), update(), delete(), listDeleted(), deleted($id)
Genres Card categories/types get(), list(), create(), update(), delete(), listDeleted(), deleted($id)
Brands Trading card brands get(), list(), create(), update(), delete()
Manufacturers Trading card manufacturers get(), list(), create(), update(), delete()
Years Trading card years get(), list(), create(), update(), delete()
ObjectAttributes Object attributes get(), list(), create(), update(), delete()
SetSources Set data sources get(), list(), create(), update(), delete(), forSet($setId)
Stats Entity statistics and analytics get($type), getCounts(), getSnapshots(), getGrowth()
Attributes Card attributes get(), list(), all(), create(), update(), delete()
CardImages Card image upload and management list(), get($id), upload($file, $cardId, $imageType), update($id, $attributes), delete($id), getDownloadUrl($id, $size)
Internal\Workflow (internal only) Set workflow management and bulk operations actionableSets(), updateSetTodo($todoId, $attributes), bulkInitializeWorkflow(), getBulkInitializeStatus($jobId), getSetTodos($setId), getReviewQueue($step?, $params?), flagForReview($todoId, $reason), resolveReview($todoId, $notes?)
Internal\AuditLog (internal only) Audit log tracking and creation getAuditLogs($params?), createAuditEvent($attributes?)

Set Names and Serial Suffixes

Set name values returned by the API now include a print-run suffix using hobby convention: /X for numbered sets (e.g. "Black Foil /10") and 1/1 for superfractors (serial = 1). The raw print run is available separately on the int|null $serial attribute, so you can read the formatted name and the numeric serial independently.

Worked examples of the different serial formats:

Stats Resource

The Stats resource provides analytics and tracking capabilities for entity counts:

SetSource Resource

The SetSource resource manages data sources for trading card sets (checklists, metadata, images):

Internal Namespace

Internal use only โ€” not part of the public API contract; may change without semver guarantees.

The Internal\ namespace is intended for internal callers (admin tooling, tradingcardapi-mcp, tradingcardapi-tools). Credentials must carry the internal OAuth scope; calls will fail with a 403 if this scope is absent.

Access the internal client via $api->internal():

Internal\Workflow Resource

The internal Workflow resource manages set workflow steps (todos) and bulk initialization via /internal/* routes:

Internal\AuditLog Resource

The internal AuditLog resource provides access to audit logging endpoints via /internal/* routes:

CardImage Resource

The CardImage resource handles card image uploads and management:

๐Ÿ”ง Configuration

The configuration file (config/tradingcardapi.php) supports:

HTTP Timeouts

By default the SDK applies a 10-second request timeout and a 5-second connect timeout to every request. Guzzle ships with no timeout at all, so without these a hung API would block the calling PHP-FPM worker indefinitely.

Env var Default Meaning
TRADINGCARDAPI_TIMEOUT 10 Total seconds to wait for a response. 0 disables.
TRADINGCARDAPI_CONNECT_TIMEOUT 5 Seconds to wait while establishing the connection. 0 disables.

A connect timeout makes NetworkException::connectionTimeout reachable โ€” it could never fire previously because no timeout was ever set.

Retry / Backoff

Retrying transient failures is opt-in (disabled by default to preserve existing behavior). When enabled, the SDK retries 429 and 5xx responses and connection errors with exponential backoff (base_delay * 2^(attempt-1) ms). If a 429 carries a numeric Retry-After header, that value is honored in preference to the computed backoff.

Env var Default Meaning
TRADINGCARDAPI_RETRY_ENABLED false Enable automatic retries.
TRADINGCARDAPI_RETRY_MAX_ATTEMPTS 3 Max retries after the initial request.
TRADINGCARDAPI_RETRY_BASE_DELAY_MS 1000 Base backoff delay in milliseconds.

OAuth Scopes

Configure the OAuth scopes to request when authenticating. Available scopes:

Examples

Read-only access to published content:

Admin access with full permissions:

Content management (no delete):

Multiple scopes should be separated by spaces. If not specified, the default scope (read:published) is used.

๐Ÿงช Development & Testing

This project uses modern PHP development tools and practices:

Prerequisites

Getting Started

Available Commands

Code Quality Standards

This project maintains high code quality standards:

๐Ÿ“– Documentation

Upgrade Notes (0.3.0)

The 0.3.0 Resource-layer standardization introduces three consumer-visible changes:

๐Ÿค Contributing

We welcome contributions! Open an issue or start a thread in GitHub Discussions before submitting a pull request. See CONTRIBUTING.md for the full contributor guide โ€” development setup, coding standards, testing requirements, the changelog-fragment and pull-request process, and issue reporting.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run quality checks: make check
  5. Submit a pull request

๐Ÿ› Bug Reports & Feature Requests

Please use the GitHub Issues to report bugs or request features.

๐Ÿ”’ Security

Please review our Security Policy for reporting security vulnerabilities.

๐Ÿš€ Release Process

This project uses a sophisticated, automated release management system adapted from the main Trading Card API repository.

Version Management

The SDK uses intelligent, branch-aware semantic versioning:

Development Commands

Automated Release Process

  1. Development: Features are developed on feature branches
  2. Integration: Changes are merged to develop for testing
  3. Release Preparation: Release branches are created for final testing
  4. Production Release: Stable releases are merged to main
  5. Automation: GitHub Actions handles versioning, changelog updates, and Packagist publishing

Cutting a Release

Maintainers: see the Release Runbook for the concrete, step-by-step procedure โ€” how a release is cut, the required repository secrets, how to trigger a release manually via workflow_dispatch, how to verify the GitHub Release and Packagist update, and rollback notes.

See docs/VERSION-MANAGEMENT.md for the underlying versioning model.

๐Ÿ“„ Changelog

See CHANGELOG.md for recent changes.

๐Ÿ‘ฅ Credits

๐Ÿ“œ License

This project is licensed under the MIT License. See LICENSE.md for details.


Made with โค๏ธ by CardTechie


All versions of tradingcardapi-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.5.0
illuminate/contracts Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.13.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 cardtechie/tradingcardapi-sdk-php contains the following files

Loading the files please wait ...