# First Ride Risk
source: https://developer.mastercard.com/mastercard-gateway/documentation/gateway-features/trans-enrich-data/cardholder-present-data/transit/first-ride-risk/index.md

## Mastercard Gateway API support {#mastercard-gateway-api-support}

* For Mastercard, First Ride Risk support is available from the Gateway version 85 and later.
* For Visa, First Ride Risk support is available from the Mastercard Gateway API version 40 and later.

## Mastercard {#mastercard}

According to Mastercard First Ride Risk rules, a [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) is submitted for a declined [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) if:

* The issuer declines the first [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request since the previous successful authorization for an aggregated or known fare.
* The transaction amount is less than equal to the chargeback threshold of the country.

### [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) for a declined [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) {#capturehahahugoshortcodes3hbhb-for-a-declined-authorizehahahugoshortcodes4hbhb}

* An identifier for the order in the field `order.id` - This is a new `order.id`. You cannot use the same `order.id` as used for the declined Authorize request.
* A unique identifier within the order for the Capture transaction in `transaction.id`.
* The total aggregated fare amount as provided in the failed authorization request in `order.amount`.
* The order currency as provided in the failed authorization request in `order.currency`.
* `transaction.transit.aggregatedFare.type`=FIRST_RIDE_RISK or `transaction.transit.knownFare.type`=FIRST_RIDE_RISK
* `transaction.transit.aggregatedFare.aggregationStartDate` with the date of first tap.
* `transaction.transit.aggregatedFare.transportationMode` with a valid enumeration value that reflects the transportation mode used by the payer for the first trip.
* `sourceOfFunds.provided.card.emvRequest` with a valid EMV data from the failed auth transaction.
* `sourceOfFunds.provided.card.sequenceNumber`
* `transaction.source`=CARD_PRESENT
* `posTerminal.attended`=UNATTENDED
* `posTerminal.location`= MERCHANT_TERMINAL_ON_PREMISES
* `posTerminal.cardholderActivated`=NOT_CARDHOLDER_ACTIVATED
* `posTerminal.inputCapability`=CONTACTLESS_CHIP
* `posTerminal.panEntryMode`=CONTACTLESS
* `posTerminal.pinEntryCapability`=PIN_NOT_SUPPORTED
* `authorizationResponse.date` with a valid Settlement date returned in the failed auth transaction response.
* `authorizationResponse.financialNetworkCode` with a valid financial network code.
* `authorizationResponse.transactionIdentifier` a numeric value returned in the failed authorization response.

The startDate and transportationMode must reflect those used for the first tap.
Warning: After the [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) is submitted, the card remains on the deny list.

Merchant initiated debt recovery determines if the card has returned to good standing and should be removed from the deny list.

To check if the card has returned to good standing and can be removed from the deny list, you can submit an [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request for the amount of the [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction). If the [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request is approved, the card should be removed from the deny list and the authorization should be voided.

### Void {#void}

Submit a [Void](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request in the same order as the one for the successful [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction):

* `order.id` same as successful [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction).
* `transaction.id` Unique value.
* `transaction.targetTransactionID` same as successful [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction).

## Standalone [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) - Mastercard {#standalone-capturehahahugoshortcodes13hbhb---mastercard}

At the end of the travel period, wherever the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) is declined but is permitted to be captured within Mastercard Scheme rules. Submit the standalone capture request with the following details:

* An identifier for the order in the field order.id - This is a new order.id. You cannot use the same order.id as used for the declined Authorize request.
* A unique identifier within the order for the [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) transaction in transaction.id.
* The total aggregated fare amount as provided in the failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request in order.amount.
* The order currency as provided in the failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request in order.currency.
* `transaction.transit.aggregatedFare.type`=FIRST_RIDE_RISK or `transaction.transit.knownFare.type`=FIRST_RIDE_RISK
* `transaction.transit.aggregatedFare.aggregationStartDate` with the date of first tap.
* `transaction.transit.aggregatedFare.transportationMode` with a valid enumeration value that reflects the transportation mode used by the payer for the first trip.
* `sourceOfFunds.provided.card.emvRequest` with a valid EMV data from the failed auth transaction.
* `sourceOfFunds.provided.card.sequenceNumber`
* `transaction.source`=CARD_PRESENT
* `posTerminal.attended`=UNATTENDED
* `posTerminal.location`= MERCHANT_TERMINAL_ON_PREMISES
* `posTerminal.cardholderActivated`=NOT_CARDHOLDER_ACTIVATED
* `posTerminal.inputCapability`=CONTACTLESS_CHIP
* `posTerminal.panEntryMode`=CONTACTLESS
* `posTerminal.pinEntryCapability`=PIN_NOT_SUPPORTED
* `authorizationResponse.date` with a valid Settlement date returned in the failed auth transaction response.
* `authorizationResponse.financialNetworkCode` with a valid financial network code.
* `authorizationResponse.transactionIdentifier` a numeric value returned in the failed authorization response.

## Example request and response for Standalone Capture {#example-request-and-response-for-standalone-capture}

```json
{
    "apiOperation": "CAPTURE",
    "sourceOfFunds": {
        "provided": {
            "card": {
                "emvRequest": {
                    "5A": "5555555555554444",
                    "5F2A": "826",
                    "82": "0000",
                    "84": "010101010101",
                    "95": "0000000000",
                    "9A": "240822",
                    "9B": "0101",
                    "9C": "00",
                    "9F02": "000000001099",
                    "9F03": "000000000000",
                    "9F06": "010101010101",
                    "9F07": "0101",
                    "9F09": "0101",
                    "9F10": "06011103A000000A0100000000000BB0ABAD",
                    "9F1A": "826",
                    "9F1E": "0123ABCD",
                    "9F26": "D1F722D47FCA8273",
                    "9F27": "40",
                    "9F33": "E0B8C8",
                    "9F34": "1E0300",
                    "9F35": "12",
                    "9F36": "0002",
                    "9F37": "2A4E1690",
                    "9F41": "0123",
                    "9F53": "A",
                    "9F6E": "0101"
                },
                "expiry": {
                    "month": "12",
                    "year": "24"
                },
                "number": "5555555555554444"
            }
        },
        "type": "CARD"
    },
    "transaction": {
        "amount": 7,
        "currency": "AUD",
        "source": "CARD_PRESENT",
        "transit": {
            "aggregatedFare": {
                "type": "FIRST_RIDE_RISK",
                "aggregationStartDate": "2024-05-14",
                "transportationMode": "TRAIN"
            }
        }
    },
    "posTerminal": {
        "attended": "UNATTENDED",
        "location": "MERCHANT_TERMINAL_ON_PREMISES",
        "cardholderActivated": "NOT_CARDHOLDER_ACTIVATED",
        "panEntryMode": "CONTACTLESS",
        "inputCapability": "CONTACTLESS_CHIP",
        "lane": "street1",
        "pinEntryCapability": "PIN_NOT_SUPPORTED"
    },
    "authorizationResponse": {
        "date": "0904",
        "financialNetworkCode": "MCC",
        "transactionIdentifier": "943427341"
    }
} 
```

```json
{
    "authorizationResponse": {
        "date": "0904",
        "financialNetworkCode": "MCC",
        "processingCode": "003000",
        "responseCode": "00",
        "stand": "79188",
        "transactionIdentifier": "943427341"
    },
    "gatewayEntryPoint": "WEB_SERVICES_API",
    "merchant": "CYG_S2I_MER2",
    "order": {
        "amount": 7.00,
        "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT",
        "chargeback": {
            "amount": 0,
            "currency": "AUD"
        },
        "creationTime": "2024-09-04T09:32:03.907Z",
        "currency": "AUD",
        "id": "AKS_908420493",
        "lastUpdatedTime": "2024-09-04T09:32:04.198Z",
        "merchantAmount": 7.00,
        "merchantCategoryCode": "4111",
        "merchantCurrency": "AUD",
        "status": "CAPTURED",
        "totalAuthorizedAmount": 7.00,
        "totalCapturedAmount": 7.00,
        "totalDisbursedAmount": 0.00,
        "totalRefundedAmount": 0.00
    },
    "posTerminal": {
        "address": {
            "country": "GBR"
        },
        "attended": "UNATTENDED",
        "cardholderActivated": "NOT_CARDHOLDER_ACTIVATED",
        "inputCapability": "CONTACTLESS_CHIP",
        "lane": "street1",
        "location": "MERCHANT_TERMINAL_ON_PREMISES",
        "panEntryMode": "CONTACTLESS",
        "pinEntryCapability": "PIN_NOT_SUPPORTED",
        "serialNumber": "0123ABCD"
    },
    "response": {
        "acquirerCode": "00",
        "acquirerMessage": "Approved",
        "gatewayCode": "APPROVED"
    },
    "result": "SUCCESS",
    "sourceOfFunds": {
        "provided": {
            "card": {
                "brand": "MASTERCARD",
                "emvRequest": {
                    "5F2A": "826",
                    "82": "0000",
                    "84": "010101010101",
                    "95": "0000000000",
                    "9A": "240822",
                    "9B": "0101",
                    "9C": "00",
                    "9F02": "000000001099",
                    "9F03": "000000000000",
                    "9F06": "010101010101",
                    "9F07": "0101",
                    "9F09": "0101",
                    "9F10": "06011103A000000A0100000000000BB0ABAD",
                    "9F1A": "826",
                    "9F1E": "0123ABCD",
                    "9F26": "D1F722D47FCA8273",
                    "9F27": "40",
                    "9F33": "E0B8C8",
                    "9F34": "1E0300",
                    "9F35": "12",
                    "9F36": "0002",
                    "9F37": "2A4E1690",
                    "9F41": "0123",
                    "9F53": "A",
                    "9F6E": "0101"
                },
                "expiry": {
                    "month": "12",
                    "year": "24"
                },
                "fundingMethod": "DEBIT",
                "number": "555555xxxxxx4444",
                "scheme": "MASTERCARD",
                "storedOnFile": "NOT_STORED"
            }
        },
        "type": "CARD"
    },
    "timeOfLastUpdate": "2024-09-04T09:32:04.198Z",
    "timeOfRecord": "2024-09-04T09:32:03.946Z",
    "transaction": {
        "acquirer": {
            "batch": 20240904,
            "date": "0904",
            "id": "CYG_TESTACQ_S2I",
            "merchantId": "9808",
            "settlementDate": "2024-09-04",
            "timeZone": "+1000"
        },
        "amount": 7.00,
        "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT",
        "currency": "AUD",
        "id": "AKS_627692027",
        "receipt": "424809079188",
        "source": "CARD_PRESENT",
        "stan": "79188",
        "terminal": "0002",
        "transit": {
            "aggregatedFare": {
                "aggregationStartDate": "2024-05-14",
                "transportationMode": "TRAIN",
                "type": "FIRST_RIDE_RISK"
            }
        },
        "type": "CAPTURE"
    },
    "version": "85"
}
```

The capture of a failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) is permitted within Mastercard scheme rules if:

* The issuer declines the first [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request for the card.
* The issuer declines the first [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request for the card since the previous successful Authorization for an aggregated transit fare.
* The transaction amount is less than or equal to the chargeback threshold of your country.

After you have submitted the [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request, the card remains on the deny list. You can use the merchant-initiated debt recovery to determine if the card has returned to good standing and should be removed from the deny list. Submit the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request on a new order with the following details:

* `order.id` - This is a new order.id.
* `transaction.id`
* `order.amount` - This is zero amount auth for Mastercard.
* the currency in the field `order.currency`.
* `transaction.transit.aggregatedFare.type`=DEBT_RECOVERY_MERCHANT_INITIATED or `transaction.transit.knownFare.type`=DEBT_RECOVERY_MERCHANT_INITIATED
* `transaction.transit.aggregatedFare.transportationMode` mandatory with a valid enumeration value.
* `transaction.source`=MERCHANT
* `transaction.transit.aggregatedFare.aggregationStartDate` mandatory with the date of first tap.
* payment details including card number, expiration date, and so on. If the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request is successful, remove the card from the deny list within an hour and immediately void the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction).

### Void [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) {#void-authorizationhahahugoshortcodes26hbhb}

Subsequently submit an API Void request in the same order as the one for the successful Authorization with:

* `order.id` - This must be the order.id of the successful [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction).
* `transaction.id` - This is a new transaction ID on the order.
* `transaction.targetTransactionId` - This is the `transaction.id` of the successful [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction).

You can repeat the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request up to the allowed attempts count or frequency for the merchant-initiated debt recovery requests. For more information, see the [merchant-initiated debt recovery](https://developer.mastercard.com/mastercard-gateway/documentation/gateway-features/trans-enrich-data/cardholder-present-data/transit/agg-transit-rules/index.md#merchant-initiated-debt-recovery) section. The issuer is liable for the standalone [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request. This means that a successful Capture does not indicate that the payer's account is in good standing and the card can be removed from the deny list.

## Visa {#visa}

According to Visa First Ride Risk rules, a zero can be submitted for a declined [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) if:

* The issuer has declined the first [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request since the previous successful [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) for an aggregated fare.
* The transaction amount is less than equal to the chargeback threshold of the country.

### \[Capture\] for a declined [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) {#capture-for-a-declined-authorizehahahugoshortcodes35hbhb}

* `order.id` - This is a new value and cannot be the same as used for the declined [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request.
* `transaction.id` - Unique value
* `order.amount` - same as the declined [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request.
* `order.currency` - same as the declined [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request.
* `transaction.transit.aggregatedFare.type`=FIRST_RIDE_RISK or `transaction.transit.knownFare.type`=FIRST_RIDE_RISK
* `transaction.transit.aggregatedFare.aggregationStartDate`
* `transaction.transit.aggregatedFare.transportationMode`
* `sourceOfFunds.provided.card.emvRequest`
* `sourceOfFunds.provided.card.sequenceNumber`
* `authorizationResponse.transactionIdentifier` - as returned in the response to the declined [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request.
* `authorizationResponse.returnACI` - as provided in the response to the declined [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request
* `transaction.authorizationCode`=VFT000 - the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) code defined by Visa for this specific purpose.

The startDate and transportationMode must reflect those used for the first tap.
Warning: After the [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) is submitted, the card remains on the deny list.

Merchant initiated debt recovery determines if the card has returned to good standing and should be removed from the deny list.

To check if the card has returned to good standing and can be removed from the deny list, you can submit an [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request for the amount of the [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction). If the [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request is approved, the card should be removed from the deny list and the authorization should be voided.

### Void {#void-1}

Submitted a [Void](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request in the same order as the one for the successful [Authorize](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction).

* `order.id` same as successful Authorize.
* `transaction.id` Unique value.
* `transaction.targetTransactionID` same as successful Authorize.

## Standalone Capture - Visa {#standalone-capture---visa}

Where the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) at the end of the travel period is declined, but is permitted to be captured within the Visa rules, submits a standalone [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request with the following details:

* An identifier for the order in `order.id` - You can submit this request with the same order ID that you used for the failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request on the first tap with the card or a new order ID.
* A unique identifier within the order for the [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) transaction in `transaction.id`.
* The total aggregated fare amount as provided in the failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request in `order.amount`
* The order currency as provided in the failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request in `order.currency`
* `transaction.transit.aggregatedFare.type`=FIRST_RIDE_RISK or transaction.transit.knownFare.type=FIRST_RIDE_RISK
* `transaction.transit.aggregationStartDate` with the date of first tap.
* `sourceOfFunds.provided.card.emvRequest` with a valid EMV data from the last tap within the travel period.
* `sourceOfFunds.provided.card.sequenceNumber`
* `transaction.source`=CARD_PRESENT
* `posTerminal.attended`=UNATTENDED
* `posTerminal.location`=ON_CARD_ACCEPTOR_PREMISES
* `posTerminal.cardholderActivated`=SELF_SERVICE_TERMINAL
* `posTerminal.inputCapability`=CONTACTLESS_CHIP
* `posTerminal.panEntryMode`=CONTACTLESS
* `posTerminal.pinEntryCapability`=PIN_NOT_SUPPORTED
* The 15-digit numeric value returned in the failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) response in `authorizationResponse.transactionIdentifier` in field `authorizationResponse.transactionIdentifier`
* The 1-letter value returned in the failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) response in field `authorizationResponse.returnAci` `authorizationResponse.returnAci` in field.
* `transaction.authorizationCode`=VFT000 - This is the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) code defined by Visa for this specific purpose.

## Example request for Standalone Capture {#example-request-for-standalone-capture}

| HTTP Method |                                                  URL                                                   |
|-------------|--------------------------------------------------------------------------------------------------------|
| PUT         | https://{{host}}/api/rest/version/63/merchant/{merchantId}/order/{orderid}/transaction/{transactionid} |

```json
{
    "apiOperation": "CAPTURE",
    "authorizationResponse": {
        "returnAci": "N",
        "transactionIdentifier": "658652148",
        "financialNetworkCode": "fin",
        "commercialCard": "com",
        "commercialCardIndicator": "I",
        "transactionIntegrityClass": "BE"
    },
    "posTerminal": {
        "address": {
            "country": "AUS",
            "postcodeZip": "4000"
        },
        "attended": "UNATTENDED",
        "cardPresenceCapability": "CARD_PRESENT",
        "cardholderActivated": "SELF_SERVICE_TERMINAL",
        "inputCapability": "CONTACTLESS_CHIP",
        "lane": "test",
        "location": "MERCHANT_TERMINAL_ON_PREMISES",
        "panEntryMode": "CONTACTLESS",
        "pinEntryCapability": "PIN_NOT_SUPPORTED"
    },
    "sourceOfFunds": {
        "provided": {
            "card": {
                "emvRequest": {
                    "57": ";4005550000000019=39011019681143384001?",
                    "82": "1ac4",
                    "95": "123456abcf",
                    "5F2A": "125",
                    "9A": "201005",
                    "9C": "21",
                    "9F02": "000000000100",
                    "9F10": "06011103A000000A0100000000000BB0ABAD",
                    "9F1A": "321",
                    "9F26": "0123456789abcdef",
                    "9F27": "21",
                    "9F36": "12ac",
                    "9F37": "654321fa"
                },
                "expiry": {
                    "month": "05",
                    "year": "21"
                },
                "number": "4005550000000019",
                "securityCode": "015",
                "sequenceNumber": "000"
            }
        },
        "type": "CARD"
    },
    "transaction": {
        "amount": "8.00",
        "currency": "AUD",
        "source": "CARD_PRESENT",
        "reference": "MerchantReference",
        "authorizationCode": "VFT000",
        "transit": {
            "aggregatedFare": {
                "type": "FIRST_RIDE_RISK",
                "aggregationStartDate": "2024-05-14",
                "transportationMode": "TRAIN"
            }
        }
    }
}
```

The Capture of a failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) is permitted within the Visa rules if:

* The issuer declines the first [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request for the card.
* The issuer declines the first [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request for the card since a previous successful Authorization for an aggregated transit fare was declined
* The transaction amount is less than or equal to the chargeback threshold for your country.

Once submitted the [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request, you must submit an [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request with the following details:

* An identifier for the order in `order.id` - This is a new order ID.
* A unique identifier within the order for the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) transaction in `transaction.id`
* The same amount as submitted on the standalone [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request in `order.amount`
* The order currency as provided in the standalone [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request in field `order.currency` \*` transaction.transit.aggregatedFare.type`=DEBT_RECOVERY_MERCHANT_INITIATED or `transaction.transit.knownFare.type`=DEBT_RECOVERY_MERCHANT_INITIATED
* `transaction.source`=MERCHANT
* `transaction.transit.aggregationStartDate` with the date of first tap within the travel period.
* The 15-digit numeric value returned in the failed [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) response in `authorizationResponse.transactionIdentifier` in field `transaction.acquirer.customData` using the syntax: {"VisaTransitFailedAuthTransactionIdentifier":""}
* The payment details including the card number, expiration date, and so on.

## Example request for an Authorization of aggregate transit fares {#example-request-for-an-authorization-of-aggregate-transit-fares}

| HTTP Method |                                                  URL                                                   |
|-------------|--------------------------------------------------------------------------------------------------------|
| PUT         | https://{{host}}/api/rest/version/63/merchant/{merchantId}/order/{orderid}/transaction/{transactionid} |

```json
{
    "apiOperation": "AUTHORIZE",
    "order": {
        "amount": "15.00",
        "currency": "AUD"
    },
    "sourceOfFunds": {
        "provided": {
            "card": {
                "expiry": {
                    "month": "01",
                    "year": "39"
                },
                "number": "4909654321012344",
                "securityCode": "015",
                "sequenceNumber": "099"
            }
        },
        "type": "CARD"
    },
    "transaction": {
        "acquirer": {
            "customData": "{\"VisaTransitFailedAuthTransactionIdentifier\":\"658652148\"}"
        },
        "source": "MERCHANT",
        "transit": {
            "aggregationStartDate": "2021-06-16",
            "type": "MERCHANT_INITIATED_DEBT_RECOVERY"
        }
    }
}
```

If the [Authorization](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request is successful, remove the card from the deny list within 1 hour and immediately void the Authorization.

To void the Authorization, submit a [Void](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request on a same order for which you submitted the successful Authorization with the following details:

* The Order ID of the successful Authorization in `order.id`
* An unique identifier within the order for the Void Authorization transaction in `transaction.id`
* The `transaction.id` of the successful Authorization in `transaction.targetTransactionId`

## Example request for a [Void](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) on a successful Authorization {#example-request-for-a-voidhahahugoshortcodes70hbhb-on-a-successful-authorization}

| HTTP Method |                                                  URL                                                   |
|-------------|--------------------------------------------------------------------------------------------------------|
| PUT         | https://{{host}}/api/rest/version/63/merchant/{merchantId}/order/{orderid}/transaction/{transactionid} |

```json
{
    "apiOperation": "VOID",
    "transaction": {
        "targetTransactionId": "933674638"
    }
}
```

Warning:   

* You can repeat the Authorization request up to the allowed attempts count or frequency for [merchant-initiated debt recovery](https://developer.mastercard.com/mastercard-gateway/documentation/gateway-features/trans-enrich-data/cardholder-present-data/transit/agg-transit-rules/index.md#merchant-initiated-debt-recovery) requests. For more information, see the merchant-initiated debt recovery section.
* The issuer is liable for the standalone [Capture](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) request. This means that a successful Capture does not indicate that the payer's account is in good standing and the card can be removed from the deny list.
