This library requires PHP 5.5 as minimum
composer install facturama/facturama-php-sdk:^1.0@dev
It includes the library to your project
require __DIR__.'/vendor/autoload.php';
Start the development!
Example:
$facturama = new \Facturama\Client('USER', 'PASSWORD');
With this client you can start working, at this step your are ready to make API calls on behalf of the user.
$params = [];
$result = $facturama->get('Client', $params);
$params = [
"Address" => [
"Street" => "St One ",
"ExteriorNumber" => "15",
"InteriorNumber" => "12",
"Neighborhood" => "Lower Manhattan, ",
"ZipCode" => "sample string 5",
"Locality" => "sample string 6",
"Municipality" => "sample string 7",
"State" => "sample string 8",
"Country" => "MX"
],
"Rfc" => "XEXX010101000",
"Name" => "Test Test",
"Email" => "[email protected]"
];
$result = $facturama->post('Client', $params);
$clientId = 'TGpJ_Ko32_ZSEPBcZXRnRw2';
$body = [
"Id" => $clientId,
"Address" => [
"Street" => "St One",
"ExteriorNumber" => "15",
"InteriorNumber" => "12",
"Neighborhood" => "Lower Manhattan, ",
"ZipCode" => "sample string 5",
"Locality" => "sample string 6",
"Municipality" => "sample string 7",
"State" => "sample string 8",
"Country" => "MX"
],
"Rfc" => "XEXX010101000",
"Name" => "Test Test 2",
"Email" => "[email protected]"
];
$result = $facturama->put('Client/' . $clientId, $body);
$clientId = 'TGpJ_Ko32_ZSEPBcZXRnRw2';
$result = $facturama->delete('Client/' . $clientId);
Don't forget to check out our examples codes in the examples directory
That is great! Just fork the project in GitHub, create a topic branch, write some code, and add some tests for your new code.
Thanks for helping!