# Balance

This function requests that a gift card's balance, masked card number, expiration date, and discount percentage be returned. Merchants may be required to pay a fee for an inquiry request depending on their processor agreement.

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.

See the JSON Body Schemas for more details on the various JSON body formats.

Endpoint: POST /giftcards/balance
Version: 1.7.56
Security: AccessToken

## Header parameters:

  - `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"

## Request fields (application/json):

  - `body` (object, required) — one of:
    - Commerce Engine For On Premise:
      - `dateTime` (string, required)
        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
        Example: "2021-04-15T09:18:23.283-07:00"
      - `card` (object, required)
        Example: {"present":"Y"}
      - `card.present` (string, required)
        Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
        Enum: "Y", "N"
      - `transaction` (object, required)
        Example: {"invoice":"192029"}
      - `transaction.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: "192029"
      - `device` (object)
      - `device.terminalId` (string)
        This field is optional and is for backwards compatibility with existing vendors that are used to processing via UTG controlled devices.

Since Commerce Engine is running directly on the payment device it does not require a device.terminalId to be specified.
      - `apiOptions` (array)
        API Options modify the request being made.

Value      | Description                                                |
-----------|------------------------------------------------------------|
RETURNHIST | Return the gift card usage history in the history array. |
    - Commerce Engine For Cloud:
      - `dateTime` (string, required)
        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
        Example: "2021-04-15T09:18:23.283-07:00"
      - `device` (object, required)
        Example: {"cloud":true,"manufacturer":"PAX","serialNumber":"1170301234"}
      - `device.cloud` (boolean, required)
        Indicates the transaction will be processed via the Commerce Engine solution for cloud based POS/PMS systems. Value must be sent as true in order to route the request to the payment device at the merchant location.
        Example: true
      - `device.manufacturer` (string, required)
        Specifies the company which manufactured the device.
        Enum: "Ingenico", "Innowi", "PAX", "Verifone", "Castles", "Miura"
      - `device.serialNumber` (string, required)
        Specifies the serial number of the device.
        Example: "1170301234"
      - `card` (object, required)
        Example: {"present":"Y"}
      - `card.present` (string, required)
        Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `transaction` (object, required)
        Example: {"invoice":"192029"}
      - `transaction.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: "192029"
      - `apiOptions` (array)
        API Options modify the request being made.

Value      | Description                                                |
-----------|------------------------------------------------------------|
RETURNHIST | Return the gift card usage history in the history array. |
    - UTG Controlled Device:
      - `dateTime` (string, required)
        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
        Example: "2021-04-15T09:18:23.283-07:00"
      - `device` (object, required)
        Example: {"terminalId":"1742"}
      - `device.terminalId` (string, required)
        To prompt a specific UTG-controlled PIN pad in a request, the API Terminal ID configured in UTG TuneUp must be specified in this field.
        Example: "1742"
      - `device.promptCardSecurityCode` (string)
        When using a UTG-controlled PIN pad:

Value|Description
-----|-----------
Y    | Force the PIN pad to prompt the consumer for a CSC.
N    | Do not force the PIN pad to prompt the consumer for a CSC.

Note: Use only when you want to override MCE (Manual Card Entry) settings in UTG.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `card` (object, required)
        Example: {"present":"Y"}
      - `card.present` (string, required)
        Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `transaction` (object, required)
        Example: {"invoice":"192029"}
      - `transaction.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: "192029"
      - `apiOptions` (array)
        API Options modify the request being made.

Value      | Description                                                |
-----------|------------------------------------------------------------|
RETURNHIST | Return the gift card usage history in the history array. |
    - GTV Token:
      - `dateTime` (string, required)
        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
        Example: "2021-04-15T09:18:23.283-07:00"
      - `card` (object, required)
        Example: {"present":"Y","expirationDate":1225,"token":{"value":"8900004710343233"}}
      - `card.present` (string, required)
        Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `card.token` (object, required)
        Example: {"value":"8900004710343233"}
      - `card.token.value` (string, required)
        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.
        Example: "8900004710343233"
      - `card.expirationDate` (integer)
        Conditional: Send in the request for manually entered or token transactions if the card has an expiration date. This field should not be specified when using an encrypted device.

