cancelDeal
Overview
The cancelDeal command cancels a payment transaction that has not yet been transmitted to Shva (Israel's payment processor). This operation can only be performed on transactions that remain in "Approved, pending transmission" status.
Unlike refunds, cancellations must be for the full transaction amount and can only be performed before the daily transmission to Shva (typically occurring around 11:00 PM). Once transmitted, you must use refundDeal instead.
Use cases
Cancel pre-transmission transactions: Cancel transactions before Shva transmission (typically before 11:00 PM daily cutoff)
Two-phase commit cancellations: Cancel approval (J5) requests in two-phase commits
Full-amount reversals: Only full transaction amounts can be cancelled (partial cancellations not supported)
Payment page cancellations: Handle cancellations from payment page integration
Request structure
For a comprehensive overview of the API request format and authentication, see API Request & Response General Structure.
Send a standard Hyp API request to your assigned server endpoint with the cancelDeal command in the int_in parameter.
Server Endpoints: Use the server endpoint provided during merchant onboarding (e.g., https://your-hyp-environment-url/xpo/Relay).
XML payload structure
Required parameters
At least one of the following three parameters must be provided:
Optional parameters
Response structure
Successful response
A successful cancelDeal response contains transaction details and confirmation of cancellation:
Key Response Fields:
result:000indicates successful cancellationtranId: New transaction ID for the cancellationtransactionType: ShowsCancel(code 52)total: Amount that was cancelledcgUid: Links to original transaction
Error response
Error responses include specific error codes and messages. The response contains many fields, most of which will be empty for error cases. The key fields to focus on are result, message, userMessage, status, and statusText:
Code examples
Error codes
310
No debit deal matches the credit deal
Verify lookup parameters match an existing transaction
312
No transaction found for canceling
Check transaction ID and lookup criteria
313
Transaction has already been transmitted
Use refundDeal instead for transmitted transactions
314
Transaction has already been canceled
Transaction was previously cancelled successfully
317
Missing required parameters
Ensure at least one lookup element is provided
320
Credit transaction already performed
Cannot cancel transactions that already have credits
332
Multiple transactions found
Use more specific lookup criteria or enable "Block multiple matches" terminal setting
Related commands
refundDeal- Refund transmitted transactions (automatically falls back to cancel when appropriate)doDeal- Process initial payment transactionsRequest Structure - General API request format
Refunds & Cancellations - Detailed guide on when to use each operation
Last updated
Was this helpful?