Testing Voids
Voids cannot be performed on pre authorisations that have been collected (partial or full).
Card Void Scenarios (Positive Flow)
Important to Consider
-
Ensure the Preauth Transactions permission is enabled on your API credentials.
-
Ensure you have the correct receiptId for the original pre authorisation.
-
This is required for you to process the void.
-
-
Voids cannot be performed on pre authorisations that have expired, or been collected (partial or full).
To simulate voiding a pre authorised transaction:
Suggested Test Scenario |
Expected Outcome | Tip |
---|---|---|
Process a void on the full preAuth amount. |
200 Successful |
Ensure you have the correct receiptId for the original pre authorisation. |
Request:
Sandbox endpoint: https://api-sandbox.judopay.com/transactions/voids
HTTP Method: POST

API-Version: |
6.20
For the latest version of the Judopay Transaction API, see Latest Version. |
|||
Content-Type: |
application/json |
|||
Accept: |
application/json |
|||
Authorization Method TokenSecretAuth |
In the Authorization Header:
Example: Basic
Replace {
Example: MzPdkQK1mGi8v3ky:y158n4732dfc7595a149a20381f7af2ea2e70gr6df794b8rnwc019cc5f799kk3 |
Body Parameters:

Parameter |
Description |
---|---|
receiptId String Required |
Judopay's reference for the pre authorisation that is to be voided. |
amount Number Required |
The amount to void, must match the amount of the original pre authorisation. Format:
For currencies using a different structure please contact Judopay for support. |
currency String Required |
If specified, the currency must match the original pre authorisation. If not specified, the currency of the original pre authorisation will be used. Any ISO 4217 alphabetic currency code:
|
yourPaymentReference String Required |
Your unique reference for this void Format:
This is not the yourPaymentReference of the original pre authorisation. |
yourPaymentMetaData String Optional |
Key-value map for additional metadata associated with this transaction. Will be stored but not processed or passed to gateways. Do not include sensitive information like card numbers. |
Request Example:
Response
Response Example:
Card Void Scenarios (Negative Flow)
Declines can occur for various reasons, it can be impossible to simulate all the negative flows in a sandbox environment.
Important to Consider:
-
How your app handles negative flows
-
Your customer's experience should a negative flow occur:
-
Logic to communicate error messages
-
Customise how your app responds
-
-
How to maintain application consistency
Follow our suggested guidelines to simulate negative scenarios, to test your app’s error handling:
Suggested Negative Test Scenario |
Expected Error Code |
Error Description |
---|---|---|
Attempt to void a preAuth that has already been voided. |
51 |
Sorry, but it looks like the transaction you are trying to void has already been voided. |
Attempt to void a preAuth that has already been collected. |
52 |
Sorry, but it looks like the transaction you are trying to void has already been collected. |
Attempt to void an amount that is different to the preAuth amount. |
53 |
Sorry, but it looks like the void you are trying to process is for a different amount than the original preauth. |
Attempt to void an expired preAuth . |
42 |
Sorry, it looks like the PreAuth you are referencing has expired. |
Attempt to void using the receiptId for a payment instead of a preAuth. |
68 |
Sorry, but your void request is not valid. Please check your details and try again. |
Where the codes remain fixed, the descriptions may change. You should not build any error handling logic based on these descriptions.
For a list of possible error codes, types and descriptions, see Error Codes and Descriptions
Related Topics