使用DocuSign REST API对接Stripe时,如何禁用‘无需付款即可发送’功能?
Great question! I’ve dealt with this exact requirement when building a DocuSign + Stripe integration, so let’s break down how to lock down the payment flow so users can’t skip paying.
The Fix: Set mustPay to true in Your Payment Tab Configuration
The key lies in how you define the payment tab via the DocuSign REST API. When adding a paymentTab to your recipient’s tabs, you need to explicitly set the mustPay property to true. This forces the signer to complete the payment before the envelope is marked as fully signed—hiding or disabling the "Send without Payment" button entirely.
Here’s a snippet of what that looks like in your API request JSON:
"recipients": { "signers": [ { "email": "signer@example.com", "name": "John Doe", "recipientId": "1", "tabs": { "paymentTabs": [ { "name": "Payment", "tabLabel": "Invoice Payment", "amount": 150.00, "currencyCode": "USD", "mustPay": true, // This is the critical line "paymentGatewayId": "your_stripe_gateway_id_here" } ] } } ] }
Additional Checks to Ensure It Works
- Template Updates: If you’re using a DocuSign template with a payment tab, edit the template in the DocuSign console, select the payment tab, and enable the "Required Payment" setting (this maps directly to the
mustPayAPI parameter). - Envelope Settings: Double-check that your envelope doesn’t have any overrides that allow skipping payments. The
mustPayflag takes precedence here, so as long as it’s set correctly, you’re covered. - Testing: Send a test envelope with the setting enabled. After signing, you should be forced into the payment flow with no option to bypass it—the "Send without Payment" button will no longer be visible.
Why This Works
DocuSign’s mustPay parameter enforces that the payment is a mandatory step to complete the envelope. Without this flag, the system defaults to letting signers skip payment (which is what you’re seeing now). By setting it to true, you’re telling DocuSign that payment is a non-negotiable part of the signing process.
内容的提问来源于stack exchange,提问作者Skyler

