# Error 500 Internal Server Error when adding Patient details to EPS Encode request

**URL:** <https://developer.community.nhs.uk/t/error-500-internal-server-error-when-adding-patient-details-to-eps-encode-request/5367>\
**Category:** Electronic Prescription Service (EPS)\
**Tags:** fhir\
**Created:** [7 April 2025 10:09 UTC](https://developer.community.nhs.uk/t/error-500-internal-server-error-when-adding-patient-details-to-eps-encode-request/5367 "2025-04-07T10:09:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isaac\_Ward](https://avatars.discourse-cdn.com/v4/letter/i/54ee81/32.png) [@Isaac\_Ward](https://developer.community.nhs.uk/u/Isaac_Ward)\
**Post date:** [7 April 2025 10:09 UTC](https://developer.community.nhs.uk/t/error-500-internal-server-error-when-adding-patient-details-to-eps-encode-request/5367/1 "2025-04-07T10:09:04Z")

</div>

Hi, I’ve been working on the request message for the EPS Encode API. (/FHIR/R4/$prepare)  
I began with the template message found at [API Catalogue: EPS](https://digital.nhs.uk/developer/api-catalogue/electronic-prescription-service-fhir#post-/FHIR/R4/$prepare)  
After changing the example EPS data for the Patient bundle, the API returned errors for formatting and such as I would expect.  
Once I finished clearing errors and specifically fixed the NHS number format, the API is now returning an Error 500, accompanied by “An unknown error occurred processing this request. Contact us for assisting with diagnosing this issue: [https://digital.nhs.uk/developer/help-and-support.](https://digital.nhs.uk/developer/help-and-support.)” and a Message ID.  
This has occurred repeatedly when attempting to customise the patient bundle, and still occurs when using the NHS number from the example.  
Has anyone come across this issue when customizing bundles from the Prepare example?

---

<div class="post-metadata">

**Author:** ![elliott.seaton1](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elliott.seaton1](https://developer.community.nhs.uk/u/elliott.seaton1)\
**Post date:** [7 April 2025 12:55 UTC](https://developer.community.nhs.uk/t/error-500-internal-server-error-when-adding-patient-details-to-eps-encode-request/5367/2 "2025-04-07T12:55:50Z")

</div>

Hi Isaac - I work in the EPS dev team and I’ll investigate this for you. In the meantime, if you’d like to send me a copy of the payload I can get one of our devs to look at it for you. [elliott.seaton1@nhs.net](mailto:elliott.seaton1@nhs.net)
