Skip to content

Void

Request

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.

Security
AccessToken
Headers
Invoicestring, <= 10 charactersrequired

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
InterfaceVersionstring, <= 11 charactersrequired

Refers to the version of the program or application that is sending requests to Shift4. The following special characters are not allowed: $ % : ^ - ~ < > , ? “ ” ‘ ’ { } [ ] \ + =

Example:2.1
InterfaceNamestring, <= 25 charactersrequired

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: $ % : ^ - ~ ` < > , ? “ ” ‘ ’ { } [ ] \ + =

Example:ForwardPOS
CompanyNamestring, <= 26 charactersrequired

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: $ % : ^ - ~ ` < > , ? “ ” ‘ ’ { } [ ] \ + =

Example:PAWS
AccessTokenstring, (uuid), <= 52 charactersrequired

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
ReceiptColumnsinteger, <= 48 characters

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
ReversalReasonstring, = 2 characters

Specifies the reason for the reversal.

ValueDescription
01Timeout
02POS lost connection
03Merchant cancellation
04Customer cancellation
05EMV card removed prematurely
06EMV card declined issuer approval
07PIN PAD unavailable
08Chip error
09Suspected Fraud
Enum:"01""02""03""04""05""06""07""08""09"
Example:01
Tokenstring, <= 16 characters

This field is used to specify the token for the payment method.

Example:8048471746471119
curl -i -X DELETE \
  https://api.shift4test.com/api/rest/v1/transactions/invoice \
  -H 'AccessToken: YOUR_API_KEY_HERE' \
  -H 'CompanyName: PAWS' \
  -H 'InterfaceName: ForwardPOS' \
  -H 'InterfaceVersion: 2.1' \
  -H 'Invoice: 0510093358' \
  -H 'ReceiptColumns: 40' \
  -H 'ReversalReason: 01' \
  -H 'Token: 8048471746471119'

Responses

Transaction was processed

Bodyapplication/json
resultArray of objects
Response
{ "result": [ { "dateTime": "2024-05-21T09:18:23.283-07:00", "amount": { "total": 160 }, "card": { "entryMode": "M", "number": "XXXXXXXXXXXX1119", "type": "VS", "token": { … } }, "merchant": { "mid": 15877, "name": "Merchant XYZ" }, "receipt": [ { … }, { … }, { … }, { … }, { … }, { … }, { … } ], "server": { "name": "TM01CE" }, "transaction": { "authorizationCode": "198399", "authSource": "E", "hostResponse": { … }, "invoice": "0510093358", "responseCode": "A", "saleFlag": "S", "deferredAuth": "D" }, "payment": { "accountReference": "05280D8G7Q04UZBI7NOSPGSURP130" } } ] }