0
votes

As the title says, I am using the DocuSign C# API and I am trying to void an envelope that has been sent, then send an updated one in its place.

So an example: I send out a DocuSign envelope to a customer

They open it to see that I have made a mistake (or want items adding etc)

They ask for a new quote

I trigger a resend (via the API using my back end database using status flags)

It is now being resent, but the previous one is still "active" and doesn't automatically void.

So how would I go about voiding this using the C# API?

Thanks for the help, if you need any more information just ask and I will get back to you.

EDIT - here is the current code that I have currently

try
{
    envelopeGenerator = new EnvelopeDefinitionGenerator(quoteID, account_id);

    envDef = envelopeGenerator.GetDefinition();

    if (item.EQuoteStatus == 4)
    {
        envelope = envelopesApi.GetEnvelope(account_id, envelopeId);
        envelope.Status = "voided";
        envelope.VoidedReason = "This envelope was voided";
        envelope.PurgeState = null;

        updateSummary = envelopesApi.Update(account_id, envelopeSummary.EnvelopeId, envelope);

        envelopeInfo = JObject.FromObject(envDef);
        jsonString = JsonConvert.SerializeObject(envelopeInfo);

        //throw new Exception(); // DEBUG LINE, COMMENT OUT - TO TEST IF EXCEPTION CODE WORKS.

        envelopesApi = new EnvelopesApi(apiClient.Configuration);
        envelopeSummary = envelopesApi.CreateEnvelope(account_id, envDef);

        Console.WriteLine($"Quote {envelopeCounter} of {quotes.Count}. Envelope Summary: {envelopeSummary.Status}");
        Logger.Log.Info($"Quote {envelopeCounter} of {quotes.Count}. Envelope Summary: {envelopeSummary.Status}");

        successFlag = true;
    }
2
Did you try something? Share a specific problem with a code snippet please :) - FortyTwo
Hi @FortyTwo I have added a code snippet if you want to check it out, thanks - JackK

2 Answers

0
votes

When using the UpdateEnvelope() method to void an envelope, don't use the previous envelope's object as the envelope definition parameter. Instead, create a new, empty Envelope object and use that.

It also looks like you're referencing envelope in the first part, and then getting the envelope ID from envelopeSummary.EnvelopeId. You'll want to confirm you have the correct ID for the envelope you're attempting to void.

Try this:

    Envelope nullEnvelope = new Envelope();
    nullEnvelope.Status = "voided";
    nullEnvelope.VoidedReason = "This envelope was voided";

    updateSummary = envelopesApi.Update(account_id, envelopeId, nullEnvelope);
0
votes

If you have only one signer scenario and that signer has complained that something is wrong on the document, then I would suggest to use Update document flow that would save your envelope count and some saving. You can update Document(s) in an envelope if no recipient in the workflow has taken any action by following any of the below endpoint,