Skip to content

Releases: getbrevo/brevo-php

v4.0.13

10 Apr 13:56
bc58ca6

Choose a tag to compare

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

27 Mar 12:56
ca18c07

Choose a tag to compare

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

25 Mar 08:36
bd83f37

Choose a tag to compare

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

12 Mar 11:39
a59fb4a

Choose a tag to compare

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

01 Mar 19:42
88896a4

Choose a tag to compare

What's Changed

  • 🌿 Fern Regeneration -- March 1, 2026 by @fern-api[bot] in #101

Full Changelog: v4.0.6...v4.0.7

V4.0.6

27 Feb 14:34
292cec2

Choose a tag to compare

What's Changed

Introduction of loyalty endpoint to delete member subscription.

New Contributors

Full Changelog: v4.0.5...v4.0.6

v4.0.5

23 Feb 15:43
752634a

Choose a tag to compare

📦 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

23 Feb 15:10
bf359f7

Choose a tag to compare

📦 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

06 Nov 10:22
1abb1b7

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v2.0.13...v2.0.14

v2.0.13

16 Sep 06:38
be204da

Choose a tag to compare

What's Changed

Full Changelog: v2.0.12...v2.0.13