Card expiration date in MMYY format.
        Example: 1225
      - `transaction` (object, required)
        Example: {"invoice":"192029"}
      - `transaction.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: "192029"
      - `apiOptions` (array)
        API Options modify the request being made.

Value      | Description                                                |
-----------|------------------------------------------------------------|
RETURNHIST | Return the gift card usage history in the history array. |
    - Legacy TrueToken:
      - `dateTime` (string, required)
        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
        Example: "2021-04-15T09:18:23.283-07:00"
      - `card` (object, required)
        Example: {"present":"Y","expirationDate":1225,"token":{"value":"87743q5p3ffhv67y","serialNumber":"123456"}}
      - `card.present` (string, required)
        Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `card.token` (object, required)
        Example: {"value":"87743q5p3ffhv67y","serialNumber":"123456"}
      - `card.token.value` (string, required)
        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.
        Example: "87743q5p3ffhv67y"
      - `card.token.serialNumber` (string)
        In requests that require the use of a shared card token that is held by another merchant account, such as in a TokenStore or TokenShare®, this field is used to specify the serial number for the account where the card token is stored.
        Example: "123456"
      - `card.expirationDate` (integer)
        Conditional: Send in the request for manually entered or token transactions if the card has an expiration date. This field should not be specified when using an encrypted device.

Card expiration date in MMYY format.
        Example: 1225
      - `transaction` (object, required)
        Example: {"invoice":"192029"}
      - `transaction.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: "192029"
      - `apiOptions` (array)
        API Options modify the request being made.

