Skip to main content
Constructs a fully-formed, internally-consistent BusinessTransaction from the fields a caller actually decides, deriving every field the server’s own BusinessTransactionValidator checks for cross-consistency (packages/runtime/src/validators/BusinessTransactionValidator.ts) so a caller can never build a request that fails one of those checks by mistake:
  • metadata.businessTransactionId always equals businessTransactionId
  • authorization.authorityId always equals authority.authorityId
  • intent.authorizationId always equals authorization.authorizationId
Hand-building a BusinessTransaction by writing out all five nested objects and keeping three id pairs in sync by hand is exactly the class of mistake that produced every “X must match Y” 400 response documented in the error catalog. This function exists so that mistake cannot arise when going through the SDK, not merely documented as something to be careful about. businessTransactionId defaults to a fresh crypto.randomUUID() if omitted. A caller providing one explicitly is responsible for it being unique per attempt, since it doubles as the server’s own idempotency key (see the error catalog, “businessTransactionId is an idempotency key”).

Members