Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Brevo Php Laravel Package

getbrevo/brevo-php

Legacy (v1.x) PHP SDK for Brevo API v3, auto-generated from OpenAPI/Swagger. Supports PHP 5.6+ and provides wrappers for Brevo features (email, contacts, campaigns, etc.). Maintained for critical security fixes only; migrate to brevo-php v4.

View on GitHub
Deep Wiki
Context7
v4.0.16

Fixed

  • CreateBatchOrderResponse::$batchId now deserializes correctly. The createBatchOrder endpoint returns the batch id as batch_id (snake_case), but the SDK looked for batchId, leaving it unset and throwing Cannot assign null to property ...::$batchId of type float on every call. The wire mapping is corrected to batch_id and the property is now nullable (?float). The $response->batchId accessor is unchanged.

Backward-compatible patch release. No breaking changes.

v4.0.15

Fixed

  • GetCampaignStats count fields are now nullable (?int): clickers, complaints, delivered, hardBounces, sent, softBounces, trackableViews, uniqueClicks, uniqueViews, unsubscriptions, viewed. This model is reused for statsByDomain on getEmailCampaign(s), where per-domain rows are sparse and the API returns null/absent for some counts. The previous non-nullable typing threw a TypeError while deserializing statsByDomain (globalStats was unaffected). (#138)

Backward-compatible patch release. No breaking changes.

v4.0.14

Fixed

  • senderEmail is now nullable (?string) on GetTransacBlockedContactsResponseContactsItem; the API returns null for some blocked or unsubscribed contacts (#137)
  • campaignId is now nullable (?int) on both UserUnsubscription item classes; form based unsubscriptions return null (#136)
  • Guzzle timeout support now works: interface_exists replaces class_exists for GuzzleHttp\ClientInterface, so the timeout option is honored (#133)

Backward compatible patch release. No breaking changes.

v5.0.0-rc.1

v5.0.0-rc.1

Release candidate for the v5 line. This pre-release is published so adopters can validate the new surface against their integrations before v5.0.0 is tagged stable. It is not picked up by composer update automatically — opt in explicitly (see Installing this RC below).

If no blocking issues surface within the soak window, this build will be promoted to v5.0.0 unchanged.

composer require getbrevo/brevo-php:^5.0.0@RC

Status

  • Stability: RC — API surface is frozen. Only critical regressions discovered during soak will be patched into an RC.2.
  • v4.x: remains supported and continues to receive wire-compatibility fixes.
  • Feedback welcome: please open an issue against getbrevo/brevo-php if you hit anything unexpected during migration. Tag with v5-rc.

Why this release

Most of the breaking changes in v5 come from an internal effort at Brevo to make our API endpoints, parameters and models more self-descriptive. The goal is to make the public surface easier to read at a glance — both for developers and for AI agents working against the Brevo API — so that names, shapes and required fields convey intent without needing to cross-reference external docs. Concretely, this means consistent parameter naming, payload wrappers that reflect what the endpoint actually does (e.g. CreateBatchEventsRequest), filter keys that match the wire format, model fields renamed or removed where the previous names were ambiguous, and tightened types (DateTime instead of string for dates, typed unions instead of generic arrays) so static analysis catches mistakes earlier.

We're aware that renaming costs callers a one-time migration, and we've kept v4.x supported so you can adopt v5 on your own timeline.

⚠️ Breaking changes

Companies — GetCompaniesRequest::filters renamed

  • filters is renamed to filtersAttributesName to match the wire format.
  • Existing code passing 'filters' => ... does not throw, but the filter is silently ignored server-side and the response is unfiltered. Audit every call site.

Events — Event::createBatchEvents payload shape changed

  • First argument changed from array to a CreateBatchEventsRequest wrapper.

Balance — getActiveBalancesApi response shape changed

  • Return type changed from ?BalanceLimit to ?GetLoyaltyBalanceProgramsPidActiveBalanceResponse (different shape).

Balance — getContactBalances requires balanceDefinitionId

  • $request no longer defaults to empty; balanceDefinitionId is required.

Balance — BeginTransactionRequest::eventTime type tightened

  • Type changed from ?string to ?DateTime. ISO strings now cause TypeError.

CRM — Tasks::getAllTaskTypes returns an array

  • Return type changed from ?GetCrmTasktypesResponse (wrapper) to ?array<GetCrmTasktypesResponseItem>.

Email campaigns — utmIdActive renamed

  • EmailCampaigns\GetEmailCampaignResponse::utmIdActive renamed to utmId (wire key utmIDActiveutmID, type ?bool?int).
  • Same change on GetEmailCampaignsResponseCampaignsItem.

Model fields removed

  • GetAccountResponse::dateTimePreferences
  • Webhook::channel
  • GetProcessResponseInfo::export
  • GetProcessResponse::error, ::createdAt, ::completedAt
  • Several ExternalFeeds response fields

Model field types tightened

  • Process\GetProcessResponseInfoImport count fields changed from ?int to ?string (now URLs to CSV reports) — affects invalidEmails, duplicateContactId, duplicateExtId, and others.
  • Ecommerce\CreateUpdateProductResponse::id and CreateUpdateCategoryResponse::id: ?int?string.
  • Several string date fields tightened to ?DateTime (Program::*, Reward::*, BalanceLimit::createdAt/updatedAt).

Model fields renamed

  • ConversationsMessageAttachmentsItem::fileNamename, ::inlineIdlink.

Custom objects — associations union flattened

  • UpsertrecordsRequestRecordsItemAssociationsItem is now a single class with an action: 'link' | 'unlink' discriminator. 7 old variant classes have been deleted.

Added

  • New optional fields and filters across contacts->createContact, contacts->updateContact, emailCampaigns->getEmailCampaigns, ecommerce->getProducts, and several other endpoints.
  • Tier groups support upgrade and downgrade schedule fields.

Installing this RC

Composer only installs RC builds when you ask for them explicitly. Either:

composer require getbrevo/brevo-php:^5.0.0@RC

Or set minimum-stability in your composer.json:

{
  "minimum-stability": "RC",
  "prefer-stable": true,
  "require": {
    "getbrevo/brevo-php": "^5.0"
  }
}

When v5.0.0 ships stable, composer update will swap this RC for the stable release automatically.

Holding on v4.x

If you're not ready to migrate, pin to v4:

composer require getbrevo/brevo-php:^4.0

Migration

See the Upgrading from v4.x guide for full migration details.

Documentation

v4.0.13

v4.0.13

Bug fixes

getProcess / getProcesses — deserialization failure on completed processes (#121)

  • $duplicateEmailId was typed as ?int, but the API returns a URL string pointing to a CSV file of duplicate IDs.
  • It is now typed as ?string.

getProcess / getProcesses — unknown status in_process (#122)

  • The API still returns the legacy in_process value (v3 name for processing).
  • GetProcessResponseStatus and GetProcessesResponseProcessesItemStatus now include InProcess = "in_process", so deserialization no longer throws on active processes.

createEvent / createBatchEvents — boolean values rejected in contactProperties (#123)

  • contactProperties and eventProperties only accepted string|int.
  • Boolean values (e.g. 'MY_FLAG' => true) now serialize correctly.

createContact / updateContact — integer values rejected in attributes (#124)

  • attributes values were typed as float|string|bool|array.
  • Passing a plain PHP int (e.g. 'OFFICE_ID' => 1234) now works without casting to (float).
v4.0.12

Summary

Resolved a field naming mismatch in the /orders/status/batch API response to align the implementation with the public contract.

Issue

During investigation of an L3 issue, a discrepancy was identified between the Swagger contract and the actual API response: • Contract (Swagger): batchId (camelCase) • Implementation: batch_id (snake_case)

This inconsistency caused misalignment with client expectations and SDK behavior.

Fix • Updated the response format to use batchId (camelCase) as defined in the Swagger specification. • Ensured consistency across API responses and documentation.

v4.0.11

What's Changed

New features

Events

  • Added getEvents() — retrieve a paginated list of custom events, filterable by contactId, eventName, objectType, startDate, and endDate.
    Supports limit (default 100, max 10,000) and offset for pagination.
    Note: currently only supports custom events.
  • Added createBatchEvents() — create multiple events in a single request using an array of CreateBatchEventsRequestItem. Returns a BatchAcceptedResponse.

Ecommerce

  • CreateUpdateProductRequest and batch product upsert now accept two new optional fields: brand and description.

Balance

  • getActiveBalancesApi() now accepts includeInternal to include balances tied to internal definitions.
  • getContactBalances() and getSubscriptionBalances() now accept a request object with an includeInternal parameter.
  • getTransactionHistory() now supports filtering by status (draft, completed, rejected, cancelled, expired) and transactionType (credit, debit).
  • createBalanceDefinition() and updateBalanceDefinition():
    • the meta field is now a typed object (isInternal: bool) instead of a generic key-value array.

CRM

  • Added PatchCrmAttributesIdRequest to update CRM attribute labels and selectable option labels.

Changes

Ecommerce

  • metaInfo size limit for products clarified: maximum 20,000 characters total (previously documented as 1,000 KB / max 20 items).

Account

  • users field on plan verticals is now nullable.

Bug fixes

  • createContact() no longer throws a BrevoException
  • Checks if the response body is empty and returns null instead of trying to deserialize it
  • Only calls CreateContactResponse::fromJson($json) when there's actual content
v4.0.10

v4.0.10

Added

  • Batch events endpoint$client->event->createBatchEvents() to track multiple contact interactions in a single request
  • Email campaign excludeHtmlContent parametergetEmailCampaign() accepts a new optional flag to omit the HTML body from the response, reducing payload size

Fixed

  • Boolean attributes serializationUpdateContactRequest and CreateContactRequest now correctly serialize boolean values in union-typed attribute maps (float | string | bool | array). Previously threw JsonException: Cannot serialize value of type boolean
  • Order::products item typeOrderProductsItem now correctly exposes all product fields: price, productId, variantId, quantity, quantityFloat. Previously only quantity was accessible
  • GetCampaignStats nullable fieldsappleMppOpens and opensRate are now correctly typed as nullable (?int, ?float), preventing TypeError when the API returns null

Deprecated

  • sendTransacSms() — Use sendAsyncTransactionalSms() instead. The synchronous method is deprecated. Note: remainingCredits is intentionally not returned by the async endpoint; use the account endpoints to retrieve credit balance

Internal

  • Generator updated from 2.1.42.1.10
  • Fern CLI updated from 3.91.24.22.0
v4.0.7

What's Changed

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v4.0.6...v4.0.7

v4.0.6

What's Changed

Introduction of loyalty endpoint to delete member subscription.

New Contributors

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v4.0.5...v4.0.6

v4.0.5

📦 Brevo PHP SDK v4.0.5

Modernized, type-safe rewrite of the Brevo PHP client with a unified client architecture, PSR-18 compatibility, and built-in reliability features.


🚀 Highlights

  • Type-safe SDK with strongly typed request/response objects and PHPDoc annotations
  • Single unified client (Brevo) replaces multiple API classes and manual configuration
  • Built-in retries + timeouts
  • Structured error handling
  • PSR-18 compatible — works with Guzzle, Symfony HttpClient, or any PSR-18 implementation
  • PHP 8.1+ with support for Laravel, Symfony, and plain PHP
  • Legacy v2.x now maintenance-only

⚠️ Breaking Changes

This is a full rewrite of the SDK. v4.0.5 is not backwards compatible with v2.x.

Key breaking changes:

  • The multi-class initialization pattern (Configuration::getDefaultConfiguration() + per-API class instantiation) is replaced by a single Brevo client
  • Setter-based request building (e.g., $message->setSubject(...)) is replaced by typed request objects with named constructors
  • Error handling now uses BrevoApiException / BrevoException instead of Guzzle-specific exceptions
  • The SDK now requires PHP 8.1+ (previously PHP 7.x)
  • PSR-18 HTTP client replaces the hard Guzzle dependency

The legacy v2.x SDK will continue to receive critical security updates but no new features. We strongly recommend migrating to v4.x.


Added

New Client Architecture

  • Introduced Brevo as the single entry point
  • Namespaced API clients (e.g., $brevo->transactionalEmails->*, $brevo->contacts->*)
  • 30+ resource clients accessible from one instance: contacts, deals, campaigns, ecommerce, webhooks, and more

Type Safety

  • Strongly typed request and response classes for every endpoint
  • Full PHPDoc annotations for IDE autocomplete
  • Named constructors with typed arrays replace untyped setters

Reliability Features

  • Automatic retries with exponential backoff and jitter (~1s, ~2s, ~4s)
  • Honors Retry-After headers on rate-limited responses
  • Configurable global and per-request timeouts (default: 60s)
  • Retryable status codes: 408, 429, 500, 502, 503, 504

Error Handling

  • BrevoApiException for all non-2xx API responses with:
    • getCode() — HTTP status code
    • getMessage() — error message
    • getBody() — parsed error response body
  • BrevoException as a base for all SDK-level errors
  • Clean try/catch branching by status code

Advanced Configuration

  • Custom PSR-18 HTTP client support (Guzzle, Symfony HttpClient, etc.)
  • Custom headers at client and per-request level
  • Configurable base URL
  • Binary response support for file downloads

Runtime Compatibility

  • PHP 8.1+
  • Laravel
  • Symfony
  • Any framework or plain PHP project with Composer

Read more at https://developers.brevo.com/docs/api-clients/php

v4.0.3

📦 Brevo PHP SDK v4.0.3

Modernized, type-safe rewrite of the Brevo PHP client with a unified client architecture, PSR-18 compatibility, and built-in reliability features.


🚀 Highlights

  • Type-safe SDK with strongly typed request/response objects and PHPDoc annotations
  • Single unified client (Brevo) replaces multiple API classes and manual configuration
  • Built-in retries + timeouts
  • Structured error handling
  • PSR-18 compatible — works with Guzzle, Symfony HttpClient, or any PSR-18 implementation
  • PHP 8.1+ with support for Laravel, Symfony, and plain PHP
  • Legacy v2.x now maintenance-only

⚠️ Breaking Changes

This is a full rewrite of the SDK. v4.0.3 is not backwards compatible with v2.x.

Key breaking changes:

  • The multi-class initialization pattern (Configuration::getDefaultConfiguration() + per-API class instantiation) is replaced by a single Brevo client
  • Setter-based request building (e.g., $message->setSubject(...)) is replaced by typed request objects with named constructors
  • Error handling now uses BrevoApiException / BrevoException instead of Guzzle-specific exceptions
  • The SDK now requires PHP 8.1+ (previously PHP 7.x)
  • PSR-18 HTTP client replaces the hard Guzzle dependency

The legacy v2.x SDK will continue to receive critical security updates but no new features. We strongly recommend migrating to v4.x.


Added

New Client Architecture

  • Introduced Brevo as the single entry point
  • Namespaced API clients (e.g., $brevo->transactionalEmails->*, $brevo->contacts->*)
  • 30+ resource clients accessible from one instance: contacts, deals, campaigns, ecommerce, webhooks, and more

Type Safety

  • Strongly typed request and response classes for every endpoint
  • Full PHPDoc annotations for IDE autocomplete
  • Named constructors with typed arrays replace untyped setters

Reliability Features

  • Automatic retries with exponential backoff and jitter (~1s, ~2s, ~4s)
  • Honors Retry-After headers on rate-limited responses
  • Configurable global and per-request timeouts (default: 60s)
  • Retryable status codes: 408, 429, 500, 502, 503, 504

Error Handling

  • BrevoApiException for all non-2xx API responses with:
    • getCode() — HTTP status code
    • getMessage() — error message
    • getBody() — parsed error response body
  • BrevoException as a base for all SDK-level errors
  • Clean try/catch branching by status code

Advanced Configuration

  • Custom PSR-18 HTTP client support (Guzzle, Symfony HttpClient, etc.)
  • Custom headers at client and per-request level
  • Configurable base URL
  • Binary response support for file downloads

Runtime Compatibility

  • PHP 8.1+
  • Laravel
  • Symfony
  • Any framework or plain PHP project with Composer

Read more at https://developers.brevo.com/docs/api-clients/php

v2.0.14

What's Changed

New Contributors

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.13...v2.0.14

v2.0.13

What's Changed

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.12...v2.0.13

v2.0.12

What's Changed

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.11...v2.0.12

v2.0.11

What's Changed

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.10...v2.0.11

v2.0.10

What's Changed

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.9...v2.0.10

v2.0.8

What's Changed

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.7...v2.0.8

v2.0.7

What's Changed

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.6...v2.0.7

v2.0.6
v2.0.5

What's Changed

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.4...v2.0.5

v2.0.4

What's Changed

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.3...v2.0.4

v2.0.3

What's Changed

Update PHP-SDK for Contacts APIs.

v2.0.1

What's Changed

New Contributors

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v2.0.0...v2.0.1

v2.0.0

What's Changed

  • Modification in Get all the contacts, contact can be filtered by segmentId and listIds as well segmentId | int| Id of the segment. Either listIds or segmentId can be passed. | [optional] listIds | int[]| Ids of the list. Either listIds or segmentId can be passed. | [optional]
  • Modification in Get a list's details startDate and endDate (YYYY-MM-DDTHH:mm:ss.SSSZ) support added.
  • Get order details route added in eCommerceAPI
  • Below routes added MasterAccountAPI Update a group of sub-accounts Create a new group of sub-accounts
  • Below routes added In UsersApi Update permission for a user Send invitation to user Revoke user permission Resend / Cancel invitation
  • In Return all your created WhatsApp templates source parameters also now supported source | string| source of the template | [optional]
  • Also smtpLogMessageIdDelete() renamed to smtpLogIdentifierDelete()

Full Changelog: https://github.com/getbrevo/brevo-php/compare/v1.0.2...v2.0.0

v1.0.2
  • Added Coupons route
  • Added previewText | string | Preview text or preheader of the email campaign | [optional]
  • language support for Whatsapp template creation
  • Making WhatsAppCampaignsApi PSR-4 compliant.
v1.0.1
v1.0.0
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
craftcms/url-validator
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony