➿ Prevent Duplicates
When integrating with our API to process direct charges, it is important to safeguard against duplicate transactions [עסקאות כפולות] caused by network retries, application timeouts, or user errors.
Important Notes on Payment Pages [דפי תשלום]
API Integration: Set
PreventDuplicates = truein your API payload to enable duplicate transaction checks.Scope: Duplicate transaction checks are evaluated per קופה (Credit Box Identifier).
Payment Pages & GetUrl [דפי תשלום]: For
GetUrl, duplicate prevention is not set in the request payload; it must be enabled directly in your iCredit account settings under:רשימת דפי תשלום 👈 ערוך 👈 הגדרות הדף 👈 ממשקים לדף תשלום 👈 מניעת חיובים כפולים (לבחור "כן")
How Duplicate Prevention Works
Duplicate prevention relies on checking unique transaction identifiers (RequestReference or UniqueNum).
1. Basic Duplicate Check (Same Transmission Cycle [מחזור שידור])
When PreventDuplicates = true is passed, the system verifies whether the unique transaction reference has already been processed during the current transmission cycle.
- Automatic Key Generation: Providing
RequestReferenceis optional. If you do not pass aRequestReference, the system automatically generates an internal reference key to ensure the charge is checked for duplicates during the active transmission cycle. - Error Response: If a duplicate is detected, the API rejects the request and returns:
"ErrorMessage": "רשומה כפולה" - Transmission Reset Behavior [איפוס לאחר שידור]: Standard duplicate checking is valid only until the next transmission (whether triggered manually or automatically, e.g., daily). Once a transmission occurs, the history resets.
2. Advanced Protection: LookbackDays Parameter ⏪
LookbackDays Parameter ⏪To prevent duplicate charges across multiple transmission cycles [מחזורי שידור], pass the LookbackDays parameter in your request.
When specified, LookbackDays forces the API to inspect past transactions for matching UniqueNum or RequestReference values going back X days, regardless of whether a transmission [שידור עסקאות] has occurred.
- Coverage: Checks for duplicates using either or both
UniqueNum(visible in the iCredit dashboard under דו"ח עסקאות) andRequestReference. - Transaction Filter (
ParamJ&SaleType): For methods supporting transaction types (ChargeSimpleandChargeSimple/Full), the look-back duplicate check applies only to direct charges (ParamJ = 0/ standard charge). Pending transactions (ParamJ = 5orSaleType = 2/ עסקה ממתינה) are excluded from this check and will not trigger a duplicate alert. - Error Response: If a duplicate charge is found within the specified day window, the API rejects the request and returns:
"ErrorMessage": "רשומה כפולה (lookback)"
Request Parameters Summary
| Parameter | Type | Required | Description |
|---|---|---|---|
PreventDuplicates | boolean | YES | Set to true to activate duplicate checking. |
RequestReference | string | Optional | A unique idempotency key (e.g., UUID or order ID). If omitted, the system generates an internal key automatically. |
UniqueNum | string | Optional | Unique transaction identifier (visible in דו"ח עסקאות). Supported in ChargeSimple / Full, and newly available in GetUrl and SaleChargeToken. |
LookbackDays | integer | Optional | Scans past direct charges up to X days back for matching RequestReference or UniqueNum values, bypassing transmission resets. For ChargeSimple / Full, applies only when ParamJ = 0 (excludes ParamJ = 5 and SaleType = 2). |
Supported API Methods
ChargeSimpleChargeSimple/FullSaleChargeTokenGetUrl
Updated 21 days ago