Value      | Description                                                |
-----------|------------------------------------------------------------|
RETURNHIST | Return the gift card usage history in the history array. |
    - P2PE - ID TECH - MSR/Manual:
      - `dateTime` (string, required)
        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
        Example: "2021-04-15T09:18:23.283-07:00"
      - `card` (object, required)
        Example: {"present":"Y"}
      - `card.present` (string, required)
        Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `transaction` (object, required)
        Example: {"invoice":"192029"}
      - `transaction.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: "192029"
      - `p2pe` (object, required)
        Example: {"data":"02B600C0170018009292;000442******0006=3012?*61A0453AB7145F1FA7685D2F27A745E129525EDAEA5BB7DBBAF49A5F876E3EE5000000000000000000000000000000000000000034343454343631383439629949500100382003E6FF4D03","format":"01"}
      - `p2pe.data` (string, required)
        The full output of a P2PE keypad/magnetic swipe reader (MSR).
        Example: "02B600C0170018009292;000442******0006=3012?*61A0453AB7145F1FA7685D2F27A745E129525EDAEA5BB7DBBAF49A5F876E3EE5000000000000000000000000000000000000000034343454343631383439629949500100382003E6FF4D03"
      - `p2pe.format` (string, required)
        Classifies the type of payment device being used for P2PE.

Value|Description
-----|-----------
01   | IDTech Enhanced Encryption format (Keyboard Mode)
02   | IDTech Enhanced Encryption format (USB HID Mode)
        Enum: "01", "02"
      - `apiOptions` (array)
        API Options modify the request being made.

Value      | Description                                                |
-----------|------------------------------------------------------------|
RETURNHIST | Return the gift card usage history in the history array. |
    - P2PE - TDES DUKPT - MSR/Manual:
      - `dateTime` (string, required)
        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
        Example: "2021-04-15T09:18:23.283-07:00"
      - `card` (object, required)
        Example: {"present":"Y"}
      - `card.present` (string, required)
        Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `transaction` (object, required)
        Example: {"invoice":"192029"}
      - `transaction.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: "192029"
      - `p2pe` (object, required)
        See [P2PE Format 05 TDES DUKPT](/guides/core-concepts/p2pe-format#tdes-dukpt---format-05) for more information.
        Example: {"data":"44188C9A20DD2092254F7FEB0AABD531D86EA10DA37E5540C25B53658BA4FBB903828F835A7287481F6FB5C17A879ECC9768D4C12F99532A","format":"05","ksn":"FFFF49517300010000C9"}
      - `p2pe.data` (string, required)
        The full output of a P2PE keypad/magnetic swipe reader (MSR).
        Example: "44188C9A20DD2092254F7FEB0AABD531D86EA10DA37E5540C25B53658BA4FBB903828F835A7287481F6FB5C17A879ECC9768D4C12F99532A"
      - `p2pe.format` (string, required)
        Classifies the type of payment device being used for P2PE.

Value|Description
-----|-----------
05   | [Shift4 TDES DUKPT format](/guides/core-concepts/p2pe-format#tdes-dukpt---format-05)
        Enum: "05"
      - `p2pe.ksn` (string, required)
        The key serial number which was used to encrypt the P2PE data.
        Example: "FFFF49517300010000C9"
      - `device` (object, required)
        Example: {"manufacturer":"PAX","model":"A930","serialNumber":"1170301234","capability":{"contactlessEMV":"Y","contactlessMSR":"Y","EMV":"Y","magstripe":"Y","manualEntry":"Y","quickChip":"Y"}}
      - `device.manufacturer` (string, required)
        Specifies the company which manufactured the device.
        Enum: same as `device.manufacturer` in "Commerce Engine For Cloud" (6 values)
      - `device.model` (string, required)
        Conditional: Required when using a non-UTG-controlled device.

Specifies the model of the device.
        Example: "A930"
      - `device.serialNumber` (string, required)
        Specifies the serial number of the device.
        Example: "1170301234"
      - `device.capability` (object, required)
        Conditional: Required when using a non-UTG-controlled device.
        Example: {"contactlessEMV":"Y","contactlessMSR":"Y","EMV":"Y","magstripe":"Y","manualEntry":"Y","quickChip":"Y"}
      - `device.capability.contactlessEMV` (string)
        Specifies whether or not the device supports contactless EMV.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.contactlessMSR` (string)
        Specifies whether or not the device supports contactless magstripe.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.EMV` (string)
        Specifies whether or not the device supports EMV.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.manualEntry` (string)
        Specifies whether or not the device supports manual entry.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.magstripe` (string)
        Specifies whether or not the device supports magstripe.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.PIN` (string)
        Specifies whether or not the device supports PIN entry (for debit or EMV). If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.quickChip` (string)
        Specifies whether or not the device supports quick chip.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.signature` (string)
        Specifies whether or not the device supports signature capture.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `apiOptions` (array)
        API Options modify the request being made.

Value      | Description                                                |
-----------|------------------------------------------------------------|
RETURNHIST | Return the gift card usage history in the history array. |
    - P2PE - On-Guard SDE - MSR/Manual:
      - `dateTime` (string, required)
        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
        Example: "2023-12-13T09:18:23.283-07:00"
      - `card` (object, required)
        Example: {"present":"Y"}
      - `card.present` (string, required)
        Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `transaction` (object, required)
        Example: {"invoice":"192029"}
      - `transaction.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: "192029"
      - `p2pe` (object, required)
        See [P2PE Format 03 Ingenico On-Guard SDE](/guides/core-concepts/p2pe-format#ingenico-on-guard-sde---format-03) for more information.
        Example: {"data":"FFFF495A0000000200000005:4:0128:F48C880DE0DAF549E642C5CC25E65ADF9947E7EB0636DB80C4A490B4C0930AEF64B7201505343CED533A2AE9AFABFE6453875F705519A8109362197CA3BD8DA0FE90DB3F954B9CDA0DB58BDA3330862ADD28CB31EFDA7C641575E33D395D8BFF72EBF0B1FF9630DB0EAB080FE8C9B2FAC28127CDC48CA9F7D532D5BDE4CCE270","format":"03"}
      - `p2pe.data` (string, required)
        Track information encrypted with AES 256 DUKPT. Contains the following information, separated by colons:
  
|Value           | Description
|----------------|------------
|ksn             | The key serial number (24 byte hex)
|track indicator | 1 = track 1 only2 = track 2 only3 = manual entry4 = dual track
|length          | The length of the encrypted data
|encrypted data  | Encrypted track/manual entry data

Dual Track Example: FFFF495A0000000200000005:4:0128:F48C880DE0DAF549E642C5CC25E65ADF9947E7EB0636DB80C4A490B4C0930AEF64B7201505343CED533A2AE9AFABFE6453875F705519A8109362197CA3BD8DA0FE90DB3F954B9CDA0DB58BDA3330862ADD28CB31EFDA7C641575E33D395D8BFF72EBF0B1FF9630DB0EAB080FE8C9B2FAC28127CDC48CA9F7D532D5BDE4CCE270

Manual entry Example: FFFF495A0000000200000006:3:0032:E394820DB97AF927B9B5E05F356750BBF5DFCCB3BC18B87E8FC3C9BC596229E7
        Example: "FFFF495A0000000200000005:4:0128:F48C880DE0DAF549E642C5CC25E65ADF9947E7EB0636DB80C4A490B4C0930AEF64B7201505343CED533A2AE9AFABFE6453875F705519A8109362197CA3BD8DA0FE90DB3F954B9CDA0DB58BDA3330862ADD28CB31EFDA7C641575E33D395D8BFF72EBF0B1FF9630DB0EAB080FE8C9B2FAC28127CDC48CA9F7D532D5BDE4CCE270"
      - `p2pe.format` (string, required)
        Classifies the type of payment device being used for P2PE.

Value|Description
-----|-----------
03   | Ingenico Onguard SDE Format
        Enum: "03"
      - `device` (object, required)
        Example: {"manufacturer":"Ingenico","model":"Axium DX8000","serialNumber":"20ACCD801843","capability":{"contactlessEMV":"Y","contactlessMSR":"N","EMV":"Y","manualEntry":"Y","magstripe":"Y","PIN":"Y","quickChip":"Y","signature":"Y"}}
      - `device.manufacturer` (string, required)
        Specifies the company which manufactured the device.
        Enum: same as `device.manufacturer` in "Commerce Engine For Cloud" (6 values)
      - `device.model` (string, required)
        Conditional: Required when using a non-UTG-controlled device.

Specifies the model of the device.
        Example: "Axium DX8000"
      - `device.serialNumber` (string, required)
        Specifies the serial number of the device.
        Example: "20ACCD801843"
      - `device.capability` (object, required)
        Conditional: Required when using a non-UTG-controlled device.
        Example: {"contactlessEMV":"Y","contactlessMSR":"N","EMV":"Y","manualEntry":"Y","magstripe":"Y","PIN":"Y","quickChip":"Y","signature":"Y"}
      - `device.capability.contactlessEMV` (string)
        Specifies whether or not the device supports contactless EMV.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.contactlessMSR` (string)
        Specifies whether or not the device supports contactless magstripe.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.EMV` (string)
        Specifies whether or not the device supports EMV.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.manualEntry` (string)
        Specifies whether or not the device supports manual entry.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.magstripe` (string)
        Specifies whether or not the device supports magstripe.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.PIN` (string)
        Specifies whether or not the device supports PIN entry (for debit or EMV). If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.quickChip` (string)
        Specifies whether or not the device supports quick chip.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `device.capability.signature` (string)
        Specifies whether or not the device supports signature capture.  If this input method can be supported by the device, but the input method is currently disabled for all transactions on the device, then the value 'N' should be sent.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `apiOptions` (array)
        API Options modify the request being made.

Value      | Description                                                |
-----------|------------------------------------------------------------|
RETURNHIST | Return the gift card usage history in the history array. |
    - Card Number Unencrypted:
      - `dateTime` (string, required)
        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
        Example: "2021-04-15T09:18:23.283-07:00"
      - `card` (object, required)
        Example: {"expirationDate":1230,"number":"2664654648774","present":"Y"}
      - `card.present` (string, required)
        Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
        Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)
      - `card.number` (string, required)
        The payment card number. This field will always be masked when returned in a response.
        Example: "2664654648774"
      - `card.expirationDate` (integer)
        Conditional: Send in the request for manually entered or token transactions if the card has an expiration date. This field should not be specified when using an encrypted device.

Card expiration date in MMYY format.
        Example: 1230
      - `card.securityCode` (object)
      - `card.securityCode.value` (string)
        Conditional: May be required for gift card transactions.

The three- or four-digit Card Security Code associated with gift card. This value may be required for requests depending on a card's settings. It should not be stored by the interface.
      - `transaction` (object, required)
        Example: {"invoice":"192029"}
      - `transaction.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: "192029"
      - `apiOptions` (array)
        API Options modify the request being made.

Value      | Description                                                |
-----------|------------------------------------------------------------|
RETURNHIST | Return the gift card usage history in the history array. |

## 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.card` (object)

  - `result.card.deactivationReason` (string)
    In a Gift Card [Deactivate](/apis/payments-platform-rest/openapi/gift-cards/deactivate) or [Cashout](/apis/payments-platform-rest/openapi/gift-cards/cashout) request, specifies the reason for deactivation. In a Gift Card redemption or inquiry response, specifies the reason for denial sent by the processor.

  - `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.expirationDate` (integer)
    Conditional: Requires API Option "RETURNEXPDATE".

Card expiration date in MMYY format. This value will only be populated if "RETURNEXPDATE" is included in the apiOptions array.

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

  - `result.card.present` (string)
    Conditional: Send in the initial authorization/sale request

Indicates whether a card was present (‘Y’) or not (‘N’) at the time a transaction took place. This should be set appropriately in the initial authorization/sale request.  In subsequent requests, this field should be left blank or should not be sent.

Note: Subsequent request here does not apply to the secondary request for card on file type transactions or reuse of the same card. An example of a subsequent request would be a capture after an authorization. You would not include card.present in the capture, which is the subsequent request. Another example is when performing an incremental authorization where you perform an authorization, followed by an incremental authorization then a capture. The second authorization (incremental) and the capture are the subsequent requests where you would not include card.present.
    Enum: same as `card.present` in "Commerce Engine For On Premise" (2 values)

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

Value| Description
-----|------------
GC   | Gift Card
YC   | IT’S YOUR CARD
    Enum: "GC", "YC"

  - `result.card.balance` (object)

  - `result.card.balance.amount` (number)
    The balance remaining on the card.  Depending on which processor is being used, the balance may be returned for a gift card, debit card, EBT card, or other stored value card.

  - `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.device` (object)

  - `result.device.terminalId` (string)
    To prompt a specific UTG-controlled PIN pad in a request, the API Terminal ID configured in UTG TuneUp must be specified in this field.

  - `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.server` (object)

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

  - `result.transaction` (object)

  - `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.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.universalToken` (object)

  - `result.universalToken.value` (string)
    An identifier for a card or payment account across all Shift4 merchants.

  - `result.history` (array)
    Returned if RETURNHIST is sent in apiOptions.

  - `result.history.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.history.amount` (object)
    Object containing information regarding the amount being requested. The total field within the object is required and specifies the amount being requested.

Note: For merchants that are configured to allow multiple currencies, the amount fields can specify up to three decimal places. However, the number of decimal places can not exceed the number allowed for the specified currency. See the [Currency Codes](/guides/appendices/currency-codes) section for details.

  - `result.history.amount.total` (number, required)
    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.history.transactionType` (string)
    The gift card transaction type
    Enum: "Sale", "Activate", "Allocate", "Deactivate", "Cashback", "Reactivate", "Reload", "Balance", "Cancel"

## 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.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)


