Spec reference:
https://hl7.org/fhir/http.html#transaction
Bundle to the server base URL.
You choose the behavior with Bundle.type:
batch: entries are processed independently (partial success is expected)transaction: all-or-nothing (atomic); either everything is applied or nothing is
The shape (what you send)
YouPOST a Bundle to the base endpoint:
entry includes a request describing the interaction:
entry.request.method:GET,POST,PUT,PATCH,DELETEentry.request.url: relative FHIR URL (e.g.Patient/123,Observation?code=...)entry.resource: required for write interactions (POST,PUT,PATCH)entry.fullUrl: optional, but very useful in transactions for intra-bundle references
Batch vs transaction (how it behaves)
| Aspect | batch | transaction |
|---|---|---|
| Atomic | ❌ No | ✅ Yes |
| Partial success | ✅ Normal | ❌ No |
Intra-bundle references (fullUrl → Reference.reference) | ⚠️ Not generally meaningful | ✅ Common pattern |
| Error reporting | Per-entry | Whole request fails |
The response (what you get back)
On success, servers return a response bundle where eachentry.response
contains the HTTP status and metadata for the corresponding request:
OperationOutcome
with a non-2xx HTTP status.
References inside a transaction
Transactions commonly usefullUrl values like urn:uuid:... so resources can
reference each other before the server assigns real ids:
Conditional logic (common patterns)
FHIR also supports conditional create/update/delete inside batch and transaction bundles via request metadata likeIf-None-Exist and conditional
URLs.
If you rely on conditional behavior, always verify support in the server’s
CapabilityStatement (GET /fhir/metadata).
TLQ links
Next
- Deep dive: Transactions
- Background: Bundles