From 94ad960c60f7ea413f25adcf67e89ecca91faa5c Mon Sep 17 00:00:00 2001 From: "raul@facturapi.io" Date: Mon, 13 Apr 2026 15:09:59 -0600 Subject: [PATCH 1/3] chore(defaultSeries): add new default series method --- README.es.md | 12 ++++++++++++ README.md | 12 ++++++++++++ src/Resources/Organizations.php | 23 +++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/README.es.md b/README.es.md index f681015..0a89ee8 100644 --- a/README.es.md +++ b/README.es.md @@ -156,6 +156,18 @@ $results = $facturapi->ComercioExteriorCatalogs->searchTariffFractions([ ]); ``` +### Organizaciones: Definir Serie Por Defecto + +```php +$result = $facturapi->Organizations->updateDefaultSeries( + 'ORGANIZATION_ID', + [ + 'type' => 'I', + 'series' => 'A', + ] +); +``` + ## Manejo de Errores ⚠️ En respuestas no-2xx, el SDK lanza `Facturapi\Exceptions\FacturapiException`. diff --git a/README.md b/README.md index fd50bf8..c5ffd4f 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,18 @@ $results = $facturapi->ComercioExteriorCatalogs->searchTariffFractions([ ]); ``` +### Organizations: Set Default Series + +```php +$result = $facturapi->Organizations->updateDefaultSeries( + 'ORGANIZATION_ID', + [ + 'type' => 'I', + 'series' => 'A', + ] +); +``` + ## Error Handling ⚠️ On non-2xx responses, the SDK throws `Facturapi\Exceptions\FacturapiException`. diff --git a/src/Resources/Organizations.php b/src/Resources/Organizations.php index d6c37d8..f2d2307 100644 --- a/src/Resources/Organizations.php +++ b/src/Resources/Organizations.php @@ -430,6 +430,29 @@ public function updateSeriesGroup($id, $series_name, $params): mixed } } + /** + * Update default series for an organization. + * + * @param string $id Organization ID. + * @param array $params Default series payload. + * @return mixed JSON-decoded response. + * + * @throws FacturapiException + */ + public function updateDefaultSeries($id, $params): mixed + { + try { + return json_decode( + $this->executeJsonPutRequest( + $this->getRequestUrl($id) . "/series-group/default-series", + $params + ) + ); + } catch (FacturapiException $e) { + throw $e; + } + } + /** * Delete a series group for an organization. * From 58513ae05e93b91443fb0741dfaaca44fa8514c5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 21:49:54 +0000 Subject: [PATCH 2/3] chore(release): bump minor version to 4.2.0 Agent-Logs-Url: https://github.com/FacturAPI/facturapi-php/sessions/5020b227-34af-474f-802a-d8896ee412af Co-authored-by: javorosas <2592262+javorosas@users.noreply.github.com> --- VERSION.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VERSION.md b/VERSION.md index 28e566c..dd30bc4 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,6 +1,7 @@ -4.1.0 +4.2.0 ## Added +- `organizations.updateDefaultSeries($id, $params)` method to update an organization's default series. - Organization team/access management methods: - `listTeamAccess`, `retrieveTeamAccess`, `removeTeamAccess` - `listSentTeamInvites`, `inviteUserToTeam`, `cancelTeamInvite` From f71f661a68dbbee2d7beaff9d55fc8bcffaeb271 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 21:57:44 +0000 Subject: [PATCH 3/3] chore(release): clean VERSION.md entries for 4.2.0 Agent-Logs-Url: https://github.com/FacturAPI/facturapi-php/sessions/537c15eb-c237-4586-b4ce-f1c749ad0070 Co-authored-by: javorosas <2592262+javorosas@users.noreply.github.com> --- VERSION.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/VERSION.md b/VERSION.md index dd30bc4..5c222ae 100644 --- a/VERSION.md +++ b/VERSION.md @@ -2,13 +2,3 @@ ## Added - `organizations.updateDefaultSeries($id, $params)` method to update an organization's default series. -- Organization team/access management methods: - - `listTeamAccess`, `retrieveTeamAccess`, `removeTeamAccess` - - `listSentTeamInvites`, `inviteUserToTeam`, `cancelTeamInvite` - - `listReceivedTeamInvites`, `respondTeamInvite` - - `listTeamRoles`, `listTeamRoleTemplates`, `listTeamRoleOperations` - - `retrieveTeamRole`, `createTeamRole`, `updateTeamRole`, `deleteTeamRole` - -## Changed -- `organizations.checkDomainAvailability($query)` is now the canonical method for domain checks. -- `organizations.checkDomainIsAvailable(...)` remains available as a deprecated alias for v4 compatibility.