DocuSign Integration: API, Embedded Signing & Webhook Setup

Integrating DocuSign integration with a web application for electronic signature on website often encounters OAuth errors, incorrect anchor strings, or misconfigured webhooks. Typical issues include misconfigured redirect URIs, outdated SDK versions, and mismatched PDF tags. All this leads to runtim

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1281
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1237
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    977
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1026
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1103
  • image_website-_0.webp
    Website development for Red Pear
    550

Integrating DocuSign integration with a web application for electronic signature on website often encounters OAuth errors, incorrect anchor strings, or misconfigured webhooks. Typical issues include misconfigured redirect URIs, outdated SDK versions, and mismatched PDF tags. All this leads to runtime failures and lost deals. We specialize in such DocuSign API integration: we have completed over 30 projects where DocuSign is used for signing contracts, acts, and invoices. On average, our clients reduce document processing time by 40% and accelerate deal closure by 3 times. Embedded signing via DocuSign API improves completion rate by 3x compared to email signing, saving up to $1,500 per month in manual processing costs.

Why Choose DocuSign?

DocuSign is the market leader in electronic signatures in the US and Europe. It supports legally binding signatures under eIDAS (Europe), UETA/ESIGN (USA), and several national standards. For the Russian market: DocuSign provides a simple electronic signature (SES) that is recognized in court if there is an agreement between the parties—this is sufficient for most commercial contracts. For more details, see the Official DocuSign documentation.

How Integration Works?

Typical flow:

  1. User fills in data on the website → clicks "Sign contract"
  2. Backend creates an Envelope in DocuSign with the document and recipients
  3. User is redirected to DocuSign to sign (or receives an email)
  4. After signing, DocuSign notifies the site via webhook
  5. Backend downloads the signed document and saves it

We implement two scenarios: email sending or embedded signing—signing directly on the site. Comparison:

Criteria Email Signing Embedded Signing
Interaction User goes to DocuSign Signing in iframe on your site
UX Control Minimal Full (design, redirect)
Completion Rate ~70% ~95% (3x fewer drop-offs)
Implementation Speed 2-3 days 4-5 days

Application Setup

In DocuSign Developer Portal: create Integration Key → add redirect URI → request Secret Key. For testing—free Demo environment (account-d.docusign.com).

composer require docusign/esign-client 

OAuth: Obtaining a Token

DocuSign uses OAuth 2.0 Authorization Code Grant:

class DocuSignAuthService { public function getAuthUrl(): string { $params = http_build_query([ 'response_type' => 'code', 'scope' => 'signature', 'client_id' => config('docusign.integrator_key'), 'redirect_uri' => config('docusign.redirect_uri'), ]); return 'https://account-d.docusign.com/oauth/auth?' . $params; } public function handleCallback(string $code): string { $response = Http::withBasicAuth( config('docusign.integrator_key'), config('docusign.client_secret') )->asForm()->post('https://account-d.docusign.com/oauth/token', [ 'grant_type' => 'authorization_code', 'code' => $code, 'redirect_uri' => config('docusign.redirect_uri'), ]); return $response->json('access_token'); } } 

For server-side scenarios without user interaction—JWT Grant (service account).

Creating an Envelope and Sending for Signature

class DocuSignEnvelopeService { public function createEnvelope( string $accessToken, string $pdfPath, array $signers ): string { $config = new \DocuSign\eSign\Configuration(); $config->setHost(config('docusign.base_url')); $config->addDefaultHeader('Authorization', "Bearer {$accessToken}"); $apiClient = new \DocuSign\eSign\client\ApiClient($config); $envelopesApi = new \DocuSign\eSign\Api\EnvelopesApi($apiClient); $document = new \DocuSign\eSign\Model\Document([ 'document_base64' => base64_encode(file_get_contents($pdfPath)), 'name' => 'Contract', 'file_extension' => 'pdf', 'document_id' => '1', ]); $signHere = new \DocuSign\eSign\Model\SignHere([ 'anchor_string' => '/sig1/', 'anchor_x_offset' => '20', 'anchor_y_offset' => '-10', 'anchor_units' => 'pixels', ]); $recipientList = []; foreach ($signers as $i => $signer) { $tabs = new \DocuSign\eSign\Model\Tabs(['sign_here_tabs' => [$signHere]]); $recipientList[] = new \DocuSign\eSign\Model\Signer([ 'email' => $signer['email'], 'name' => $signer['name'], 'recipient_id' => (string)($i + 1), 'routing_order'=> (string)($i + 1), 'tabs' => $tabs, ]); } $envelopeDefinition = new \DocuSign\eSign\Model\EnvelopeDefinition([ 'email_subject' => 'Please sign the document', 'documents' => [$document], 'recipients' => new \DocuSign\eSign\Model\Recipients([ 'signers' => $recipientList, ]), 'status' => 'sent', ]); $result = $envelopesApi->createEnvelope( config('docusign.account_id'), $envelopeDefinition ); return $result->getEnvelopeId(); } } 

