Skip to content

Stripe: Finalize a test-mode authorization's amount

Stripe testHelpers.postTestHelpersIssuingAuthorizationsAuthorizationFinalizeAmount: arguments, response, policy and SDK examples.

← Test helpers operations · Get started

Operation stripe.posttesthelpersissuingauthorizationsauthorizationfinalizeamount

Provider route: POST /v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["testHelpers"]["postTestHelpersIssuingAuthorizationsAuthorizationFinalizeAmount"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.testHelpers.postTestHelpersIssuingAuthorizationsAuthorizationFinalizeAmount(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.test_helpers.post_test_helpers_issuing_authorizations_authorization_finalize_amount(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.authorizationstringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectRequired within parentAdditional keys: not allowed
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.final_amountintegerRequired within parentThe final authorization amount that will be captured by the merchant. This amount is in the authorization currency and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
body.fleetModelOptionalExpand Create a test-mode authorization — request body — body fleet
body.fuelModelOptionalExpand Create a test-mode authorization — request body — body fuel

Referenced models: Create a test-mode authorization — request body — body fleet, Create a test-mode authorization — request body — body fuel

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Update an authorization — response body

Referenced models: Update an authorization — response body

704 more schemas are linked from the tables above, on the schema pages.

Create a test-mode authorization — request body — body fleet
FieldTypePresenceDescription and constraints
$objectRootFleet-specific information for authorizations using Fleet cards.
cardholder_prompt_dataobjectOptional
cardholder_prompt_data.driver_idstringOptionalMaximum length: 5000
cardholder_prompt_data.odometerintegerOptional
cardholder_prompt_data.unspecified_idstringOptionalMaximum length: 5000
cardholder_prompt_data.user_idstringOptionalMaximum length: 5000
cardholder_prompt_data.vehicle_numberstringOptionalMaximum length: 5000
purchase_typestringOptionalOne of: fuel_and_non_fuel_purchase, fuel_purchase, non_fuel_purchase
Maximum length: 5000
reported_breakdownobjectOptional
reported_breakdown.fuelobjectOptional
reported_breakdown.fuel.gross_amount_decimalstringOptionalFormat: decimal
reported_breakdown.non_fuelobjectOptional
reported_breakdown.non_fuel.gross_amount_decimalstringOptionalFormat: decimal
reported_breakdown.taxobjectOptional
reported_breakdown.tax.local_amount_decimalstringOptionalFormat: decimal
reported_breakdown.tax.national_amount_decimalstringOptionalFormat: decimal
service_typestringOptionalOne of: full_service, non_fuel_transaction, self_service
Maximum length: 5000
Create a test-mode authorization — request body — body fuel
FieldTypePresenceDescription and constraints
$objectRootInformation about fuel that was purchased with this transaction.
industry_product_codestringOptionalMaximum length: 5000
quantity_decimalstringOptionalFormat: decimal
typestringOptionalOne of: diesel, other, unleaded_plus, unleaded_regular, unleaded_super
Maximum length: 5000
unitstringOptionalOne of: charging_minute, imperial_gallon, kilogram, kilowatt_hour, liter, other, pound, us_gallon
Maximum length: 5000
unit_cost_decimalstringOptionalFormat: decimal
Create a cardholder — response body
FieldTypePresenceDescription and constraints
$objectRootAn Issuing `Cardholder` object represents an individual or business entity who is [issued](https://docs.stripe.com/issuing) cards.

Related guide: [How to create a cardholder](https://docs.stripe.com/issuing/cards/virtual/issue-cards#create-cardholder)
billingModelRequired within parentExpand Create a cardholder — response body — billing
companyJSONOptional
company (anyOf 1)JSONAlternativeAdditional information about a `company` cardholder.
company (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a cardholder — response body — company value tax id provided
company (anyOf 2)nullAlternative
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
emailJSONOptional
email (anyOf 1)stringAlternativeThe cardholder's email address.
Maximum length: 5000
email (anyOf 2)nullAlternative
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
individualJSONOptional
individual (anyOf 1)JSONAlternativeAdditional information about an `individual` cardholder.
individual (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a cardholder — response body — individual value card issuing, dob, first name, last name, verification
individual (anyOf 2)nullAlternative
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectRequired within parentSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Additional keys: see wildcard field
metadata.*stringAdditional keysMaximum length: 500
namestringRequired within parentThe cardholder's name. This will be printed on cards issued to them.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: issuing.cardholder
phone_numberJSONOptional
phone_number (anyOf 1)stringAlternativeThe cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure#when-is-3d-secure-applied) for more details.
Maximum length: 5000
phone_number (anyOf 2)nullAlternative
preferred_localesJSONOptional
preferred_locales (anyOf 1)arrayAlternativeThe cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`.
This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder.
preferred_locales (anyOf 1)[]stringEach itemKnown values: de, en, es, fr, it
preferred_locales (anyOf 2)nullAlternative
requirementsModelRequired within parentExpand Create a cardholder — response body — requirements
spending_controlsJSONOptional
spending_controls (anyOf 1)JSONAlternativeRules that control spending across this cardholder's cards. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details.
spending_controls (anyOf 1) (anyOf 1)ModelAlternativeExpand Create a cardholder — response body — spending controls value allowed card presences, allowed categories, allowed merchant countries, blocked card presences, blocked categories, blocked merchant countries, spending limits, spending limits currency
spending_controls (anyOf 2)nullAlternative
statusstringRequired within parentSpecifies whether to permit authorizations on this cardholder's cards.
Known values: active, blocked, inactive
typestringRequired within parentOne of `individual` or `company`. See [Choose a cardholder type](https://docs.stripe.com/issuing/other/choose-cardholder) for more details.
Known values: company, individual

Referenced models: Create a cardholder — response body — billing, Create a cardholder — response body — spending controls value allowed card presences, allowed categories, allowed merchant countries, blocked card presences, blocked categories, blocked merchant countries, spending limits, spending limits currency, Create a cardholder — response body — company value tax id provided, Create a cardholder — response body — individual value card issuing, dob, first name, last name, verification, Create a cardholder — response body — requirements

Update a transaction — response body — amount details value atm fee, cashback amount
FieldTypePresenceDescription and constraints
$objectRoot
atm_feeJSONOptional
atm_fee (anyOf 1)JSONAlternative
atm_fee (anyOf 1) (anyOf 1)integerAlternativeThe fee charged by the ATM for the cash withdrawal.
atm_fee (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
atm_fee (anyOf 2)nullAlternative
cashback_amountJSONOptional
cashback_amount (anyOf 1)JSONAlternative
cashback_amount (anyOf 1) (anyOf 1)integerAlternativeThe amount of cash requested by the cardholder.
cashback_amount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
cashback_amount (anyOf 2)nullAlternative
Update an authorization — response body — fraud challenges array item
FieldTypePresenceDescription and constraints
$objectRoot
channelstringRequired within parentThe method by which the fraud challenge was delivered to the cardholder.
Known values: sms
statusstringRequired within parentThe status of the fraud challenge.
Known values: expired, pending, rejected, undeliverable, verified
undeliverable_reasonJSONOptional
undeliverable_reason (anyOf 1)stringAlternativeIf the challenge is not deliverable, the reason why.
Known values: no_phone_number, unsupported_phone_number
undeliverable_reason (anyOf 2)nullAlternative
Fail a testmode card — response body — lifecycle controls value cancel after
FieldTypePresenceDescription and constraints
$objectRoot
cancel_afterModelRequired within parentExpand Fail a testmode card — response body — lifecycle controls value cancel after cancel after

Referenced models: Fail a testmode card — response body — lifecycle controls value cancel after cancel after

Create a Payment Method — response body — zip
FieldTypePresenceDescription and constraints
$objectRoot

SDK function policy ID: stripe.posttesthelpersissuingauthorizationsauthorizationfinalizeamount. Catalog operation: PostTestHelpersIssuingAuthorizationsAuthorizationFinalizeAmount. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.