Skip to content

createState

createState(session, definition, options?): Promise<StateCreationOutcome>

Defined in: packages/simply-settings-core/src/address/createStates.ts:122

Adds one state through Setup’s “Configure New State” form: loads the form for the state’s country, fills it in, and posts it back.

Never throws for a per-state problem — that’s reported as a failed outcome, so one bad state doesn’t stop a run of thousands. Transport failures are retried first; re-posting is safe because a retry of a POST that did land comes back as a duplicate (exists).

SetupSession

An open Setup session.

StateDefinition

The state to add.

CreateStateOptions = {}

Retry tuning.

Promise<StateCreationOutcome>

The outcome.