Set the ExpireEnabled, ExpireAfter and ExpireDateTime using Docusign SDK 8 for C# and its not taking the values.
Key points :
- Using Docusing SDK 8 with C#
- Using developer account
- I’m creating the envelope from a template.
- I changed the expiration days in docuSign settings

- These are the lines of code :
// Get the envelope definition after configuration
var envelopeDefinition = config.GetEnvelopeDefinition();// Set the envelope status to "sent". The signer will get an email from DocuSign
envelopeDefinition.Status = "sent";// Set expiration date
envelopeDefinition.ExpireEnabled = "true"; // Enable expiration
envelopeDefinition.ExpireDateTime = DateTimeOffset.UtcNow.AddDays(14).ToString();
envelopeDefinition.ExpireAfter = "14"; // Set expiration days// Initialize the EnvelopesApi client (reuse existing ApiClient)
EnvelopesApi envelopesApi = new(this.ApiClient);// Create the envelope on DocuSign (it will not be sent due to the "created" status)
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(this.account.AccountId, envelopeDefinition);// Get envelope created to verify the expiration values
Envelope envelope = envelopesApi.GetEnvelope(this.account.AccountId, envelopeSummary.EnvelopeId) ??
throw new Exception($"Error cannot get envelope status.");Console.WriteLine($"ExpireEnabled: {envelope.ExpireEnabled}"); // displays "true"
Console.WriteLine($"ExpireAfter: {envelope.ExpireAfter}"); // displays 120
Console.WriteLine($"ExpireDateTime: {envelope.ExpireDateTime}"); // displays todaydate + 120 days
-
The envelope were created successfully but the “Expire” fields keeps taking the default value (120) even after I changed the default values in the DocuSign Admin settings.
What am I doing wrong ?