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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.authorization | string | Required within parent | Maximum length: 5000 |
headers | object | Optional | Additional keys: not allowed |
headers.Idempotency-Key | string | Optional | Minimum length: 1 Maximum length: 255 |
body | object | Required within parent | Additional keys: not allowed |
body.expand | array | Optional | Specifies which fields in the response should be expanded. |
body.expand[] | string | Each item | Maximum length: 5000 |
body.final_amount | integer | Required within parent | The 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.fleet | Model | Optional | Expand Create a test-mode authorization — request body — body fleet |
body.fuel | Model | Optional | Expand 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
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Update an authorization — response body |
Referenced models: Update an authorization — response body
Schemas
Section titled “Schemas”704 more schemas are linked from the tables above, on the schema pages.
Create a test-mode authorization — request body — body fleet
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Fleet-specific information for authorizations using Fleet cards. |
cardholder_prompt_data | object | Optional | |
cardholder_prompt_data.driver_id | string | Optional | Maximum length: 5000 |
cardholder_prompt_data.odometer | integer | Optional | |
cardholder_prompt_data.unspecified_id | string | Optional | Maximum length: 5000 |
cardholder_prompt_data.user_id | string | Optional | Maximum length: 5000 |
cardholder_prompt_data.vehicle_number | string | Optional | Maximum length: 5000 |
purchase_type | string | Optional | One of: fuel_and_non_fuel_purchase, fuel_purchase, non_fuel_purchase Maximum length: 5000 |
reported_breakdown | object | Optional | |
reported_breakdown.fuel | object | Optional | |
reported_breakdown.fuel.gross_amount_decimal | string | Optional | Format: decimal |
reported_breakdown.non_fuel | object | Optional | |
reported_breakdown.non_fuel.gross_amount_decimal | string | Optional | Format: decimal |
reported_breakdown.tax | object | Optional | |
reported_breakdown.tax.local_amount_decimal | string | Optional | Format: decimal |
reported_breakdown.tax.national_amount_decimal | string | Optional | Format: decimal |
service_type | string | Optional | One of: full_service, non_fuel_transaction, self_service Maximum length: 5000 |
Create a test-mode authorization — request body — body fuel
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Information about fuel that was purchased with this transaction. |
industry_product_code | string | Optional | Maximum length: 5000 |
quantity_decimal | string | Optional | Format: decimal |
type | string | Optional | One of: diesel, other, unleaded_plus, unleaded_regular, unleaded_super Maximum length: 5000 |
unit | string | Optional | One of: charging_minute, imperial_gallon, kilogram, kilowatt_hour, liter, other, pound, us_gallon Maximum length: 5000 |
unit_cost_decimal | string | Optional | Format: decimal |
Create a cardholder — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An 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) |
billing | Model | Required within parent | Expand Create a cardholder — response body — billing |
company | JSON | Optional | |
company (anyOf 1) | JSON | Alternative | Additional information about a `company` cardholder. |
company (anyOf 1) (anyOf 1) | Model | Alternative | Expand Create a cardholder — response body — company value tax id provided |
company (anyOf 2) | null | Alternative | |
created | JSON | Required within parent | |
created (anyOf 1) | integer | Alternative | Time at which the object was created. Measured in seconds since the Unix epoch. Format: unix-time |
created (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
email | JSON | Optional | |
email (anyOf 1) | string | Alternative | The cardholder's email address. Maximum length: 5000 |
email (anyOf 2) | null | Alternative | |
id | string | Required within parent | Unique identifier for the object. Maximum length: 5000 |
individual | JSON | Optional | |
individual (anyOf 1) | JSON | Alternative | Additional information about an `individual` cardholder. |
individual (anyOf 1) (anyOf 1) | Model | Alternative | Expand Create a cardholder — response body — individual value card issuing, dob, first name, last name, verification |
individual (anyOf 2) | null | Alternative | |
livemode | boolean | Required within parent | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
metadata | object | Required within parent | Set 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.* | string | Additional keys | Maximum length: 500 |
name | string | Required within parent | The cardholder's name. This will be printed on cards issued to them. Maximum length: 5000 |
object | string | Required within parent | String representing the object's type. Objects of the same type share the same value. Known values: issuing.cardholder |
phone_number | JSON | Optional | |
phone_number (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
preferred_locales | JSON | Optional | |
preferred_locales (anyOf 1) | array | Alternative | The 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)[] | string | Each item | Known values: de, en, es, fr, it |
preferred_locales (anyOf 2) | null | Alternative | |
requirements | Model | Required within parent | Expand Create a cardholder — response body — requirements |
spending_controls | JSON | Optional | |
spending_controls (anyOf 1) | JSON | Alternative | Rules 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) | Model | Alternative | Expand 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) | null | Alternative | |
status | string | Required within parent | Specifies whether to permit authorizations on this cardholder's cards. Known values: active, blocked, inactive |
type | string | Required within parent | One 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
atm_fee | JSON | Optional | |
atm_fee (anyOf 1) | JSON | Alternative | |
atm_fee (anyOf 1) (anyOf 1) | integer | Alternative | The fee charged by the ATM for the cash withdrawal. |
atm_fee (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
atm_fee (anyOf 2) | null | Alternative | |
cashback_amount | JSON | Optional | |
cashback_amount (anyOf 1) | JSON | Alternative | |
cashback_amount (anyOf 1) (anyOf 1) | integer | Alternative | The amount of cash requested by the cardholder. |
cashback_amount (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
cashback_amount (anyOf 2) | null | Alternative |
Update an authorization — response body — fraud challenges array item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
channel | string | Required within parent | The method by which the fraud challenge was delivered to the cardholder. Known values: sms |
status | string | Required within parent | The status of the fraud challenge. Known values: expired, pending, rejected, undeliverable, verified |
undeliverable_reason | JSON | Optional | |
undeliverable_reason (anyOf 1) | string | Alternative | If the challenge is not deliverable, the reason why. Known values: no_phone_number, unsupported_phone_number |
undeliverable_reason (anyOf 2) | null | Alternative |
Fail a testmode card — response body — lifecycle controls value cancel after
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
cancel_after | Model | Required within parent | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"}