diff --git a/api/src/middlewares/services/SubmitService/SubmitService.ts b/api/src/middlewares/services/SubmitService/SubmitService.ts index 8d172083..22827fca 100644 --- a/api/src/middlewares/services/SubmitService/SubmitService.ts +++ b/api/src/middlewares/services/SubmitService/SubmitService.ts @@ -47,7 +47,7 @@ export class SubmitService { const formFields = flattenQuestions(questions); const answers = answersHashMap(formFields); const { pay, type } = metadata; - const reference = metadata?.externalReference ?? metadata?.internalReference ?? metadata?.pay?.reference ?? this.generateId(); + const reference = formData['id'] ?? metadata?.pay?.reference ?? this.generateId(); const caseServiceName = getCaseServiceName(type); if (pay) { pay.total = fees?.total;