Docusign integration

After a user orders a membership, if we don’t have a record in the WordPress database of them filling out the required forms, then we show a status box alerting them that they need to fill out forms (this status box is also always displayed in the My Account page). For forms that need signing, we generate a link to a Docusign PowerForm that is customized for each user (in particular, it also includes as hidden “envelope” data the user id number, the particular membership type, and whether this link was generated from the production or staging environment). Once the user completes the form, a service called Docusign Connect contacts our WordPress server to inform us about the signing event. Docusign makes an HTTP POST request to our API endpoint ( [https://www.acemonstertoys.org/wp-json/amt/v1/docusign/complete https://www.acemonstertoys.org/wp-json/amt/v1/docusign/complete] ) with XML data about the signed form, including the envelope data that we passed in. We then update the user’s wordpress metadata with the form signing dates. The code for our API endpoint is written in the functions.php file of our Make child theme on WordPress — the function is called docusign_complete.

The current form requirements for different membership types are:

*AMT membership: New member packet (membership agreement, liability waiver, emergency contact)
*Monster Corps membership: New member packet (membership agreement, liability waiver, emergency contact)
*Box bots membership: Liability waiver
*Ops membership: New member packet (membership agreement, liability waiver, emergency contact)

Notes on testing: to test on WordPress staging, WPengine password authentication needs to be disabled (Docusign Connect doesn’t know how to deal with that.) Docusign Connect has a record of logs and failures, which is pretty useful for debugging. In principle you can also manually republish an envelope using the Publish feature but this only seems to work on production, not staging (I think because of some SSL issues?)

Design rationale: We could have also implemented form signing integration using the heavier weight API solution from Docusign but this would have required writing a fair bit more code (to handle OAuth integration and generating custom envelopes from scratch)

Leave a Reply

Your email address will not be published. Required fields are marked *