Skip to content

n4huel/facturama-php-sdk

 
 

Repository files navigation

Build Status

Facturama SDK PHP

This library requires PHP 5.5 as minimum

How do I install it?

composer install facturama/facturama-php-sdk:^1.0@dev

Including the Lib

It includes the library to your project

require __DIR__.'/vendor/autoload.php';

Start the development!

Create an instance of Facturama\Client class

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.

Making GET calls

$params = [];
$result = $facturama->get('Client', $params);

Making POST calls

$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);

Making PUT calls

$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);

Making DELETE calls

$clientId = 'TGpJ_Ko32_ZSEPBcZXRnRw2';

$result = $facturama->delete('Client/' . $clientId);

Examples

Don't forget to check out our examples codes in the examples directory

I want to contribute!

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!

Contributing:

phansys

About

cliente php para consumir la api facturama

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%