diff --git a/CHANGELOG.md b/CHANGELOG.md index 830cccf..b28bd92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.2.0] - 2026-04-13 +### Added +- Added method `facturapi.Organization.UpdateDefaultSeriesAsync` for updating default series + ## [6.1.0] - 2026-04-01 ### Added diff --git a/Router/OrganizationRouter.cs b/Router/OrganizationRouter.cs index 2f7b533..fe200ef 100644 --- a/Router/OrganizationRouter.cs +++ b/Router/OrganizationRouter.cs @@ -110,6 +110,11 @@ public static string DeleteSeriesGroup (string id, string series_name) { return $"{RetrieveOrganization(id)}/series-group/{series_name}"; } + + public static string UpdateDefaultSeries(string organizationId) + { + return $"{RetrieveOrganization(organizationId)}/series-group/default-series"; + } public static string UpdateSelfInvoiceSettings(string organizationId) { diff --git a/Wrappers/IOrganizationWrapper.cs b/Wrappers/IOrganizationWrapper.cs index b3a9705..07c7c75 100644 --- a/Wrappers/IOrganizationWrapper.cs +++ b/Wrappers/IOrganizationWrapper.cs @@ -28,6 +28,7 @@ public interface IOrganizationWrapper Task CreateSeriesAsync(string id, Dictionary data, CancellationToken cancellationToken = default); Task UpdateSeriesAsync(string id, string seriesName, Dictionary data, CancellationToken cancellationToken = default); Task DeleteSeriesAsync(string id, string seriesName, CancellationToken cancellationToken = default); + Task UpdateDefaultSeriesAsync(string organizationId, Dictionary data, CancellationToken cancellationToken = default); Task> DeleteLiveApiKeyAsync(string id, string apiKeyId, CancellationToken cancellationToken = default); Task UpdateSelfInvoiceSettingsAsync(string organizationId, Dictionary data, CancellationToken cancellationToken = default); Task> ListTeamAccessAsync(string organizationId, CancellationToken cancellationToken = default); diff --git a/Wrappers/OrganizationWrapper.cs b/Wrappers/OrganizationWrapper.cs index 83ac9c8..e55ebd2 100644 --- a/Wrappers/OrganizationWrapper.cs +++ b/Wrappers/OrganizationWrapper.cs @@ -265,6 +265,18 @@ public async Task DeleteSeriesAsync(string id, string seriesName, C return series; } } + + public async Task UpdateDefaultSeriesAsync(string organizationId, Dictionary data, CancellationToken cancellationToken = default) + { + using (var content = new StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json")) + using (var response = await client.PutAsync(Router.UpdateDefaultSeries(organizationId), content, cancellationToken).ConfigureAwait(false)) + { + await this.ThrowIfErrorAsync(response, cancellationToken).ConfigureAwait(false); + var resultString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var organization = JsonConvert.DeserializeObject(resultString, this.jsonSettings); + return organization; + } + } public async Task> DeleteLiveApiKeyAsync(string id, string apiKeyId, CancellationToken cancellationToken = default) { diff --git a/facturapi-net.csproj b/facturapi-net.csproj index 56456cc..86f641b 100644 --- a/facturapi-net.csproj +++ b/facturapi-net.csproj @@ -11,7 +11,7 @@ SDK oficial de Facturapi para .NET para facturación electrónica en México (CFDI), envío de documentos, búsqueda y trazabilidad. factura factura-electronica facturacion cfdi cfdi40 sat invoice invoicing facturapi mexico Facturapi - 6.1.0 + 6.2.0 $(Version) MIT false