# Webhooks

> Receive and verify Onerway payment notifications, acknowledge and deduplicate them correctly, and fall back to query APIs when no notification arrives.

Onerway pushes the final results of payments, tokenization, subscriptions, pre-authorizations, and refunds to your server through webhooks. This page describes the notification handling contract shared by every integration method; the Checkout, Web SDK, and Direct API integration guides only add the notification types and additional considerations for that integration method.

The shared delivery, acknowledgement, and deduplication rules below apply to the six transaction notification types in the delivery table. Other events have separate acknowledgement or retry requirements; see [Other notifications](#other-notifications).

For signature selection and calculation for every event, see [Webhook signature verification](/payments/versions/v2/get-started/webhook-signatures). Request API Keys and notification signing keys are separate credentials.

## Source IP allowlist

Onerway sends all Payments webhooks from the following IP addresses. If your webhook endpoint restricts source IP addresses, allow all addresses for the corresponding environment in your firewall, WAF, or gateway.

| Environment | Webhook source IP addresses |
| --- | --- |
| Sandbox | `27.109.125.90` |
| Production | `20.68.8.122`<br /><br>`18.207.78.37`<br /><br>`52.70.96.9`<br /><br>`54.160.200.158`<br /><br>`44.219.164.167` |

You must still verify signatures as required for each webhook type after allowing these IP addresses.

## Delivery

Onerway sends notifications via HTTP POST to the `notifyUrl` submitted when the transaction was created. The payload for each scenario is documented separately:

| Webhook | Scenario |
| --- | --- |
| [Payment result webhook](/payments/versions/v2/api-reference/webhooks/payment-result) | Ordinary payments that succeeded, failed, timed out, or were canceled |
| [Saved payment method result webhook](/payments/versions/v2/api-reference/webhooks/payment-method-result) | Results of saving a payment method (tokenization, `txnType=BIND_CARD`) |
| [Subscription payment webhook](/payments/versions/v2/api-reference/webhooks/subscription-payment) | Subscription payment events such as initial subscription, renewal, and change |
| [Authorization, capture, and void webhook](/payments/versions/v2/api-reference/webhooks/authorization-capture) | Pre-authorization (`txnType=AUTH`), capture (`txnType=CAPTURE`), and void (`txnType=VOID`) results |
| [Refund result webhook](/payments/versions/v2/api-reference/webhooks/refund-result) | Refund results (`txnType=REFUND`) |
| [Refund request rejection webhook](/payments/versions/v2/api-reference/webhooks/refund-audit-rejected) | A refund request rejected by Onerway (`notifyType=REFUND_AUDIT`) |

Refund notifications are sent to the original transaction’s `notifyUrl`. Onerway sends `REFUND_AUDIT` only when it rejects a refund request during review. A successful cancellation of a refund request does not trigger a notification; use the [Create or cancel refund](/payments/versions/v2/api-reference/endpoints/create-or-cancel-refund) response.

Confirm payment results through Webhooks or query APIs. Do not treat a redirect to `returnUrl` or a client-side event as confirmation that a payment succeeded. For a refund request (`refundType=0`), `respCode=20000` means that Onerway accepted the request; it does not mean that the refund succeeded.

## Verify the signature

Verify the notifications in the table above using `x-signature` as described in [Webhook signature verification](/payments/versions/v2/get-started/webhook-signatures). Do not use a retained body `sign` as a substitute for the required header signature.

If the signature header selected for an event is missing or verification fails, do not use the notification to update payment or case records. Do not automatically try a different signature header or the body `sign`; verify the result through the appropriate server-side query API.

## Acknowledge and retries

For the six notification types in the delivery table, after verification and processing, return HTTP 200 with `Content-Type: text/plain` and the notification's `transactionId` unchanged in the response body. Without a successful response, Onerway retries at 30-minute intervals, up to 3 times.

## Other notifications

Use the event-specific acknowledgement and retry rules for these notifications:

| Event | Acknowledgement and handling |
| --- | --- |
| [Subscription canceled](/payments/versions/v2/api-reference/webhooks/subscription-canceled) | Use `x-signature`. After accepting the notification, return HTTP 200 with `Content-Type: text/plain` and the received `transactionId` unchanged. This is a separate event (`notifyType=SUBSCRIPTION_CANCELED`), not a subscription payment result. |
| [Chargeback status changed](/payments/versions/v2/api-reference/webhooks/chargeback-status-changed) | Use `x-signature` and return HTTP 200 with the received `transactionId` as plain text. Onerway does not retry this event. Process later status changes for the same chargeback; see [Chargebacks and alerts](/payments/versions/v2/online-payments/scenarios/disputes-and-alerts). |
| [Fraud alert](/payments/versions/v2/api-reference/webhooks/fraud-alert) | We recommend verifying with `x-signature`. Return HTTP 200 with `20000` in the response body. Deduplicate by `notificationId`. |
| [Ethoca alert](/payments/versions/v2/api-reference/webhooks/ethoca-alert-created), [Ethoca enrollment status](/payments/versions/v2/api-reference/webhooks/ethoca-enrollment-changed), and [RDR enrollment status](/payments/versions/v2/api-reference/webhooks/rdr-enrollment-changed) | We recommend verifying with `x-signature`. Return HTTP 200 with the exact plain-text body `20000`, without quotes, whitespace, or a trailing newline. There are up to 6 application-level attempts including the first, with waits of 5, 10, 20, 40, and 60 seconds; I/O retries are counted separately. Follow [Agency alert services](/payments/versions/v2/online-payments/scenarios/agency-alerts) for matching records and processing status changes. |
| [Chargeback alert](/payments/versions/v2/api-reference/webhooks/chargeback-alert-created) | We recommend verifying with `x-signature`. Return HTTP 200 with the exact received `predisputeId`, without quotes, whitespace, or a newline. On failure or an invalid acknowledgement, Onerway retries every 30 minutes, up to 2 times. Deduplicate by `predisputeId`. |
| [Profit share and reversal result](/payments/versions/v2/api-reference/webhooks/profit-share-result) | Verify `x-signature` and return HTTP 200 after accepting the notification. The response body can be empty. Use its API Reference for notification URLs. |

Notification URLs for fraud and chargeback alerts and for Ethoca/RDR services are configured separately from transaction `notifyUrl`. These events carry the `x-signature`, `X-Rh-Signature`, and `x-timestamp` headers. We recommend using `x-signature` for verification; `X-Rh-Signature` is retained for compatibility. Do not apply their rules to chargeback status changes, which are delivered to the original transaction's `notifyUrl` and use `x-signature`.

Automatic retries reuse the cached notification body and signatures while refreshing the unsigned `x-timestamp`. When a transaction notification is resent manually, Onerway signs it again using the webhook signing keys enabled at the time of the resend. Apply the event's deduplication rules; the timestamp alone does not provide replay protection. See [Webhook signature verification](/payments/versions/v2/get-started/webhook-signatures#retries-and-signing-key-rotation).

## Deduplicate

A single transaction may receive multiple notifications. Handle them idempotently by `transactionId`: process a repeated notification with the same `transactionId` only once, but still acknowledge it.

Tokenization, subscription-with-binding, and pre-authorization flows with a later capture or void produce several related notifications with different `transactionId` values. Handle each idempotently on its own and associate them with the same payment intent or subscription contract through business identifiers such as `paymentId` and `contractId`.

## Interpret the status

- `status` is the result of the current operation, such as `S` for success and `F` for failure.
- `paymentStatus` is the payment intent state, such as `A` after a successful pre-authorization, `S` after a successful capture, and `N` (closed) after a successful void.

For pre-authorization, capture, and void results, use `paymentId` plus `paymentStatus` to determine whether the funds are held, captured, or released. Process a refund result using its refund `transactionId` and `status`. See the API Reference page of each webhook for the corresponding fields and values.

## Handle differences between query results and Webhooks

These rules apply to payments, refunds, and other scenarios. When a query result differs from a Webhook that has passed signature verification, compare results for the same transaction and operation:

- Use the Webhook result if the query returns a status other than success (`S`) or failure (`F`), but the Webhook reports success or failure.
- Otherwise, use the query result, including when the query returns success (`S`) or failure (`F`).

## Query results when needed

Once you receive and verify a Webhook reporting success (`S`) or failure (`F`), process the corresponding payment or refund result. No confirming query is needed.

For payments, if the customer has returned to your page but no Webhook has arrived, or you need to reconcile records, you can query at increasing intervals until the query returns success (`S`) or failure (`F`), or a Webhook arrives.

For refunds, wait for a Webhook; continuous polling is not required. When you need to check progress or reconcile records, use [Query refunds](/payments/versions/v2/api-reference/endpoints/query-refunds) with the refund transaction ID or the original payment transaction ID.

For payment results, the query API depends on the integration method: the Checkout and Direct API integrations use [Query transactions](/payments/versions/v2/api-reference/endpoints/query-transactions); the Web SDK integration calls [Query payments](/payments/versions/v2/api-reference/endpoints/query-payments) with the `paymentId` saved when the payment was created.

## Go-live checklist

- If your webhook endpoint restricts source IP addresses, all production webhook source IP addresses are allowed.
- The notifications in the delivery table are verified with `x-signature`. Other events use a signature header selected according to their API Reference. Notifications that cannot be verified are not used to update payment or case records and do not trigger automatic verification with a different header or the body `sign`.
- For the notifications in the table above, your endpoint returns HTTP 200 with the `transactionId` after processing and deduplicates by `transactionId`.
- Your webhook endpoint accepts every notification type involved in the scenarios you use.
- Success, failure, and retry scenarios are verified in the sandbox with the [test cards](/payments/versions/v2/get-started/testing).
