{"record":{"id":"de5f44f17b0bb928","repo":"docusealco/docuseal","slug":"id-not-verified","errorCode":null,"errorMessage":"ID Not Verified","messagePattern":"ID Not Verified","errorType":"validation","errorClass":"Submitters::SubmitValues::ValidationError","httpStatus":422,"severity":"error","filePath":"lib/submitters/submit_values.rb","lineNumber":189,"sourceCode":"      default_values = submitter.submission.template_fields.each_with_object({}) do |field, acc|\n        next if field['submitter_uuid'] != submitter.uuid\n\n        if field['type'] == 'stamp'\n          acc[field['uuid']] ||=\n            Submitters::CreateStampAttachment.build_attachment(\n              submitter,\n              with_logo: field.dig('preferences', 'with_logo') != false\n            ).uuid\n\n          next\n        end\n\n        if field['type'] == 'verification' && with_verification\n          acc[field['uuid']] =\n            if submitter.submission_events.exists?(event_type: :complete_verification)\n              I18n.t(:verified, locale: :en)\n            elsif field['required']\n              raise ValidationError, 'ID Not Verified'\n            end\n\n          next\n        end\n\n        value = field['default_value']\n\n        next if value.blank?\n\n        acc[field['uuid']] = template_default_value_for_submitter(value, submitter, field:, with_time: true)\n      end\n\n      default_values.compact_blank.merge(submitter.values)\n    end\n\n    def build_formula_values(submitter)\n      submission_values = nil\n","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/docusealco/docuseal/blob/004a22c1c88109c7ba0b567df011a8cb13894001/lib/submitters/submit_values.rb#L171-L207","documentation":"Raised by Submitters::SubmitValues.merge_default_values while completing a submission (params[:completed] == 'true'). For every template field of type 'verification' belonging to this submitter, the code requires an existing 'complete_verification' submission event; if the field is required and no such event exists, completion is refused with 'ID Not Verified'.","triggerScenarios":"Calling submit with completed='true' when the template has a required verification field for this submitter and submitter.submission_events has no event_type: :complete_verification record (the ID verification step was never finished or its event was never written).","commonSituations":"A signer skips or fails the ID verification step and the client still posts completed=true; an integration submits directly via API bypassing the verification flow; the verification event was lost (job failure, event_type typo) so even verified users cannot complete; template authored with verification required by mistake.","solutions":["Drive the submitter through the ID verification flow so a complete_verification submission event exists before completing the form","Submit without completed=true first, complete verification, then submit again with completed=true","If verification must not block completion, edit the template and set the verification field's required to false","Audit submission_events for the submitter to confirm whether the verification event is missing or mis-typed"],"exampleFix":"# before\nSubmitters::SubmitValues.call(submitter, { values: values, completed: 'true' }, request) # raises 'ID Not Verified'\n# after\nunless submitter.submission_events.exists?(event_type: :complete_verification)\n  redirect_to verification_flow_path and return # complete verification first\nend\nSubmitters::SubmitValues.call(submitter, { values: values, completed: 'true' }, request)","handlingStrategy":"validation","validationCode":"needs_verification = submitter.submission.template_fields.any? do |f|\n  f['submitter_uuid'] == submitter.uuid && f['type'] == 'verification' && f['required']\nend\nverified = submitter.submission_events.exists?(event_type: :complete_verification)\n# guard: don't send completed=true until (needs_verification ? verified : true)","typeGuard":null,"tryCatchPattern":"begin\n  Submitters::SubmitValues.call(submitter, params, request)\nrescue Submitters::SubmitValues::ValidationError => e\n  render json: { error: e.message }, status: :unprocessable_entity if e.message == 'ID Not Verified'\nend","preventionTips":["Before marking a submission complete, check for required verification fields and gate the UI on verification state","Never call the submit API with completed=true from automated flows until the complete_verification event exists","Monitor submission_events so a silently failed verification job surfaces before the signer hits completion"],"tags":["ruby","rails","e-signature","identity-verification","submission"],"backgroundTag":"identity-verification-required","analyzedSha":"004a22c1c88109c7ba0b567df011a8cb13894001","analyzedAt":"2026-08-21T13:38:23.343Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}