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;
}