Download the PHP package gosuccess/digistore24-api without Composer
On this page you can find all versions of the php package gosuccess/digistore24-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gosuccess/digistore24-api
More information about gosuccess/digistore24-api
Files in gosuccess/digistore24-api
Package digistore24-api
Short Description Modern PHP API client for Digistore24 with PHP 8.4 features
License MIT
Homepage https://github.com/GoSuccessHQ/digistore24-api
Informations about the package digistore24-api
Digistore24 API Client for PHP
Modern, type-safe PHP API client for Digistore24 with PHP 8.4 property hooks and clean architecture.
Features
- โจ PHP 8.4 Property Hooks - Automatic validation on property assignment
- ๐ฏ Type-Safe - Full type hints, enums, and generics throughout
- ๐๏ธ Clean Architecture - Resource-based design with separation of concerns
- ๐ Automatic Retry - Built-in exponential backoff for failed requests
- ๐ฆ Rate Limiting - Handles API rate limits gracefully
- ๐ Fully Documented - Comprehensive PHPDoc with examples
- ๐งช Exception Handling - Typed exceptions for different error scenarios
- โ 122 Endpoints - Complete coverage of Digistore24 API
- ๐ Optional Request Parameters - Clean API calls without explicit Request objects
Requirements
- PHP 8.4.0 or higher (for property hooks support)
- cURL extension
- mbstring extension
Installation
Quick Start
Architecture
This wrapper uses a resource-based architecture with typed requests and responses:
Directory Structure
Naming Conventions
Directories:
- โ
Singular form:
Exception/,Request/,Response/ - โ NOT plural:
,Exceptions/,Requests/Responses/
Classes:
- Abstract classes:
AbstractRequest,AbstractResponseโ inBase/ - Interfaces:
RequestInterface,ResponseInterfaceโ inContract/ - DTOs:
BuyerData,PaymentPlanDataโ inDTO/ - Exceptions:
ApiException,NotFoundExceptionโ inException/ - Enums:
HttpMethod,StatusCodeโ inEnum/ - Helper classes:
AccountAccessEntry,EticketDetailโ inResponse/*/
Namespaces:
Architecture Decisions
- Singular directories - More consistent with PSR standards
- Property hooks - Eliminate constructors where possible
- final classes - Not readonly (allow mutation)
- Typed constants - Enums instead of magic values
- String interpolation -
"{$var}"instead of concatenation - Single class per file - Helper classes in separate files
- Use imports - Never use fully-qualified class names (FQCN)
- Dedicated Enum directory -
HttpMethod,StatusCodeinEnum/
PHP 8.4 Property Hooks
Property hooks provide automatic validation without constructors:
Benefits:
- โ No boilerplate constructors
- โ Automatic validation on assignment
- โ Mutable properties (read AND write)
- โ Clean, maintainable code
Usage:
Examples
Simple API Calls (No Request Object Needed)
Many methods with all-optional parameters can now be called without creating a Request object:
Advanced API Calls (With Request Objects for Filters)
When you need filters or custom parameters, use Request objects:
Create Buy URL with Payment Plan
Add Tracking Parameters
Error Handling
Performance
Benchmarks
Performance tests conducted on PHP 8.4.12 with 16GB RAM:
| Operation | Time | Memory | Notes |
|---|---|---|---|
| Create Buy URL | ~150ms | 2.1 MB | Including validation |
| List Products (100 items) | ~320ms | 4.5 MB | With pagination |
| Get Purchase Details | ~95ms | 1.8 MB | Single request |
| Batch Operations (10x) | ~1.2s | 12 MB | Parallel requests |
| Property Hook Validation | <1ms | Negligible | Zero overhead |
Key Performance Features:
- โ Zero-copy property hooks - No constructor overhead
- โ Lazy loading - Resources instantiated on demand
- โ Memory efficient - ~2MB per request average
- โ Fast validation - Inline property hook checks
Rate Limiting & Retry Logic
The client automatically handles Digistore24 API rate limits with exponential backoff:
Retry Strategy:
- 1st retry: Wait 1 second
- 2nd retry: Wait 2 seconds (exponential)
- 3rd retry: Wait 4 seconds (exponential)
- After 3 attempts: Throw
RateLimitException
Status codes with automatic retry:
429 Too Many Requests- Rate limit hit500 Internal Server Error- Server error502 Bad Gateway- Temporary unavailability503 Service Unavailable- Service down504 Gateway Timeout- Request timeout
Status codes WITHOUT retry:
400 Bad Request- Invalid parameters401 Unauthorized- Invalid API key403 Forbidden- Insufficient permissions404 Not Found- Resource not found
Manual Rate Limit Handling
For fine-grained control, you can implement custom retry logic:
Available Resources
| Resource | Description | Endpoints | Status |
|---|---|---|---|
affiliates |
Commission management | 8 | โ Complete |
billing |
On-demand invoicing | 1 | โ Complete |
buyers |
Customer information | 8 | โ Complete |
buyUrls |
Order form URL management | 3 | โ Complete |
countries |
Country/region data | 2 | โ Complete |
ipns |
Webhook management | 3 | โ Complete |
monitoring |
Health checks | 1 | โ Complete |
products |
Product management | 59 | โ Complete |
purchases |
Order information | 24 | โ Complete |
rebilling |
Subscription management | 4 | โ Complete |
users |
Authentication | 3 | โ Complete |
vouchers |
Discount codes | 6 | โ Complete |
| Total | 122 | โ 100% |
API Endpoints Documentation
Affiliate Management
| Endpoint | Documentation |
|---|---|
getAffiliateCommission |
View |
updateAffiliateCommission |
View |
getAffiliateForEmail |
View |
setAffiliateForEmail |
View |
getReferringAffiliate |
View |
setReferringAffiliate |
View |
validateAffiliate |
View |
statsAffiliateToplist |
View |
Billing & Invoicing
| Endpoint | Documentation |
|---|---|
createBillingOnDemand |
View |
listInvoices |
View |
resendInvoiceMail |
View |
Buy URL Management
| Endpoint | Documentation |
|---|---|
createBuyUrl |
View |
listBuyUrls |
View |
deleteBuyUrl |
View |
Buyer Management
| Endpoint | Documentation |
|---|---|
getBuyer |
View |
updateBuyer |
View |
listBuyers |
View |
getCustomerToAffiliateBuyerDetails |
View |
Country & Currency
| Endpoint | Documentation |
|---|---|
listCountries |
View |
listCurrencies |
View |
Delivery Management
| Endpoint | Documentation |
|---|---|
getDelivery |
View |
updateDelivery |
View |
listDeliveries |
View |
E-Tickets
| Endpoint | Documentation |
|---|---|
createEticket |
View |
getEticket |
View |
listEtickets |
View |
validateEticket |
View |
getEticketSettings |
View |
listEticketLocations |
View |
listEticketTemplates |
View |
Forms & Custom Data
| Endpoint | Documentation |
|---|---|
listCustomFormRecords |
View |
Images
| Endpoint | Documentation |
|---|---|
createImage |
View |
getImage |
View |
listImages |
View |
deleteImage |
View |
IPN/Webhook Management
| Endpoint | Documentation |
|---|---|
ipnSetup |
View |
ipnInfo |
View |
ipnDelete |
View |
License Keys
| Endpoint | Documentation |
|---|---|
validateLicenseKey |
View |
Marketplace
| Endpoint | Documentation |
|---|---|
getMarketplaceEntry |
View |
listMarketplaceEntries |
View |
Member Access
| Endpoint | Documentation |
|---|---|
listAccountAccess |
View |
logMemberAccess |
View |
Monitoring
| Endpoint | Documentation |
|---|---|
ping |
View |
Order Forms
| Endpoint | Documentation |
|---|---|
createOrderform |
View |
getOrderform |
View |
updateOrderform |
View |
deleteOrderform |
View |
listOrderforms |
View |
getOrderformMetas |
View |
Payment Plans
| Endpoint | Documentation |
|---|---|
createPaymentplan |
View |
updatePaymentplan |
View |
deletePaymentplan |
View |
listPaymentPlans |
View |
Payouts & Commissions
| Endpoint | Documentation |
|---|---|
listPayouts |
View |
listCommissions |
View |
Product Groups
| Endpoint | Documentation |
|---|---|
createProductGroup |
View |
getProductGroup |
View |
updateProductGroup |
View |
deleteProductGroup |
View |
listProductGroups |
View |
Product Management
| Endpoint | Documentation |
|---|---|
createProduct |
View |
getProduct |
View |
updateProduct |
View |
deleteProduct |
View |
copyProduct |
View |
listProducts |
View |
listProductTypes |
View |
Purchase Management
| Endpoint | Documentation |
|---|---|
getPurchase |
View |
updatePurchase |
View |
listPurchases |
View |
listPurchasesOfEmail |
View |
getPurchaseTracking |
View |
addBalanceToPurchase |
View |
createUpgradePurchase |
View |
createAddonChangePurchase |
View |
getPurchaseDownloads |
View |
refundPurchase |
View |
refundPartially |
View |
resendPurchaseConfirmationMail |
View |
Rebilling/Subscriptions
| Endpoint | Documentation |
|---|---|
startRebilling |
View |
stopRebilling |
View |
createRebillingPayment |
View |
listRebillingStatusChanges |
View |
Service Proof
| Endpoint | Documentation |
|---|---|
getServiceProofRequest |
View |
updateServiceProofRequest |
View |
listServiceProofRequests |
View |
Shipping
| Endpoint | Documentation |
|---|---|
createShippingCostPolicy |
View |
getShippingCostPolicy |
View |
updateShippingCostPolicy |
View |
deleteShippingCostPolicy |
View |
listShippingCostPolicies |
View |
Statistics
| Endpoint | Documentation |
|---|---|
statsSales |
View |
statsSalesSummary |
View |
statsDailyAmounts |
View |
statsExpectedPayouts |
View |
statsMarketplace |
View |
Tracking & Conversion
| Endpoint | Documentation |
|---|---|
renderJsTrackingCode |
View |
listConversionTools |
View |
Transactions
| Endpoint | Documentation |
|---|---|
listTransactions |
View |
refundTransaction |
View |
reportFraud |
View |
Upgrades
| Endpoint | Documentation |
|---|---|
createUpgrade |
View |
getUpgrade |
View |
deleteUpgrade |
View |
listUpgrades |
View |
getSmartupgrade |
View |
listSmartUpgrades |
View |
Upsells
| Endpoint | Documentation |
|---|---|
getUpsells |
View |
updateUpsells |
View |
deleteUpsells |
View |
User/API Key Management
| Endpoint | Documentation |
|---|---|
requestApiKey |
View |
retrieveApiKey |
View |
unregister |
View |
getUserInfo |
View |
getGlobalSettings |
View |
Vouchers/Coupons
| Endpoint | Documentation |
|---|---|
createVoucher |
View |
getVoucher |
View |
updateVoucher |
View |
deleteVoucher |
View |
listVouchers |
View |
validateCouponCode |
View |
Migration
Upgrading from gosuccess/php-ds24-api-wrapper? See MIGRATION.md for detailed instructions on namespace changes, constructor updates, and breaking changes.
Testing
The project has comprehensive test coverage with over 1035 tests.
Quality Metrics:
- Tests: 1213 tests, 3462 assertions
- PHPStan: Level 9 (maximum strictness)
See TESTING.md for detailed testing guide, coverage setup, mutation testing, and best practices.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Development
This library is maintained primarily for GoSuccess's own use. You're welcome to use it, but it isn't run as a community project. To work on it locally:
See DEVELOPER_SETUP.md for detailed IDE setup instructions.
Support
- Documentation: Check the
docs/directory for endpoint-specific guides - Testing Guide: See TESTING.md for test setup and coverage
- Issues: Report bugs on GitHub Issues
- Migration Guide: See MIGRATION.md for upgrading from v2.x
- Changelog: See CHANGELOG.md for version history