# Void

Used to void and reverse an invoice. This will attempt to reverse the transaction with the processor and will mark the transaction as voided in Shift4's Gateway. 

Note: The DELETE request does not support a request body. Sending an empty request body may result in an error.

Integration Methods:
- Host Direct
- Locally Installed UTG
- Commerce Engine For On Premise
- Commerce Engine For Cloud

See the Integration Methods and URLs Section sections of the Development Quick Start guide for details regarding each processing option.

Endpoint: DELETE /transactions/invoice
Version: 1.7.56
Security: AccessToken

## Header parameters:

  - `Invoice` (string, required)
    10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway.

Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.

For processing outside of the US and Canada alpha characters are allowed.
    Example: "0510093358"

  - `InterfaceVersion` (string, required)
    Refers to the version of the program or application that is sending requests to Shift4. The following special characters are not allowed&colon;  $ % &colon; ^ - ~  , ? “ ” ‘ ’ { } [ ] \ + =
    Example: "2.1"

  - `InterfaceName` (string, required)
    Refers to the name of the program or application that is sending requests to Shift4. This should be the name of the program that you purchased or created. The following special characters are not allowed&colon;  $ % &colon; ^ - ~ `  , ? “ ” ‘ ’ { } [ ] \ + =
    Example: "ForwardPOS"

  - `CompanyName` (string, required)
    Refers to the vendor or partner that designed and certified the interface. The information you use in this field should match what Shift4 has on file or what was agreed upon in your Integration Plan. The following special characters are not allowed&colon;  $ % &colon; ^ - ~ `  , ? “ ” ‘ ’ { } [ ] \ + =
    Example: "PAWS"

  - `AccessToken` (string, required)
    A security credential used to authenticate API requests and all i4Go® authorizeClient/preauthorizeClient requests. An Access Token is the alias for the merchant account and interface being used. The Access Token is required in all requests except an Access Token Exchange request, which generates an Access Token using an authToken and clientGuid.
    Example: "EA79FB05-3AA7-4500-AF9A-73F986FF2C1D"

  - `ReceiptColumns` (integer)
    Send this field if you want Shift4 to format the receipt text instead of returning individual fields. The value sent will correlate to the column width of the formatted receipt that we return. (This also allows the receipt text to wrap to fit the paper size of the printed receipt.) See the Printing Receipts section of this document for more information on formatted receipts.
    Example: 40

  - `ReversalReason` (string)
    Specifies the reason for the reversal.

Value|Description
-----|-----------
01   | Timeout
02   | POS lost connection
03   | Merchant cancellation
04   | Customer cancellation
05   | EMV card removed prematurely
06   | EMV card declined issuer approval
07   | PIN PAD unavailable
08   | Chip error
09   | Suspected Fraud
    Enum: "01", "02", "03", "04", "05", "06", "07", "08", "09"

  - `Token` (string)
    This field is used to specify the token for the payment method.
    Example: "8048471746471119"

## Response 200 fields (application/json):

  - `result` (array)

  - `result.dateTime` (string)
    The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm).

Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00

  - `result.amount` (object)

  - `result.amount.total` (number)
    The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.

  - `result.card` (object)

  - `result.card.entryMode` (string)
    Conditional: The Card Entry Mode should be sent in an initial request; in subsequent requests, it should be left blank or not sent. When using a Universal Transaction Gateway® (UTG®)-controlled PIN pad, this field should be left blank or not sent in a request; the UTG will capture the card entry mode and return it in the response. When P2PE data is being sent from a non-UTG controlled device, this field is not needed

The method used to capture a payment card in an authorization/sale request. 

Value|Description
-----|-----------
1    | Track 1 Only or Dual Track (Track 1 & 2)
2    | Track 2 Only
C    | EMV Contactless via card or mobile wallet
E    | EMV Chip
M    | Manual Entry
Q    | QR Code
R    | Contactless MSD
    Enum: "1", "2", "C", "E", "M", "Q", "R"

  - `result.card.number` (string)
    The card number field will always be masked when returned in a response.

  - `result.card.type` (string)
    An abbreviation used to specify the type of card that was used when processing a transaction.

