Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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).

## [2.4.0] - 2026-11-05

### Added

- Add `organizations().downloadManifiestoZipUrl(String id)` to obtain a temporary URL for downloading the signed Carta Manifiesto ZIP associated with the organization's certificate RFC.

## [2.3.0] - 2026-10-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.facturapi</groupId>
<artifactId>facturapi-java</artifactId>
<version>2.3.0</version>
<version>2.4.0</version>
<name>facturapi-java</name>
<description>Official Java SDK for Facturapi</description>
<url>https://github.com/facturapi/facturapi-java</url>
Expand Down
44 changes: 44 additions & 0 deletions src/main/java/io/facturapi/models/SignedDownloadUrl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package io.facturapi.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.time.Instant;

@JsonIgnoreProperties(ignoreUnknown = true)
public class SignedDownloadUrl {
private String url;
private Instant expiresAt;
private String contentType;
private String filename;

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public Instant getExpiresAt() {
return expiresAt;
}

public void setExpiresAt(Instant expiresAt) {
this.expiresAt = expiresAt;
}

public String getContentType() {
return contentType;
}

public void setContentType(String contentType) {
this.contentType = contentType;
}

public String getFilename() {
return filename;
}

public void setFilename(String filename) {
this.filename = filename;
}
}
12 changes: 12 additions & 0 deletions src/main/java/io/facturapi/resources/OrganizationsResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.facturapi.models.OrganizationUserAccess;
import io.facturapi.models.SearchResult;
import io.facturapi.models.Series;
import io.facturapi.models.SignedDownloadUrl;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -134,6 +135,17 @@ public Organization deleteCertificate(String id) {
return delete("/organizations/" + id + "/certificate", null, Organization.class);
}

/**
* Gets a temporary URL for downloading the signed Carta Manifiesto ZIP.
*/
public SignedDownloadUrl downloadManifiestoZipUrl(String id) {
return get(
"/organizations/" + id + "/manifiesto/download-url",
null,
SignedDownloadUrl.class
);
}

/**
* Permanently removes an organization.
*/
Expand Down
24 changes: 24 additions & 0 deletions src/test/java/io/facturapi/FacturapiResourcesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,30 @@ void organizationCertificateUploadsAcceptBytes() {
assertEquals("/v2/organizations/org_1/certificate", httpClient.requests().get(0).uri().getPath());
}

@Test
void organizationManifiestoZipDownloadUrlIsTyped() {
StubHttpClient httpClient = new StubHttpClient();
httpClient.enqueueJson(
200,
"{\"url\":\"https://storage.googleapis.com/signed-download\",\"expires_at\":\"2030-01-01T00:00:00Z\",\"content_type\":\"application/zip\",\"filename\":\"manifiesto_AAA010101AAA.zip\"}"
);

Facturapi sdk = new Facturapi(
FacturapiConfig.builder("sk_test")
.httpClient(httpClient.client())
.build()
);

var response = sdk.organizations().downloadManifiestoZipUrl("org_1");

assertEquals("application/zip", response.getContentType());
assertEquals("manifiesto_AAA010101AAA.zip", response.getFilename());
assertEquals(Instant.parse("2030-01-01T00:00:00Z"), response.getExpiresAt());
var request = httpClient.requests().get(0);
assertEquals("GET", request.method());
assertEquals("/v2/organizations/org_1/manifiesto/download-url", request.uri().getPath());
}

@Test
void sdkExposesAccessorBasedSurface() {
StubHttpClient httpClient = new StubHttpClient();
Expand Down
Loading