amocrm/amocrm-api-library
Official PHP SDK for integrating with amoCRM. It handles OAuth 2.0 authentication, REST API requests, entities such as leads and contacts, custom fields, and webhooks, with client and model classes that simplify building CRM integrations.
Architecture fit
amocrm-api-php), MIT-licensed, distributed as a Composer package. This is the "blessed path" rather than a community wrapper — the strongest argument for adoption.league/oauth2-client), an HTTP abstraction (AmoCRM\HttpClient interface with a bundled Guzzle adapter), and a domain layer (models, collections, filters, query builders, custom-field entities, webhook/chat API helpers). That separation is what makes it viable inside Laravel — the HTTP layer is swappable, so we can route calls through Laravel's HTTP client for logging, retries, and tracing without forking.app/AmoCRM or an internal acme/laravel-amocrm) of roughly 400–800 LOC, not for "just composer require and go."TokenInterface implementation, and refresh-token rotation is a first-class concern. In a Laravel app this means the integration has a persistence requirement from day one — plan an amocrm_tokens table with encrypted casts, not a .env variable.Integration feasibility
custom_fields_values are keyed by field ID, not code — IDs differ per account, so field mapping must be configuration, never hardcoded).Retry-After. Every write path needs to go through a queued, rate-limited job. This is an architectural constraint to state up front, not a tuning detail.Technical risk
~3.x with a committed lockfile, and treat library upgrades as scheduled work with an integration-test gate.Key questions
Stack fit
acme/laravel-amocrm package with a service provider that binds AmoCRM\AmoCRM\Client\AmoCRMApiClient (or its factory) as a singleton, publishes config/amocrm.php (subdomain, client id/secret, redirect URI, base domain for the RU/COM/KZ zones), and registers the token store.TokenInterface against an Eloquent model with encrypted casts and an observer that records rotations. Wrap refreshAccessToken() in Cache::lock().Http facade (Http::withToken(...)->asJson() via a small adapter class) so every call lands in our logs and tracing. Keep Guzzle as the fallback if the adapter proves fiddly.Migration path
dotmailer-era wrapper), the migration is: run both in parallel read-only, diff outputs for 1–2 weeks, then cut writes over.Compatibility
Sequencing (suggested delivery slices)
/account in staging.Slice 1–2 is the realistic "prove it" phase; slices 3–4 are where scope creeps. Do not start at 4.
Maintenance
Support
Scaling
Failure modes (ranked by blast radius)
Ramp-up
leads and contacts responsibilities), which no library teaches.How can I help you explore Laravel packages today?