DocuSign#
Endpoints for generating, signing, tracking, and resending DocuSign envelopes for an XC (Cross-Connect) request's SOW and Acta de Entrega documents.Concepts#
Envelope: a document package sent to DocuSign for signature, stored in docusign_envelopes. It's created from an existing base document on the request (SOW_GENERADO or ACTA_ENTREGA, or an explicit base_document_id).
document_type: either SOW or ACTA_ENTREGA — determines which base document is used and which signed document type is produced once completed (SOW_FIRMADO / ACTA_ENTREGA_FIRMADA).
Single vs. multiple signers: an envelope can have one signer (embedded signing, clientUserId set) or several signers who sign sequentially by routing_order (remote signing — DocuSign emails each one automatically once the previous signer completes).
Signing link / redirect: created envelopes are shared with signers as a link to GET /xc/requests/signing/redirect/:token, which resolves a secure per-envelope token to a fresh DocuSign signing URL and redirects the signer there. This avoids DocuSign's signing URLs expiring after a few minutes.
Webhook: DocuSign notifies status changes (sent, delivered, completed, declined, voided) via POST /webhooks/docusign (documented in the XC Webhook folder). On completion, the signed PDF is downloaded and stored as an xc_document, and the related XC request's status is advanced automatically (SOW signed → IMPLEMENTACIÓN, Acta signed → COMPLETA).
Endpoints#
POST /v1/xc/requests/{id}/signing/envelopesCreates a single-signer envelope and emails the signer a signing link.POST /v1/xc/requests/{id}/signing/envelopes/multiple-signersCreates an envelope with 1–100 signers who sign in order of routing_order.GET /v1/xc/requests/{id}/signing/envelopesLists envelopes for a request, optionally filtered by document_type and/or status.GET /v1/xc/requests/{id}/signing/urlReturns a fresh embedded signing URL for the latest envelope of a document type (single-signer flow only).GET /v1/xc/envelopes/{envelopeId}/signing/url/regeneratePublic endpoint that regenerates a signing URL for whichever signer is currently active in the routing order — used when a signer's link has expired.POST /v1/xc/requests/{id}/signing/envelopes/resendResends the signing notification: DocuSign's native resend for multi-signer envelopes, or a custom email with a new link for single-signer envelopes.GET /v1/xc/envelopes/{docusignEnvelopeId}/signing/signers/routingReturns previous_signers, current_signer, and next_signers for a multi-signer envelope, synced from DocuSign's recipient statuses.Status values#
CREATED, SENT, DELIVERED, COMPLETED, DECLINED, VOIDED, EXPIRED.Source#
Router: routes/v1/xc/docusign-envelopes.router.js
Controller: controllers/xc/docusign-envelopes.controller.js
Service: services/xc/docusign-envelopes.service.js
DocuSign client: services/docusign.js
Entities: entities/docusign-envelope.js, entities/docusign-envelope-signer.js
Modified at 2026-09-25 00:03:33