Save a submission
Use case: persist FieldStore values as a form submission. Keys must be
field_name, not labels or element ids.
Prerequisites
- Exchange succeeded (Authentication).
page.getloaded the store for thispage_id.- Key scope
forms.submissions:write.
Payload
Gateway operation forms.submissions.save. The SDK wraps
page_id and field_values in params.payload.
{
"page_id": "uuid-of-published-form",
"field_values": {
"mood": "ok",
"notes": "slept well"
}
}
Optional: title, subject_id, subject_type.
JavaScript
await client.submissions.save({
page_id: pageId,
field_values: client.store.values()
})
store.values() is a map of field_name → current value.
Empty fields are omitted unless you set them.
Swift
let saved = try await client.submissionsSave(
pageId: pageId,
fieldValues: client.store.values
)
If your checkout predates submissionsSave, call the same operation
through gateway("forms.submissions.save", params: ["payload": payload]).
Read back
const row = await client.submissions.get(saved.id)
// Swift: try await client.submissionsGet(id)
Limits
- Saving does not publish a form. The template page must already be published.
- Unknown
field_namekeys are ignored or rejected by the server — do not invent names from labels.