PHPackages                             redgirasol/mifiel-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. redgirasol/mifiel-client

ActiveLibrary[API Development](/categories/api)

redgirasol/mifiel-client
========================

Mifiel API Client for PHP

2.0.4(3y ago)06.9k↓21.4%MITPHPPHP &gt;=5.5

Since Mar 9Pushed 3y agoCompare

[ Source](https://github.com/RedGirasol/php-api-client)[ Packagist](https://packagist.org/packages/redgirasol/mifiel-client)[ RSS](/packages/redgirasol-mifiel-client/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Mifiel PHP API Client
=====================

[](#mifiel-php-api-client)

[![Latest Stable Version](https://camo.githubusercontent.com/4d7f7d6d31a2f9711dc23fdc99978e971883bc9fce97edb1437c6f5e5f6e5442/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696669656c2f6170692d636c69656e742e737667)](https://packagist.org/packages/mifiel/api-client)[![Build Status](https://camo.githubusercontent.com/0a07fa6134fe55faf081f6e25ff26d5e0a70eaf5b515e8dac98b7413560a4bcf/68747470733a2f2f7472617669732d63692e6f72672f4d696669656c2f7068702d6170692d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Mifiel/php-api-client)[![Coverage Status](https://camo.githubusercontent.com/b9d42ce90665782b98c7149bfd5cdf32b5a5716dbef3b6cdf8b6380cfaf8ba3a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4d696669656c2f7068702d6170692d636c69656e742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Mifiel/php-api-client?branch=master)

PHP SDK for [Mifiel](https://www.mifiel.com) API. Please read our [documentation](http://docs.mifiel.com/) for instructions on how to start using the API.

Installation
------------

[](#installation)

Just run `composer require mifiel/api-client` in the root your project or add `mifiel/api-client` to your [composer.json](https://getcomposer.org/).

```
  "require": {
    "mifiel/api-client": "^1.0"
  }
```

And then execute `composer install`.

Usage
-----

[](#usage)

For your convenience Mifiel offers a Sandbox environment where you can confidently test your code.

To start using the API in the Sandbox environment you need to first create an account at [sandbox.mifiel.com](https://sandbox.mifiel.com).

Once you have an account you will need an APP\_ID and an APP\_SECRET which you can generate in [sandbox.mifiel.com/access\_tokens](https://sandbox.mifiel.com/access_tokens).

Then you can configure the library with:

```
  use Mifiel\ApiClient as Mifiel;
  Mifiel::setTokens('APP_ID', 'APP_SECRET');
  // if you want to use our sandbox environment use:
  Mifiel::url('https://sandbox.mifiel.com/api/v1/');
```

Document methods:

- Find:

    ```
      use Mifiel\Document;
      $document = Document::find('id');
      $document->original_hash;
      $document->file;
      $document->file_signed;
      # ...
    ```
- Find all:

    ```
      use Mifiel\Document;
      $documents = Document::all();
    ```
- Create:

> Use only **original\_hash** if you dont want us to have the file.
> Only **file** or **original\_hash** must be provided.

```
  use Mifiel\Document;
  $document = new Document([
    'file_path' => 'path/to/my-file.pdf',
    'signatories' => [
      [
        'name' => 'Signer 1',
        'email' => 'signer1@email.com',
        'tax_id' =>  'AAA010101AAA'
      ],
      [
        'name' => 'Signer 2',
        'email' => 'signer2@email.com',
        'tax_id' =>  'AAA010102AAA'
      ]
    ]
  ]);
  // if you dont want us to have the PDF, you can just send us
  // the original_hash and the name of the document. Both are required
  $document = new Document([
    'original_hash' => hash('sha256', file_get_contents('path/to/my-file.pdf')),
    'name' => 'my-file.pdf',
    'signatories' => ...
  ]);

  $document->save();
```

- Save Document related files

```
  use Mifiel\Document;
  $document = Document::find('id');

  # save the original file
  $document->saveFile('path/to/save/file.pdf');
  # save the signed file (original file + signatures page)
  $document->saveFileSigned('path/to/save/file-signed.pdf');
  # save the signed xml file
  $document->saveXML('path/to/save/xml.xml');
```

- Delete

    ```
      use Mifiel\Document;
      Document::delete('id');
    ```

Certificate methods:

- Sat Certificates

    ```
      use Mifiel\Certificate;
      $sat_certificates = Certificate::sat();
    ```
- Find:

    ```
      use Mifiel\Certificate;
      $certificate = Certificate::find('id');
      $certificate->cer_hex;
      $certificate->type_of;
      # ...
    ```
- Find all:

    ```
      use Mifiel\Certificate;
      $certificates = Certificate::all();
    ```
- Create

    ```
      use Mifiel\Certificate;
      $certificate = new Certificate([
        'file_path' => 'path/to/my-certificate.cer'
      ])
      $certificate->save();
    ```
- Delete

    ```
      use Mifiel\Certificate;
      Certificate::delete('id');
    ```

Template methods:

- Find:

    ```
      use Mifiel\Template;
      $template = Template::find('id');
      $template->name;
      $template->header;
      $template->content;
      # ...
    ```
- Find all:

    ```
      use Mifiel\Template;
      $templates = Template::all();
    ```
- Create:

    ```
      use Mifiel\Template;
      $template = new Template([
        'name' => 'My template name',
        'header' => 'Some header text',
        'content' => 'The signer SIGNER',
        'footer' => 'Some footer text'
      ]);

      $template->save();
      $template->id;
    ```
- Delete

    ```
      use Mifiel\Template;
      Template::delete('id');
    ```
- Generate a document from a template

```
use Mifiel\Document;

$document = Document::createFromTemplate([
  'template_id' => 'some-id',
  'name' => 'Some-name.pdf',
  'fields' => [
    'name' => 'Signer 1',
    'type' => 'Lawyer'
  ],
  'signatories' => [[
    'email' => 'some@email.com'
  ]],
  'external_id' => 'some-external-id'
]);
```

- Generate several documents from a template

```
$document = Document::createManyFromTemplate([
  'template_id' => 'some-id',
  'identifier' => 'name',
  'callback_url' => 'https://some-url.com',
  'documents' => [[
    'fields' => [
      'name' => 'Signer 1',
      'type' => 'Lawyer 1'
    ],
    'signatories' => [[
      'email' => 'some1@email.com'
    ]],
    'external_id' => 'some-external-id'
  ], [
    'fields' => [
      'name' => 'Signer 2',
      'type' => 'Lawyer 2'
    ],
    'signatories' => [[
      'email' => 'some2@email.com'
    ]],
    'external_id' => 'some-other-external-id'
  ]]
]);
```

Development
-----------

[](#development)

Install [grunt](http://gruntjs.com/) and run `grunt` in the terminal. This will run all tests whenever a change is detected to any file in the project.

Contributing
------------

[](#contributing)

1. Fork it (  )
2. Create your feature branch (`git checkout -b feature/my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin feature/my-new-feature`)
5. Create a new Pull Request

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1166d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/46909376?v=4)[ichavezrg](/maintainers/ichavezrg)[@ichavezrg](https://github.com/ichavezrg)

---

Top Contributors

[![genaromadrid](https://avatars.githubusercontent.com/u/9002856?v=4)](https://github.com/genaromadrid "genaromadrid (145 commits)")[![ichavezrg](https://avatars.githubusercontent.com/u/46909376?v=4)](https://github.com/ichavezrg "ichavezrg (4 commits)")[![gogl92](https://avatars.githubusercontent.com/u/1505641?v=4)](https://github.com/gogl92 "gogl92 (1 commits)")

---

Tags

fielFirma electrónicaFirma electrónica AvanzadaFirma documentos electrónicosMifiel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/redgirasol-mifiel-client/health.svg)

```
[![Health](https://phpackages.com/badges/redgirasol-mifiel-client/health.svg)](https://phpackages.com/packages/redgirasol-mifiel-client)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
