Create a test-mode authorization Test helper

Issuing
Authorizations
Create a test-mode authorization

Create a test-mode authorization.

Parameters

  • cardstringRequired

    Card associated with this authorization.

  • amountinteger

    The total amount to attempt to authorize. This amount is in the provided currency, or defaults to the card’s currency, and in the smallest currency unit.

  • currencyenum

    The currency of the authorization. If not provided, defaults to the currency of the card. Three-letter ISO currency code, in lowercase. Must be a supported currency.

More parameters

  • amount_detailsobject

    Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit.

    • amount_details.atm_feeinteger

      The ATM withdrawal fee.

    • amount_details.cashback_amountinteger

      The amount of cash requested by the cardholder.

  • authorization_methodenum

    How the card details were provided. Defaults to online.

    Possible enum values
    chip

    The card was physically present and inserted into a chip-enabled terminal. The transaction is cryptographically secured.

    contactless

    The card was tapped on a contactless-enabled terminal. If a digital wallet copy of the card was used, the wallet field will be present.

    keyed_in

    The card number was manually entered into a terminal.

    online

    The card was used in a card-not-present scenario, such as a transaction initiated at an online e-commerce checkout.

    swipe

    The card was physically swiped in a terminal.

  • fleetobject

    Fleet-specific information for authorizations using Fleet cards.

    • fleet.cardholder_prompt_dataobject

      Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry.

      • fleet.cardholder_prompt_data.driver_idstring

        Driver ID.

      • fleet.cardholder_prompt_data.odometerinteger

        Odometer reading.

      • fleet.cardholder_prompt_data.unspecified_idstring

        An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type.

      • fleet.cardholder_prompt_data.user_idstring

        User ID.

      • fleet.cardholder_prompt_data.vehicle_numberstring

        Vehicle number.

    • fleet.purchase_typestring

      The type of purchase. One of fuel_purchase, non_fuel_purchase, or fuel_and_non_fuel_purchase.

    • fleet.reported_breakdownobject

      More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data.

      • fleet.reported_breakdown.fuelobject

        Breakdown of fuel portion of the purchase.

        • fleet.reported_breakdown.fuel.gross_amount_decimalstring

          Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes.

      • fleet.reported_breakdown.non_fuelobject

        Breakdown of non-fuel portion of the purchase.

        • fleet.reported_breakdown.non_fuel.gross_amount_decimalstring

          Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes.

      • fleet.reported_breakdown.taxobject

        Information about tax included in this transaction.

        • fleet.reported_breakdown.tax.local_amount_decimalstring

          Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax.

        • fleet.reported_breakdown.tax.national_amount_decimalstring

          Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax.

    • fleet.service_typestring

      The type of fuel service. One of non_fuel_transaction, full_service, or self_service.

  • fuelobject

    Information about fuel that was purchased with this transaction.

    • fuel.industry_product_codestring

      Conexxus Payment System Product Code identifying the primary fuel product purchased.

    • fuel.quantity_decimalstring

      The quantity of units of fuel that was dispensed, represented as a decimal string with at most 12 decimal places.

    • fuel.typestring

      The type of fuel that was purchased. One of diesel, unleaded_plus, unleaded_regular, unleaded_super, or other.

    • fuel.unitstring

      The units for quantity_decimal. One of charging_minute, imperial_gallon, kilogram, kilowatt_hour, liter, pound, us_gallon, or other.

    • fuel.unit_cost_decimalstring

      The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places.

  • is_amount_controllableboolean

    If set true, you may provide amount to control how much to hold for the authorization.

  • merchant_amountintegerPreview feature

    The total amount to attempt to authorize. This amount is in the provided merchant currency, and in the smallest currency unit.

  • merchant_currencyenumPreview feature

    The currency of the authorization. If not provided, defaults to the currency of the card. Three-letter ISO currency code, in lowercase. Must be a supported currency.

  • merchant_dataobject

    Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened.

    • merchant_data.categorystring

      A categorization of the seller’s type of business. See our merchant categories guide for a list of possible values.

    • merchant_data.citystring

      City where the seller is located

    • merchant_data.countrystring

      Country where the seller is located

    • merchant_data.namestring

      Name of the seller

    • merchant_data.network_idstring

      Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant.

    • merchant_data.postal_codestring

      Postal code where the seller is located

    • merchant_data.statestring

      State where the seller is located

    • merchant_data.terminal_idstring

      An ID assigned by the seller to the location of the sale.

    • merchant_data.urlstring

      URL provided by the merchant on a 3DS request

  • network_dataobject

    Details about the authorization, such as identifiers, set by the card network.

    • network_data.acquiring_institution_idstring

      Identifier assigned to the acquirer by the card network.

  • verification_dataobject

    Verifications that Stripe performed on information that the cardholder provided to the merchant.

    • verification_data.address_line1_checkenum

      Whether the cardholder provided an address first line and if it matched the cardholder’s billing.address.line1.

      Possible enum values
      match

      Verification succeeded, values matched.

      mismatch

      Verification failed, values didn’t match.

      not_provided

      Verification was not performed because no value was provided.

    • verification_data.address_postal_code_checkenum

      Whether the cardholder provided a postal code and if it matched the cardholder’s billing.address.postal_code.

      Possible enum values
      match

      Verification succeeded, values matched.

      mismatch

      Verification failed, values didn’t match.

      not_provided

      Verification was not performed because no value was provided.

    • verification_data.authentication_exemptionobject

      The exemption applied to this authorization.

      • verification_data.authentication_exemption.claimed_byenumRequired

        The entity that requested the exemption, either the acquiring merchant or the Issuing user.

        Possible enum values
        acquirer

        Acquiring merchant.

        issuer

        Issuing user.

      • verification_data.authentication_exemption.typeenumRequired

        The specific exemption claimed for this authorization.

        Possible enum values
        low_value_transaction

        Specifies an exemption for some low-value authorizations.

        transaction_risk_analysis

        Specifies an exemption for low-risk authorizations, determined using real-time risk analysis.

        unknown

        Specifies an unknown exemption type.

    • verification_data.cvc_checkenum

      Whether the cardholder provided a CVC and if it matched Stripe’s record.

      Possible enum values
      match

      Verification succeeded, values matched.

      mismatch

      Verification failed, values didn’t match.

      not_provided

      Verification was not performed because no value was provided.

    • verification_data.expiry_checkenum

      Whether the cardholder provided an expiry date and if it matched Stripe’s record.

      Possible enum values
      match

      Verification succeeded, values matched.

      mismatch

      Verification failed, values didn’t match.

      not_provided

      Verification was not performed because no value was provided.

    • verification_data.three_d_secureobject

      3D Secure details.

      • verification_data.three_d_secure.resultenumRequired

        The outcome of the 3D Secure authentication request.

        Possible enum values
        attempt_acknowledged

        The merchant attempted to authenticate the authorization, but the cardholder is not enrolled or was unable to reach Stripe.

        authenticated

        Authentication successful.

        failed

        Authentication failed.

        required

        The authorization was declined because regulatory requirements mandated an authentication for this transaction but it wasn’t submitted correctly by the merchant, and they didn’t claim an applicable exemption. Check out our 3DS documentation if you want to learn more.

  • walletenum

    The digital wallet used for this transaction. One of apple_pay, google_pay, or samsung_pay. Will populate as null when no digital wallet was utilized.

