jeffersongoncalves/laravel-tolt
Laravel integration for the Tolt affiliate and referral platform. This package helps connect your Laravel app to Tolt, making it easier to work with affiliate and referral data, track referrals, and manage Tolt-related functionality from a familiar Laravel codebase.
Architecture fit
This is a thin, domain-specific SDK wrapper: a Laravel service provider, config file, and client classes mapping to Tolt's REST resources (programs, partners, customers, clicks, links, commissions, transactions, promotion codes). Architecturally it belongs in the outbound integration layer of the application — a single Tolt service resolved from the container, consumed by application services (affiliate onboarding, referral attribution, commission reconciliation), not called directly from controllers or models. The resource coverage is broad enough that it can own the entire affiliate domain boundary rather than being a partial helper, which is the main architectural upside. The main fit question is whether the package models affiliate state (partner ↔ customer ↔ commission) or merely proxies HTTP; a pure proxy keeps the package replaceable but pushes all domain modelling, idempotency, and reconciliation logic into our codebase.
Integration feasibility Feasible as a greenfield addition — no schema migration implied, no framework surgery. Integration cost is dominated by three unknowns rather than by code volume: authentication model (single API key vs. OAuth), whether webhooks are supported/first-class, and how pagination and error responses are surfaced (typed exceptions vs. raw arrays). Because the package is new (1.0.0) and its internal API surface is unproven, treat the first integration as an evaluation spike against Tolt's sandbox with a real referral lifecycle (click → link → customer → transaction → commission → promotion code redemption) before committing it to a production revenue path.
Technical risk
Key questions
Stack fit
Assumes a conventional Laravel app on a supported PHP version with Composer and auto-discovery. It slots in as a configured singleton bound via the service provider, with credentials in .env and per-environment program IDs in config/tolt.php. Fits cleanly into an existing queue + scheduler stack: outbound writes (create partner, create transaction) go through queued jobs, reconciliation and commission pulls go through scheduled commands. No conflict expected with existing HTTP clients, cache, or auth.
Migration path No migration required — this is additive. If affiliate functionality is currently manual (spreadsheet tracking, a homegrown cURL client, or platform-native coupon codes), the migration is a behavioural one: backfill existing partners and promotion codes into Tolt, decide the cutover date for attribution, and run parallel tracking (legacy + Tolt) for one to two settlement cycles before trusting commission figures. Historical commission data should be treated as out of scope for automated import in v1.
Compatibility Verify the Laravel/PHP support matrix against our fleet before adoption; also check Guzzle major version alignment and whether the package's dependencies conflict with pinned versions in older services. If we run multiple Laravel versions, adopt only on the newest service first. Confirm the package does not require a specific queue driver or cache store for idempotency; if it does, that constrains deployment topology.
Sequencing
AffiliateGateway interface with the package behind it; typed DTOs at the boundary so the package can be swapped or forked.Maintenance Ongoing cost is low in code terms (one dependency, one config file) but non-zero in tracking terms: we inherit the package's release cadence and must watch for breaking changes in a 1.x line that has no track record. Budget a recurring line item for dependency review plus an annual re-verification against Tolt's API changelog. Forking is a realistic fallback for a package this thin — factor that into the build-vs-buy calculus.
Support Support surfaces are the package maintainer (unknown responsiveness at 1.0.0), Tolt's own support for API behaviour, and our internal on-call. Escalation for "commissions are wrong" lands on us regardless of where the defect originates, so define an internal owner for the affiliate domain before go-live. Document the sandbox access, API version in use, and known API quirks in a runbook.
Scaling Mostly a function of Tolt's API rate limits rather than our infrastructure. Click registration is the highest-volume path and the most latency-sensitive; if clicks are registered server-side per request, that becomes a hard dependency in the request path and a scaling liability. Prefer async click registration with a durable queue, and confirm with Tolt what volume headroom exists. Commission and transaction reads should be incremental (cursor/since-timestamp) and scheduled, not full-table pulls. Multi-program or multi-brand usage likely means multiple client instances — verify that is supported rather than assumed.
Failure modes
Ramp-up For a team already fluent in Laravel and HTTP-client integrations, expect roughly 3–5 days to first productive use, dominated by Tolt's domain model (how partners, customers, links, and commissions interrelate) rather than by the package's API. Add 1–2 weeks for the reconciliation harness and runbook, which are the actual determinants of success. Front-load a written domain primer — the eight resource types imply a stateful lifecycle that a 1.0.0 README is unlikely to explain end-to-end, and misunderstandings there produce financial discrepancies rather than build errors.
How can I help you explore Laravel packages today?