Embedded Signing: Signature Directly on the Site

Instead of redirecting to DocuSign—embedded iframe or redirect back to site:

public function getSigningUrl(string $accessToken, string $envelopeId, array $signer): string { $config = new \DocuSign\eSign\Configuration(); $config->setHost(config('docusign.base_url')); $config->addDefaultHeader('Authorization', "Bearer {$accessToken}"); $apiClient = new \DocuSign\eSign\client\ApiClient($config); $envelopesApi = new \DocuSign\eSign\Api\EnvelopesApi($apiClient); $viewRequest = new \DocuSign\eSign\Model\RecipientViewRequest([ 'authentication_method' => 'none', 'client_user_id' => $signer['id'], 'recipient_id' => '1', 'return_url' => route('contracts.signed'), 'user_name' => $signer['name'], 'email' => $signer['email'], ]); $result = $envelopesApi->createRecipientView( config('docusign.account_id'), $envelopeId, $viewRequest ); return $result->getUrl(); } 

Webhook: Notification of Signing

After signing, DocuSign sends XML with the new status. The server must process the request, verify that the status is Completed, and start downloading the document. We set up an endpoint that accepts POST requests and ensure it is accessible from the outside world. In production, HTTPS is mandatory.

Common Integration Errors

Most common errors:

  • OAuth error: incorrect redirect URI or scope. Ensure the exact URI (including protocol and port) is specified in the app settings.
  • Anchor string mismatch: if the PDF document does not contain the specified anchor string, DocuSign will throw an error. Use tags like /sig1/ inside the original document.
  • Lost webhook: during testing, ensure the server is accessible from the external network (not localhost) and that DocuSign can send the request. In production, use HTTPS.

If you encounter these issues—our team can resolve them promptly.

What's Included in Our Integration Service

  • Analysis of business processes and selection of the optimal scenario (email/embedded)
  • DocuSign app setup (Integration Key, Secret, Redirect URI)
  • API integration development: envelope creation, signing management
  • Webhook integration for automatic status updates
  • Embedded signing: iframe setup with custom settings
  • Testing in demo environment and migration to production
  • Operational documentation (admin instructions)
  • Employee training on the new system
  • Ongoing support after launch

We guarantee stable operation and timely support after launch. Contact us to discuss your project and find the best solution.

Our Experience and Results

We are a team with experience in DocuSign API integration. We have completed over 30 projects for companies in fintech, logistics, and retail. One client—a commercial real estate rental platform—reduced contract signing time from 3 days to 2 hours, and courier delivery costs dropped by 80%. Another project—a B2B e-commerce store—increased order processing speed by 60% thanks to automatic signing of payment invoices. The average time savings on document workflow is 40%, and the conversion of deal closing increases by 3 times. With savings up to $1,500 per month, our clients see rapid ROI.

Want the same results? Get a consultation—we will evaluate your system and propose an implementation plan.

Timeframes

Basic integration (envelope creation + email to signer + webhook): 2–3 business days. Embedded signing with full in-site flow and automatic document download: 4–5 business days. The estimate includes DocuSign app registration, testing in demo environment, and production migration.

Ready to discuss your project? Contact us for a detailed audit of your document workflow system. We will select the optimal solution for your budget and timeline.