partyLast updated on
Last updated on
Define signing roles and signature requirements
Define party roles for signatories with signature configuration. Parties represent roles like "buyer", "seller", or "guarantor" that can be filled by persons or organizations at runtime.
Party data format is determined by max:
max = 1(default): single party object with requiredidmax > 1: array of party objects, each with requiredid
Examples
Creating parties
// Single signer with signature requirement
const buyer = party()
.label('Buyer')
.partyType('person')
.signature({ required: true })
.build()
// Organization signer with witness requirement
const company = party()
.label('Company')
.partyType('organization')
.description('The selling organization')
.signature({ required: true, witnesses: 1 })
.build()
// Multiple allowed (e.g., co-signers)
const coOwners = party()
.label('Co-owners')
.min(1)
.max(4) // max > 1 enables array format
.signature({ required: true })
.build()
// Optional party (min: 0 allows empty)
const coSigner = party()
.label('Co-signer')
.optional() // sets min: 0
.signature({ required: true })
.build()
// Conditional requirement
const guarantor = party()
.label('Guarantor')
.required('needsGuarantor')
.signature({ required: true })
.build()
// Notarized signature
const affiant = party()
.label('Affiant')
.signature({ required: true, notarized: true })
.build()Adding parties to forms
// Object pattern
const form = open.form({
name: 'purchase-agreement',
parties: {
buyer: {
label: 'Buyer',
partyType: 'person',
signature: { required: true }
},
seller: {
label: 'Seller',
partyType: 'any',
signature: { required: true, witnesses: 2 }
}
}
})
// Builder pattern
const form = open.form()
.name('purchase-agreement')
.party('buyer', party()
.label('Buyer')
.partyType('person')
.signature({ required: true })
.build())
.party('seller', party()
.label('Seller')
.signature({ required: true, witnesses: 2 })
.build())
.build()API
Object Pattern
Create party definitions directly as objects:
const partyDef: FormParty = {
label: 'Buyer',
description: 'The purchasing party',
partyType: 'person',
min: 1,
max: 1, // default, single party
required: true,
signature: {
required: true,
witnesses: 1,
notarized: false
}
}FormParty Properties
FormSignature Properties
Builder Pattern
Chain methods to build a party incrementally:
All methods return PartyBuilder and are chainable.
Static Methods
Party Types
| Type | Description |
|---|---|
person | Individual person (natural person) |
organization | Company, business, or legal entity |
any | Either person or organization (default) |
Signature Requirements
Use the signature property to specify requirements for this party's signature:
// Basic signature requirement
party()
.label('Signer')
.signature({ required: true })
.build()
// With witnesses
party()
.label('Borrower')
.signature({ required: true, witnesses: 2 })
.build()
// Notarized signature
party()
.label('Affiant')
.signature({ required: true, notarized: true })
.build()
// Notarized with witness
party()
.label('Declarant')
.signature({ required: true, witnesses: 1, notarized: true })
.build()Multiple Parties
Allow multiple parties to fill a single role by setting max > 1:
const form = open.form()
.name('joint-account')
.party('accountHolders', party()
.label('Account Holders')
.min(1) // At least 1 required
.max(4) // Up to 4 allowed (enables array format)
.signature({ required: true }) // All must sign
.build())
.build()When max > 1, the party data at runtime must be an array:
const filled = form.fill({
fields: { /* ... */ },
parties: {
accountHolders: [
{ id: 'accountHolders-0', fullName: 'Jane Smith' },
{ id: 'accountHolders-1', fullName: 'John Smith' }
]
}
})Conditional Parties
Use logic expressions for conditional party requirements:
const form = open.form()
.name('loan-application')
.expr('needsGuarantor', 'loanAmount > 100000')
.party('borrower', party()
.label('Borrower')
.signature({ required: true })
.build())
.party('guarantor', party()
.label('Guarantor')
.required('needsGuarantor')
.signature({ required: true })
.build())
.build()Runtime Party Types
At runtime, parties are represented using the Party and RuntimeParty types.
Party
The base Party type is a union of Person or Organization:
type Party = Person | OrganizationParty type is inferred from shape:
- Person: Has
fullNameproperty - Organization: Has
nameproperty (withoutfullName)
RuntimeParty
RuntimeParty extends Party with a required id field for tracking in the execution context:
type RuntimeParty = (Person | Organization) & {
id: string // Unique identifier for this party
}The ID convention is {roleId}-{index}:
// Fill a form with party data (single parties)
const filled = form.fill({
fields: { /* ... */ },
parties: {
buyer: {
id: 'buyer-0', // Required ID
fullName: 'John Smith',
firstName: 'John',
lastName: 'Smith'
},
seller: {
id: 'seller-0', // Required ID
legalName: 'Acme Corporation, Inc.',
entityType: 'corporation'
}
}
})You can also use the primitive builders with the id field:
const filled = form.fill({
fields: { /* ... */ },
parties: {
buyer: {
id: 'buyer-0',
...open.person().fullName('John Smith').build()
},
seller: {
id: 'seller-0',
...open.organization()
.name('Acme Corp')
.legalName('Acme Corporation, Inc.')
.build()
}
}
})Related
- form - Parent form artifact
- person - Person primitive for filling party roles
- organization - Organization primitive for filling party roles
- signing - Signing flow and signature types
- Party Schema