PHPackages                             eversign/eversign-php-sdk - 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. eversign/eversign-php-sdk

ActiveLibrary[API Development](/categories/api)

eversign/eversign-php-sdk
=========================

The official PHP SDK Wrapper for the Eversign API

1.27.0(3y ago)16161.5k↓43.9%24[6 PRs](https://github.com/eversign/eversign-php-sdk/pulls)MITPHPPHP ^7.1|^8.0

Since May 4Pushed 2y ago2 watchersCompare

[ Source](https://github.com/eversign/eversign-php-sdk)[ Packagist](https://packagist.org/packages/eversign/eversign-php-sdk)[ RSS](/packages/eversign-eversign-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (57)Used By (0)

eversign PHP SDK
================

[](#eversign-php-sdk)

eversign PHP SDK is the official PHP Wrapper around the eversign [API](https://eversign.com/api/documentation).

**Quick Links:**

- [Create Document Example](/example/create-document.php)
- [Use Template Example](/example/create-document-from-template.php)
- [Document Operations](/example/document-operations.php)
- [Create Iframe Signature](/example/iframe.php)
- [Create Iframe Signature From Template](/example/iframe-template.php)
- [OAuth Flow (start)](/example/oauth/index.php)
- [OAuth Flow (callback)](/example/oauth/callback.php)

Requirements
------------

[](#requirements)

- The latest version of the SDK requires PHP version 7.1 or higher.
- Installation via [Composer](https://getcomposer.org/) is recommended

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

[](#installation)

- Install Composer if you haven't already

```
curl -sS https://getcomposer.org/installer | php

```

- Add the eversign PHP SDK as a dependency using the composer.phar CLI:

```
php composer.phar require eversign/eversign-php-sdk:~1.0

```

or add it directly to your composer.json

```
{
  "require": {
    "eversign/eversign-php-sdk": "~1.0"
  }
}

```

- After installing, you need to require Composer's autoloader

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

```

Usage
-----

[](#usage)

All eversign API requests are made using the `Eversign\Client` class, which contains all methods for creating, retrieving and saving documents. This class must be initialized with your API access key string. [Where is my API access key?](https://eversign.com/api/documentation/intro#api-access-key)

Please also specify the ID of the eversign business you would like this API request to affect. [Where is my Business ID?](https://eversign.com/api/documentation/intro#business-selection)

```
$client = new Client("MY_API_KEY", $businessId);

```

### Fetch businesses

[](#fetch-businesses)

Using the `getBusinesses()` function all businesses on the eversign account will be fetched and listed along with their Business IDs.

```
$businesses = $client->getBusinesses();
echo $businesses[0]->getBusinessId();

$client->setSelectedBusiness($businesses[0]);

```

If you know the `businessId` beforehand you can also set it with `setSelectedBusinessById(businessId)`

```
$client->setSelectedBusinessById(1337);

```

### Create document from template \[Method: Use Template\]

[](#create-document-from-template-method-use-template)

To create a document based on an already created template you can use the class `Eversign\DocumentTemplate`. In order to identify which template should be used, please pass the template's ID into the `setTemplateId("MY_TEMPLATE_ID")` function.

Additionally, `setTitle()` and `setMessage()` can be used to set a title and message for the newly created document.

```
$documentTemplate = new DocumentTemplate();
$documentTemplate->setTemplateId("MY_TEMPLATE_ID");
$documentTemplate->setTitle("Form Test");
$documentTemplate->setMessage("Test Message");

```

#### Fill signing roles \[Method: Use Template\]

[](#fill-signing-roles-method-use-template)

A template's signing and CC roles are filled just using the functions below. Each role is identified using the `setRole()` function, must carry a name and email address and is appended to the document using the `appendSigner()` function.

```
$signer = new Signer();
$signer->setRole("Testrole");
$signer->setName("John Doe");
$signer->setEmail("john.doe@eversign.com");
$documentTemplate->appendSigner($signer);

```

#### Saving the document object \[Method: Use Template\]

[](#saving-the-document-object-method-use-template)

Your document object can now be saved using the `createDocumentFromTemplate()` function. Once this function has been called successfully, your document is created and the signing process is started.

```
$newlyCreatedDocument = $client->createDocumentFromTemplate($documentTemplate);
$newlyCreatedDocument->getDocumentHash();

```

### Creating a document \[Method: Create Document\]

[](#creating-a-document-method-create-document)

A document is created by instantiating the `Eversign\Document` object and setting your preferred document properties. There is a series of `set` methods available used to specify options for your document. All available methods can be found inside our extensive [Create Document Example](/example/create-document.php).

```
$document = new Document();
$document->setTitle("My Title");
$document->setMessage("My Message");

```

#### Adding signers to a document \[Method: Create Document\]

[](#adding-signers-to-a-document-method-create-document)

Signers are added to an existing document object by instantiating the `Eversign\Signer` object and appending each signer to the document object. Each signer object needs to come with a Signer ID, which is later used to assign fields to the respective signer. If no Signer ID is specified, the `appendSigner()` method will set a default incremented Signer ID. Each signer object also must contain a name and email address and is appended to the document using the `appendSigner()` method.

```
$signer = new Signer();
$signer->setId("1");
$signer->setName("John Doe");
$signer->setEmail("john.doe@eversign.com");
$document->appendSigner($signer);

```

#### Adding recipients (CCs) to a document \[Method: Create Document\]

[](#adding-recipients-ccs-to-a-document-method-create-document)

Recipients (CCs) are added by instantiating the `Eversign\Recipient` object and appending each recipient to the document object. Just like signers, recipients must carry a name and email address.

```
$recipient = new Recipient();
$recipient->setName("John Doe");
$recipient->setEmail("john.doe@eversign.com");
$document->appendRecipient($recipient);

```

#### Adding files to the Document \[Method: Create Document\]

[](#adding-files-to-the-document-method-create-document)

Files are added to a document by instantiating an `Eversign\File` object. The standard way of choosing a file to upload is appending the file's path using the `setFilePath()` method and then appending your file using the `appendFile()` method.

Uploading a file is mandatory without which the createDocument method will fail. As an alternative you may upload a blank PDF and add 'note' or 'text' field types.

```
$file = new File();
$file->setName("My File");
$file->setFilePath(getcwd() . "/file.pdf");
$document->appendFile($file);

```

#### Adding fields \[Method: Create Document\]

[](#adding-fields-method-create-document)

There is a number of fields that can be added to a document, each coming with different options and parameters. ([View Full list of fields »](https://eversign.com/api/documentation/fields))

A field is appended to the document using the `appendFormField($signatureField, $fileIndex)` method. The first function parameter is the field object, and the second parameter must contain the index of the file it should be added to. If your field should be placed onto the first uploaded file, set this parameter to `0`. This parameter also default to `0`.

Signature and Initials fields are required to be assigned to a specific signer. Fields are assigned to a signer by passing the **Signer ID** into the `setSigner()` function.

```
$signatureField = new SignatureField();
$signatureField->setFileIndex(0);
$signatureField->setPage(2);
$signatureField->setX(30);
$signatureField->setY(150);
$signatureField->setRequired(true);
$signatureField->setSigner("1");
$document->appendFormField($signatureField, $fileIndex);

```

A full example containing instructions and methods for each available field type can be found here: [Create Document Example](/example/create-document.php)

**Available field types**

Please find below all available field types:

Field TypeClassdate\_signedEversign\\DateSignedFieldsignatureEversign\\SignatureFieldinitialsEversign\\InitialsFieldnoteEversign\\NoteFieldtextEversign\\TextFieldcheckboxEversign\\CheckboxFieldradioEversign\\RadioFielddropdownEversign\\DropdownFieldattachmentEversign\\AttachmentField#### Saving a document \[Method: Create Document\]

[](#saving-a-document-method-create-document)

A document is saved and sent out by passing the final document object into the `createDocument` method. The API will return the entire document object array in response.

```
$newDocument = $client->createDocument($document);
$newDocument->getDocumentHash();

```

#### Loading a document

[](#loading-a-document)

*Class: Document*

A document is loaded by passing its document hash into the `getDocumentByHash()` method.

```
$document = $client->getDocumentByHash("MY_HASH");

```

#### Downloading the raw or final document

[](#downloading-the-raw-or-final-document)

*Class: Client*

A document can be downloaded either in its raw or in its final (completed) state. In both cases, the respective method must contain the document object and a path to save the PDF document to. When downloading a final document, you can choose to attach the document's Audit Trail by setting the third parameter to `true`.

```
$client->downloadFinalDocumentToPath($document, "final.pdf", $attachAuditTrail);
$client->downloadRawDocumentToPath($document, "raw.pdf");

```

#### Get a list of documents or templates

[](#get-a-list-of-documents-or-templates)

*Class: Client*

The Client class is also capable fo listing all available documents templates based on their status. Each method below returns an array of document objects.

```
$client->getAllDocuments();
$client->getCompletedDocuments();
$client->getDraftDocuments();
$client->getCanceledDocuments();
$client->getActionRequiredDocuments();
$client->getWaitingForOthersDocuments();

$client->getTemplates();
$client->getArchivedTemplates();
$client->getDraftTemplates();

```

#### Delete or cancel a document

[](#delete-or-cancel-a-document)

*Class: Client*

A document is cancelled or deleted using the methods below.

```
$client->deleteDocument($document);
$client->cancelDocument($document);

```

### Contact us

[](#contact-us)

Any feedback? Please feel free to [contact our support team](https://eversign.com/contact).

### Development

[](#development)

```
# Install composer dependencies
docker run --rm -v $(pwd):/app composer/composer install

# run docker compose
docker-compose up -d

# point your browser to localhost:8080
curl http://localhost:8080

# run tests
docker-compose exec eversign-sdk-php vendor/bin/phpunit sdk/Eversign/Test/ClientTest.php --colors=never

```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 53.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 ~38 days

Recently: every ~57 days

Total

55

Last Release

1211d ago

Major Versions

v0.1.0 → v1.0.02017-05-12

PHP version history (2 changes)1.14.0PHP ^7.1

1.21.0PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3921dc987492e3fd950fd0a5dd9fe21de6d2d199eb77f76e674a8501166d9df7?d=identicon)[eversign](/maintainers/eversign)

---

Top Contributors

[![dominikkukacka](https://avatars.githubusercontent.com/u/243319?v=4)](https://github.com/dominikkukacka "dominikkukacka (62 commits)")[![milanlatinovic](https://avatars.githubusercontent.com/u/7974335?v=4)](https://github.com/milanlatinovic "milanlatinovic (22 commits)")[![alexeriksen](https://avatars.githubusercontent.com/u/49480636?v=4)](https://github.com/alexeriksen "alexeriksen (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![om3g4](https://avatars.githubusercontent.com/u/332865?v=4)](https://github.com/om3g4 "om3g4 (4 commits)")[![clemcoder](https://avatars.githubusercontent.com/u/64213547?v=4)](https://github.com/clemcoder "clemcoder (2 commits)")[![Snowbaha](https://avatars.githubusercontent.com/u/3284722?v=4)](https://github.com/Snowbaha "Snowbaha (2 commits)")[![julian-zehetmayr](https://avatars.githubusercontent.com/u/28352092?v=4)](https://github.com/julian-zehetmayr "julian-zehetmayr (2 commits)")[![okdewit](https://avatars.githubusercontent.com/u/1403548?v=4)](https://github.com/okdewit "okdewit (2 commits)")[![sc85](https://avatars.githubusercontent.com/u/4824890?v=4)](https://github.com/sc85 "sc85 (2 commits)")[![jasongill](https://avatars.githubusercontent.com/u/241711?v=4)](https://github.com/jasongill "jasongill (1 commits)")[![psousasingular](https://avatars.githubusercontent.com/u/56584418?v=4)](https://github.com/psousasingular "psousasingular (1 commits)")[![Nathanw](https://avatars.githubusercontent.com/u/13299423?v=4)](https://github.com/Nathanw "Nathanw (1 commits)")[![ildarius](https://avatars.githubusercontent.com/u/1866104?v=4)](https://github.com/ildarius "ildarius (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eversign-eversign-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/eversign-eversign-php-sdk/health.svg)](https://phpackages.com/packages/eversign-eversign-php-sdk)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[dsc/mercado-livre

Client para integração com API do Mercado Livre

8138.7k](/packages/dsc-mercado-livre)[webit/w-firma-api

wFirma.pl API

1820.2k](/packages/webit-w-firma-api)

PHPackages © 2026

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