Skip to content

Commit b7c8f60

Browse files
chore(catalogComercioExt): add new method for comercio exterior catalog (#42)
1 parent 0726f9a commit b7c8f60

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace Facturapi\Resources;
4+
5+
use Facturapi\Http\BaseClient;
6+
use Facturapi\Exceptions\Facturapi_Exception;
7+
8+
class ComercioExteriorCatalogs extends BaseClient
9+
{
10+
protected $ENDPOINT = 'catalogs/comercioexterior/2.0';
11+
12+
/**
13+
* Search tariff fractions (Fracciones Arancelarias)
14+
* @param array|null $params Search parameters (e.g., ["q" => "0101", "page" => 0, "limit" => 10])
15+
* @return JSON search result
16+
* @throws Facturapi_Exception
17+
*/
18+
public function searchTariffFractions($params = null)
19+
{
20+
try {
21+
return json_decode(
22+
$this->execute_get_request(
23+
$this->get_request_url("tariff-fractions") . $this->array_to_params($params)
24+
)
25+
);
26+
} catch (Facturapi_Exception $e) {
27+
throw new Facturapi_Exception('Unable to search tariff fractions: ' . $e->getMessage());
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)