Bundle type Has an Invalid Code
Bundle.type is required and bound to a fixed value set: document, message, transaction, transaction-response, batch, batch-response, history, searchset, collection.
FHIR · Error
The error
Bundle type must be one of the bundle-type codesWhy it happens
Inventing a type (bundle, list), confusing transaction with batch, or omitting the type entirely so a default placeholder slips in.
How to fix it
Choose the type that matches intent. Use transaction for an all-or-nothing write, batch for independent writes, collection for a plain grouping, and searchset for search results.
Example
The snippet below triggers the error:
{
"resourceType": "Bundle",
"type": "bundle",
"entry": []
}The corrected version:
{
"resourceType": "Bundle",
"type": "collection",
"entry": []
}Frequently asked questions
What is the difference between transaction and batch?
A transaction Bundle is atomic: if any entry fails, the whole thing rolls back, and entries may reference each other. A batch Bundle processes entries independently with no atomicity guarantee.
Related
- Open the FHIR Validator
- All validation errors
- resourceType Is Required
- Unknown FHIR R4 Resource Type
- Required Element Is Missing for This Resource
- gender Must Be male, female, other, or unknown
- birthDate Must Be YYYY, YYYY-MM, or YYYY-MM-DD
- instant Must Include a Timezone
- Resource id Has an Invalid Format
- subject Must Be a Reference Object, Not a String