Value| Description
-----|------------
AX   | American Express
AP   | Alipay
BC   | Backed Card       
CI   | Citgo        
DB   | Debit card
GC   | Gift Card
JC   | JCB
MC   | Mastercard
NS   | Discover/JCB/Novus
PL   | Private Label
SC   | Sears Canada
VS   | Visa
WP   | WeChat Pay
YC   | IT’S YOUR CARD
    Enum: "AX", "AP", "BC", "CI", "DB", "GC", "JC", "MC", "NS", "PL", "SC", "VS", "WP", "YC"

  - `result.card.token` (object)

  - `result.card.token.value` (string)
    This field is used to specify a card token. Whenever CHD is sent in a request, a card token will be returned in this field. Your interface should be designed to store this card token for future use. The latest card token received should be used in any subsequent request that references the same card data.

  - `result.merchant` (object)

  - `result.merchant.mid` (number)
    The merchant ID associated with the merchant account.

  - `result.merchant.name` (string)
    The merchant’s business name as configured with Shift4.

  - `result.receipt` (array)
    Array of receipt key/value pairs that should be printed on the receipt.

  - `result.receipt.key` (string)
    The identifier the interface vendor can use to programmatically determine where to print a specific value.
    Example: "ApplicationIdentifier"

  - `result.receipt.printName` (string)
    The label that relates to the printValue field. When present in the response, this must be printed to the left of the printValue.
    Example: "AID"

  - `result.receipt.printValue` (string)
    The value that relates to the printName field. This must be printed to the right of the printName.
    Example: "AID"

  - `result.server` (object)

  - `result.server.name` (string)
    The name of the server that processed the request.

  - `result.transaction` (object)

  - `result.transaction.authorizationCode` (string)
    The authorization code provided by the consumer’s issuing bank. It is provided in a response if an online authorization or sale request is approved. Following a referral response, it is also specified in [Manual Sale](/apis/payments-platform-rest/openapi/transactions/manualsale) requests.

  - `result.transaction.authSource` (string)
    In a response, a code returned by the processor to indicate which host issued the response.

Value  | Description       
-------|----------------------------
E      | Engine (Online)
O      | Offline
A      | APM (Online)
F      | Payment Platform (Online)
    Enum: "E", "O", "A", "F"

  - `result.transaction.hostResponse` (object)
    Returns the response code detailing why the transaction was declined. 

Notes:
  - For Visa, the response codes are categorized, detailing how declined transactions may be re-attempted for approval. To avoid fees, merchants are responsible for preventing additional attempts based on  the information returned.
  - Support for this field is dependent on the processor. Our demo environment does not return this field in the response.

  - `result.transaction.hostResponse.reasonCode` (string)
    Returns a response code from the host.

Value |Category|Description
------|--------|-----------
04    |      1 | Pick Up Card
07    |      1 | Pick Up Card, Special Condition
12    |      1 | Invalid Transaction
15    |      1 | No Such Issuer
41    |      1 | Lost Card
43    |      1 | Stolen Card
46    |      1 | Closed Account        
57    |      1 | Trans. not Permitted to Cardholder
R0    |      1 | Stop Payment Order
R1    |      1 | Revocation of Auth Order
R3    |      1 | Revocation of all Authorization 
03    |      2 | Invalid Merchant
19    |      2 | Re-enter Transaction
51    |      2 | Not sufficient funds
59    |      2 | Suspected Fraud
61    |      2 | Exceeds approval amount limit
62    |      2 | Restricted Card (card invalid in region or country)
65    |      2 | Exceeds withdrawal frequency limit
75    |      2 | Allowable number of PIN-entry tried exceeded
78    |      2 | Blocked, first used
86    |      2 | Cannot Verify PIN
91    |      2 | Issuer or switch inoperative
93    |      2 | Transaction cannot be completed - violation of law 
96    |      2 | System malfunction
N3    |      2 | Cash service not available
N4    |      2 | Cash request exceeds issuer of approved limit
14    |      3 | Invalid Account
54    |      3 | Expired card or expiration date missing
55    |      3 | PIN incorrect or missing
70    |      3 | PIN data required
82    |      3 | Negative Online CAM, dCVV, iCVV, or CVV results
1A    |      3 | Additional customer authentication required
N7    |      3 | Decline for CVV2 Failure
05    |      4 | Do not honor
06    |      4 | General error 
08    |      4 | Honor MasterCard with ID
13    |      4 | Invalid amount 
21    |      4 | Invalid amount
30    |      4 | Format error
39    |      4 | No credit account
52    |      4 | No checking account
53    |      4 | No savings account
58    |      4 | Transaction not permitted-Terminal
63    |      4 | Security violation 
66    |      4 | Card Acceptor call Acquirer’s security dept
67    |      4 | Hard capture (requires ATM pick-up)
68    |      4 | Response received too late
71    |      4 | PIN Not Changed
76    |      4 | Unsolicited reversal
77    |      4 | Invalid Data including AVS failures.
79    |      4 | Already reversed at switch
80    |      4 | No Financial impact
81    |      4 | Cryptographic error 
92    |      4 | Unable to route transaction
94    |      4 | Duplicate Transaction
B1    |      4 | Surcharge amount not permitted on debit cards or EBTfoodstamps
B2    |      4 | Surcharge amount not supported by debit network issuer 
CV    |      4 | Card Type VerificationError
EA    |      4 | Acct Length Err
EB    |      4 | Check Digit Err
EC    |      4 | CID Format Error
HV    |      4 | Hierarchy Verification Error
N0    |      4 | Force STIP
P5    |      4 | PIN Change/Unblock failed
P6    |      4 | New PIN not accepted
Z3    |      4 | Unable to go online; offline-declined
\-38  |      4 | The transaction has been denied by the Gateway because 3D secure Authentication failed. Reason: {}Note: The “Reason” part is optional and may appear according to detected reason. |
D2    |      4 | Decline Retry Later

All other, generic declines may be classified as a Category 4 response code.

  - `result.transaction.hostResponse.reasonDescription` (string)
    Returns a description from the host.

  - `result.transaction.hostResponse.reattemptPermission` (string)
    Returns one of the following values:

