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).

## [4.9.0] 2026-11-05

### Added

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

## [4.8.0] 2026-09-04

### Added
Expand Down
5 changes: 5 additions & 0 deletions VERSION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
4.9.0

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

4.8.1

## Fixed
Expand Down
21 changes: 21 additions & 0 deletions src/Resources/Organizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,27 @@ public function uploadCertificate($id, $params): mixed
}
}

/**
* Get a temporary URL to download the signed Carta Manifiesto ZIP.
*
* @param string $id Organization ID. Use `me` with an organization API key.
* @return mixed JSON-decoded signed download URL metadata.
*
* @throws FacturapiException
*/
public function downloadManifiestoZipUrl($id): mixed
{
try {
return json_decode(
$this->executeGetRequest(
$this->getRequestUrl($id) . "/manifiesto/download-url"
)
);
} catch (FacturapiException $e) {
throw $e;
}
}

/**
* Get the test API key for an organization.
*
Expand Down
21 changes: 21 additions & 0 deletions tests/Resources/OrganizationsDomainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,25 @@ public function testCheckDomainAvailabilityThrowsWhenParamsAreNotArray(): void

$organizations->checkDomainAvailability('invalid');
}

public function testDownloadManifiestoZipUrlUsesExpectedEndpoint(): void
{
$httpClient = new FakeHttpClient(new Response(
200,
[],
'{"url":"https://storage.googleapis.com/signed-download","expires_at":"2030-01-01T00:00:00.000Z","content_type":"application/zip","filename":"manifiesto_AAA010101AAA.zip"}'
));
$organizations = new Organizations('sk_test_abc123', ['httpClient' => $httpClient]);

$result = $organizations->downloadManifiestoZipUrl('org_123');

self::assertSame('application/zip', $result->content_type);
self::assertSame('manifiesto_AAA010101AAA.zip', $result->filename);
$request = $httpClient->requests()[0];
self::assertSame('GET', $request->getMethod());
self::assertSame(
'https://www.facturapi.io/v2/organizations/org_123/manifiesto/download-url',
(string) $request->getUri()
);
}
}
Loading