PHPackages                             mifiel/api-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. mifiel/api-client

ActiveLibrary[API Development](/categories/api)

mifiel/api-client
=================

Mifiel API Client for PHP

3.0.0(2mo ago)319.3k↓33.3%10MITPHPPHP &gt;=8.3CI passing

Since Feb 16Pushed 3w ago9 watchersCompare

[ Source](https://github.com/Mifiel/php-api-client)[ Packagist](https://packagist.org/packages/mifiel/api-client)[ RSS](/packages/mifiel-api-client/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (1)Dependencies (9)Versions (13)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 &amp; Tests
-----------------------

[](#development--tests)

We have two kinds of tests, unit and e2e (internet). You can run them with

```
# Unit
php vendor/bin/phpunit --exclude-group internet
# e2e
php vendor/bin/phpunit --group internet
```

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

60

—

FairBetter than 98% of packages

Maintenance91

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 99.4% 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

Every ~619 days

Recently: every ~928 days

Total

7

Last Release

76d ago

Major Versions

1.0.1 → 2.0.02016-02-16

2.0.3 → 3.0.02026-04-17

PHP version history (2 changes)1.0.0PHP &gt;=5.5

3.0.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/03ef6dc5e5300cb10ed1de697b630e30530ccf701b0904e610af3b6c0a80be6f?d=identicon)[genaromadrid](/maintainers/genaromadrid)

---

Top Contributors

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

---

Tags

electronic-signaturesmifielphpfielFirma electrónicaFirma electrónica AvanzadaFirma documentos electrónicosMifiel

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)

PHPackages © 2026

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