Value                                   |Description
----------------------------------------|-----------
Reattempt not permitted                 | Returned when the reasonCode returned is classified as a Category 1 response code.
Reattempt permitted 15 times in 30 days | Returned when the reasonCode returned is classified as a Category 2 or Category 3 response code.
Reattempts permitted                    | Returned when the reasonCode returned is classified as a Category 4 response code.

  - `result.transaction.invoice` (string)
    10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway.

Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.

For processing outside of the US and Canada alpha characters are allowed.

  - `result.transaction.responseCode` (string)
    Code indicating the Shift4 host response.        

Value  | Description                                                                           | Details
-------|---------------------------------------------------------------------------------------|--------
A      | Approved                                                                              | The transaction is approved.
C      | Approved                                                                              | The transaction is approved without requiring additional authorization because it is less than or equal to a ceiling amount. (The ceiling amount is the original authorization amount multiplied by the tolerance per the merchant’s settings with Shift4.)
D      | Declined                                                                              | The transaction is declined. Note: Shift4 automatically declines AVS/CSC failures if the [POSHANDLEAVSFAIL Api Option](/guides/appendices/api-options#poshandleavsfail) was not sent in the request.
e      | [Error](/guides/appendices/error-codes)                                               | There is an error condition.
f      | [AVS or CSC failure](/guides/response-handling/understanding-avs-and-csc-verification)| An AVS or CSC failure has occurred (credit card only). Note: This value will only be returned if the [POSHANDLEAVSFAIL Api Option](/guides/appendices/api-options#poshandleavsfail) was sent in the request.
P      | [Partial approval](/guides/advanced-concepts/partial-approval)                        | A partial approval has occurred.  Check amount.total for the approved amount.
R      | Voice referral                                                                        | The transaction requires a voice referral.
[blank]| Status is unknown                                                                     | The approval status is unknown.
X      | Expired card                                                                          | There is an error condition due to the card being expired.
S      | SCA Online PIN required                                                               | The contactless EMV transaction requires strong customer authentication to continue. The terminal must gather the online PIN if supported by the device form factor and CVM list then resubmit the transaction request.
I      | SCA Interface switch required                                                         | The contactless EMV transaction requires strong customer authentication to continue. The terminal must look at the form factor indicator to determine if the transaction should be declined, switched to EMV contact or tapped again using CDCVM.
J      | Soft decline after exemption request                                                  | Transaction was soft declined. Returned when requesting an exemption by sending transaction.exemptionAction = 02 and the card issuer rejects the exemption.
    Enum: "A", "C", "D", "e", "f", "P", "R", "X", "S", "I"

  - `result.transaction.saleFlag` (string)
    Specifies a transaction is a sale (‘S’) or credit (‘C’).  In an [Invoice Information](/apis/payments-platform-rest/openapi/transactions/getinvoice) request, an 'A' may be returned to differentiate an authorization from a sale.
    Enum: "A", "C", "S"

  - `result.transaction.deferredAuth` (string)
    Conditional: Must be sent if the transaction is deferred

Specifies that a transaction is the result of a deferred authorization. For example, a transaction that was accepted while in an offline state and is being uploaded after coming back online.

Value  | Description       
-------|-----------------------------
D      | Transaction is a deferred authorization
    Enum: "D"

  - `result.payment` (object)

  - `result.payment.accountReference` (string)
    The Payment Account Reference (PAR) is a value assigned by the BIN Controller, which is defined as either an issuer or card brand. This field is associated directly with the cardholder's account. 


This value enables merchants, acquirers, and payment processors to link a payment token to a cardholder’s underlying payment account.

## Response 400 fields (application/json):

  - `result` (array)

  - `result.error` (object)

  - `result.error.code` (integer)
    Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details.

Note: This is currently only supported for European merchant processing.

  - `result.error.severity` (string)
    Severity level of the error.

| Severity | Description                                                       |
| -------- | ----------------------------------------------------------------  |
| Info     | Action not required - Data input/formatting is incorrect          |
| Error    | Action may be required - Communication, timeout or network issue  |
| Alert    | Action required - System issue                                    |
    Enum: "Info", "Error", "Alert"

  - `result.error.shortText` (string)
    Abbreviated error message that is always returned if an error condition exists

  - `result.error.longText` (string)
    Extended error message that is returned if an error condition exists.

  - `result.error.primaryCode` (integer)
    Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details.

  - `result.error.secondaryCode` (integer)
    This code supplements the code specified in the error.primaryCode field to provide additional information about the error that occurred.

  - `result.lighthouse` (object)

  - `result.lighthouse.data` (string)
    Base64 encoded JSON formatted data that will be returned from Lighthouse to be passed back to SkyTab. This data will contain variable information.

  - `result.server` (object)

## Response 504 fields (application/json):

  - `result` (array)

  - `result.error` (object)

  - `result.lighthouse` (object)

  - `result.lighthouse.data` (string)
    Base64 encoded JSON formatted data that will be returned from Lighthouse to be passed back to SkyTab. This data will contain variable information.

  - `result.server` (object)


