Developer Guide

PHP Digital Signature SDK: How to Sign PDFs with PHP

To sign a PDF with PHP, use the TurboDocx PHP digital signature SDK in 3 steps: Install the TurboDocx SDK with composer require turbodocx/sdk, configure TurboSign::configure() with your API key, org ID, and sender email, then call TurboSign::sendSignature() with a request listing recipients and signature fields. TurboDocx emails each recipient a signing link automatically. The SDK is a typed client for the TurboDocx e-signature API.

This guide shows you how to integrate e-signatures into your Laravel or Symfony application in under 5 minutes.

Last updated: November 12, 2026

Step 0: Get a free API key (5 signatures a month)

Create a free TurboDocx account, then copy your API key and organization ID from Settings → Developers → API keys. The Free plan includes 5 e-signatures a month, enough to run this guide end to end. Every method is documented in the PHP SDK reference.

Same SDK guide in other languages: TypeScript · JavaScript · Python · Java · Go. Prefer raw HTTP? See the endpoints on the e-signature API page.

5 min

Setup time

PHP

PHP 8.1+

Modern enums

Type-Safe

Typed classes

1

How do I install the PHP SDK?

Install the TurboDocx SDK via Composer. The package uses modern PHP 8.1+ features including enums and typed properties.

Composer
composer require turbodocx/sdk

Requirements: PHP 8.1+, Composer, ext-json, ext-fileinfo. Compatible with Laravel, Symfony, and vanilla PHP.

2

Where do I find my API key and org ID?

Before you begin, you'll need your API credentials from the TurboDocx dashboard.

  1. Sign up for a free account at TurboDocx
  2. Navigate to Settings → Developers → API keys
  3. Copy your API Key and Organization ID
.env
TURBODOCX_API_KEY=your_api_key_here
TURBODOCX_ORG_ID=your_org_id_here
TURBODOCX_SENDER_EMAIL=you@company.com
TURBODOCX_SENDER_NAME=Your Company Name
3

How do I send a PDF for signature with PHP?

Use the SDK to send a document for signature. The recipient will receive an email with a link to sign.

SendSignature.php
<?php

use TurboDocx\TurboSign;
use TurboDocx\Config\HttpClientConfig;
use TurboDocx\Types\Recipient;
use TurboDocx\Types\Field;
use TurboDocx\Types\SignatureFieldType;
use TurboDocx\Types\TemplateConfig;
use TurboDocx\Types\FieldPlacement;
use TurboDocx\Types\Requests\SendSignatureRequest;

// Configure with your API credentials
TurboSign::configure(new HttpClientConfig(
    apiKey: getenv('TURBODOCX_API_KEY') ?: null,
    orgId: getenv('TURBODOCX_ORG_ID') ?: null,
    senderEmail: getenv('TURBODOCX_SENDER_EMAIL') ?: null,  // REQUIRED
    senderName: getenv('TURBODOCX_SENDER_NAME') ?: null     // Recommended
));

// Send document for signature
$result = TurboSign::sendSignature(
    new SendSignatureRequest(
        recipients: [
            new Recipient('John Doe', 'john@example.com', 1)
        ],
        fields: [
            new Field(
                type: SignatureFieldType::SIGNATURE,
                recipientEmail: 'john@example.com',
                template: new TemplateConfig(
                    anchor: '{signature1}',
                    placement: FieldPlacement::REPLACE,
                    size: ['width' => 100, 'height' => 30]
                )
            )
        ],
        file: file_get_contents('contract.pdf'),
        documentName: 'Partnership Agreement'
    )
);

echo "Document ID: {$result->documentId}\n";

Modern PHP: Uses PHP 8.1+ features like enums (SignatureFieldType::SIGNATURE) and named parameters for type safety.

4

How do I know when the PDF is signed?

Configure webhooks to receive real-time notifications when documents are signed. Verify the X-TurboDocx-Signature header with verifyWebhookSignature() against the raw request body before trusting a payload.

WebhookController.php (Laravel)
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use TurboDocx\TurboSign;
use function TurboDocx\Utils\verifyWebhookSignature;

class WebhookController extends Controller
{
    public function handle(Request $request)
    {
        $rawBody = $request->getContent();
        if (!verifyWebhookSignature(
            $rawBody,
            $request->header('X-TurboDocx-Signature', ''),
            $request->header('X-TurboDocx-Timestamp', ''),
            getenv('TURBODOCX_WEBHOOK_SECRET') ?: '',
        )) {
            return response()->json(['error' => 'invalid signature'], 401);
        }

        $event = $request->input('event');
        $data = $request->input('data');

        if ($event === 'signature.document.completed') {
            $documentId = $data['document_id'];

            // Download the signed PDF
            $signedPdf = TurboSign::download($documentId);

            // Save to storage
            Storage::put("signed/{$documentId}.pdf", $signedPdf);
        }

        return response()->json(['received' => true]);
    }
}
5

What can I build next?

You now have everything you need to integrate document signing into your PHP application using the TurboDocx e-signature API. The typed SDK handles authentication, document delivery, signature collection, and legally-binding audit trails.

What you can do next:

  • Add multiple recipients with sequential signing order
  • Use different field types: initials, dates, text, checkboxes
  • Integrate with Laravel Queues for async processing
  • Get audit trails and compliance certificates

Related Guides

Resources

Frequently Asked Questions

How do I sign a PDF with PHP?

Install the TurboDocx SDK (composer require turbodocx/sdk), configure it with your API key, then use TurboSign::sendSignature() to send the document for e-signature.

Is there a PHP digital signature SDK for Composer projects?

Yes. composer require turbodocx/sdk installs a typed digital signature SDK for PHP 8.1+ with enums and typed request classes, so Laravel and Symfony apps get IDE autocomplete for recipients, fields, and signature placement.

Does the PHP SDK work with Laravel?

Yes, the TurboDocx PHP SDK works with Laravel, Symfony, and any PHP 8.1+ application. It uses typed classes and enums for full IDE support.

Is the PHP digital signature SDK free?

Yes. turbodocx/sdk is open source under the MIT license, and API access is included on every TurboDocx plan, including the Free plan with 5 e-signatures per month.

What PHP version is required?

The TurboDocx PHP SDK requires PHP 8.1 or higher.

Ready to Get Started?

Create a free account and get your API key. Start sending documents for signature in minutes.