Paired confirmations
Build delivery handovers, collections, and approvals with two ready-to-use pages: one shows a code to a specific signed-in user, and the other lets someone enter that code to complete the confirmation. Both pages use your site's host and branding.
Create a pair
Call confirmation.create from a guarded FRL endpoint or event. Check that the caller may arrange the confirmation before creating it.
Rule input (JSON)
Use a complete version 2 rule file. Select a post with “postType” and “action”, or an “endpoint” by name. Saved data, jobs, payments and email need the local server. Dedupe replay protection also needs a site.
Check complete rules or run schemas, permissions, hooks and calculations against the input above. Add excerpts to a complete rule before running.
| Option | Meaning |
|---|---|
userId | Required existing site user. Only this user may view the code. |
key | Optional site-scoped key, up to 200 characters. Repeated creation returns the same pair. Omit it to create a new pair each time. |
expiresIn | Minimum lifetime in seconds. Defaults to 30 days; accepts five minutes through two years. |
expiresAt | Optional ISO date and time. When supplied with expiresIn, the pair expires at whichever is later, within two years of creation. |
printLabel | Optional printable-card heading, up to 80 characters. Defaults to “Scan to confirm”. |
The returned object contains id, userId, key, status, createdAt, expiresAt, completedAt, viewUrl, confirmationUrl, printLabel, and codeName. Dates are ISO strings; completedAt is null until completion. The code itself is never returned by create.
codeName is a readable name for matching both sides of a handover. Save it on the related record when you want to show it in your theme. The hosted pages and printable cards show the same name. It is not a secret and never replaces the private six-digit code. Names are unique among active pairs on a site, and can be reused after a pair completes, is cancelled, or expires. Repeating a key returns the original pair and its original name.
Example links:
Save the ID and code-view URL on the related record. Keep confirmationUrl in a field with visibility: "backend", and return it only through an endpoint that checks the admin's permission. Anyone given that link can submit a code for that confirmation, without an admin account. The link never reveals the code or grants access to orders or customer details.
A key remains attached to its original pair after completion, cancellation, or expiry. Reusing it with another user fails. For a replacement, cancel the original pair and deliberately choose a new key.
Use the hosted pages
Link the customer to viewUrl. If the assigned user is already signed in on the site, their code appears immediately. Signed-out visitors see sign-in; a different signed-in user sees Unauthorised. The page includes a general caution to share the code only when ready to confirm.
Link the admin or recipient of the shared link to confirmationUrl. They can enter the six-digit code, copy the link, share it through WhatsApp, or download a printable PDF or PNG card. The QR contains the confirmation URL, never the customer's code. Cards show the site name, web address, and contact details enabled for public display in site settings.
Opening either page does not complete anything. Successful entry consumes the confirmation; duplicate submissions do not fire the event again. Five incorrect entries lock further attempts. Cancel a locked pair and create a replacement with a new key when necessary.
Respond with FRL
Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →
$confirmation contains id, userId, the optional key, codeName, and completedAt. $actor represents the assigned user. $action.type is confirmation, $action.name is completed, and $action.isConfirmation is true.
Confirmation consumption and related database writes succeed together. If the event fails, the pair remains pending so the same code can be retried. External HTTP effects should use the confirmation ID as an idempotency key in case a failed event is retried.
Each pair has one private code and a separate page for entering it. Create independent pairs when a workflow needs multiple handovers or confirmations.
The pages are generic: your FRL event decides whether completion means an order was received, an item was collected, or another handover was accepted. The wig-store theme demonstrates partial shipments using its own record schemas and endpoints: atomic protects the remaining quantities and saves each package with its own confirmation pair. Its confirmation completed handler updates that package and the order. You can compose the same APIs for collections, equipment handovers, or service approvals.
Cancel a pair
Call confirmation.cancel(id) in a guarded endpoint or event. It revokes a pending pair and returns its current details. A completed confirmation remains completed. Cancellation does not fire confirmation completed.