Returns

An Authorization object

POST /v1/test_helpers/issuing/authorizations
curl https://api.stripe.com/v1/test_helpers/issuing/authorizations \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d amount=1000 \
-d card=ic_1Nsse72eZvKYlo2CWBGm2WQ5
Response
{
"id": "iauth_1DPc772eZvKYlo2C6avLyZ25",
"object": "issuing.authorization",
"amount": 1000,
"amount_details": {
"atm_fee": null,
"cashback_amount": null
},
"approved": true,
"authorization_method": "keyed_in",
"balance_transactions": [],
"card": "ic_1Nsse72eZvKYlo2CWBGm2WQ5",
"cardholder": "ich_1Ccy6F2eZvKYlo2ClnIm9bs4",
"created": 1540586461,
"currency": "usd",
"livemode": false,
"merchant_amount": 0,
"merchant_currency": "usd",
"merchant_data": {
"category": "taxicabs_limousines",
"category_code": "4121",
"city": "San Francisco",
"country": "US",
"name": "Rocket Rides",
"network_id": "1234567890",
"postal_code": "94107",
"state": "CA",
"terminal_id": null
},
"metadata": {},
"network_data": null,
"pending_request": null,
"redaction": null,
"request_history": [],
"status": "reversed",
"transactions": [],
"verification_data": {
"address_line1_check": "not_provided",
"address_postal_code_check": "match",
"cvc_check": "match",
"expiry_check": "match"
},
"wallet": null
}