Idempotency in payments
Every way HyoNova Commerce makes repeated requests, retried webhooks and concurrent workers safe — keys, unique records, versions and once-only notifications.
Payments are retried by browsers, networks, providers and workers. HyoNova Commerce is built so that doing something twice has the same effect as doing it once.
Request keys#
Money actions that a client may retry send an Idempotency-Key header of 16 to 100 characters (letters, digits, _ . : -). A missing or malformed key is refused with IDEMPOTENCY_KEY_REQUIRED.
| Action | Unique per | Repeat returns |
|---|---|---|
| Start a checkout | Company + key | The checkout already created |
| Confirm a bank payment | Company + key | The payment already recorded |
| Request a refund | Company + key | The refund already requested (a key reused for another payment is refused) |
Unique records#
| Guard | Effect |
|---|---|
| One open checkout per company (one for plans and invoices, one for purchases) | A second checkout while one is unfinished is refused with CHECKOUT_IN_PROGRESS; the app offers to continue it or cancel it. Paying the same invoice again replaces the unfinished attempt |
| Provider event key (provider, event id) | A retried webhook is a duplicate |
| Provider payment, order, invoice and refund references | The same provider object is never recorded twice |
| One open refund per payment | REFUND_ALREADY_EXISTS |
| Billing timeline key per company | The same change is never logged — or notified — twice |
| One email per event and recipient | A billing notice is never emailed twice to the same person |
| Invoice numbers | Taken under a row lock: never skipped, never repeated |
Calls to providers#
HyoNova passes its own ids as idempotency keys to providers — the checkout id for a checkout, the refund id for a refund, and <subscription>:<version>-style keys for subscription changes, cancellations and resumptions. Outbound calls are retried only when they are safe to repeat: reads, or writes the provider deduplicates by key.
Versions#
Subscription, invoice, billing profile, provider and routing changes carry the version the caller last read. A stale version is refused (SUBSCRIPTION_CONFLICT or RESOURCE_VERSION_CONFLICT) so two people never overwrite each other.
Workers#
Billing maintenance runs in one worker at a time (a database advisory lock) and at most once a minute; every change it makes uses the same timeline keys, so a repeated run changes nothing.
Was this page helpful?
Thanks. Page ratings are not collected yet, so nothing was sent. If something is missing or wrong, see the Get help page.