Skip to main content

authorize Method

Overview

The authorize method reserves funds on a customer's payment method without transferring them. This is the first step in a two-step payment flow (authorize + capture), commonly used in e-commerce, marketplaces, and subscription businesses.

Business Use Case: When a customer places an order, you want to verify their payment method has sufficient funds and lock those funds for fulfillment. The actual charge (capture) happens later when the order ships or service is delivered.

Purpose

Why use authorization instead of immediate charge?

ScenarioBenefit
E-commerce fulfillmentVerify funds at checkout, capture when order ships
Hotel reservationsPre-authorize for incidentals, capture final amount at checkout
Marketplace holdsSecure funds from buyer before releasing to seller
Subscription trialsValidate card at signup, first charge after trial ends

Key outcomes:

  • Guaranteed funds availability (typically 7-10 days hold)
  • Reduced fraud exposure through pre-verification
  • Better customer experience (no double charges for partial shipments)
  • Compliance with card network rules for delayed delivery

Request Fields

FieldTypeRequiredDescription
merchant_transaction_idstringYesYour unique transaction reference
amountMoneyYesThe amount for the payment in minor units (e.g., 1000 = $10.00)
order_tax_amountint64NoTax amount for the order in minor units
shipping_costint64NoCost of shipping for the order in minor units
payment_methodPaymentMethodYesPayment method to be used (card, wallet, bank)
capture_methodCaptureMethodNoMethod for capturing. Values: MANUAL, AUTOMATIC
customerCustomerNoCustomer information for fraud scoring
addressPaymentAddressNoBilling and shipping address
auth_typeAuthenticationTypeYesAuthentication flow type (e.g., THREE_DS, NO_THREE_DS)
enrolled_for_3dsboolNoWhether 3DS enrollment check passed
authentication_dataAuthenticationDataNo3DS authentication results
metadataSecretStringNoAdditional metadata for the connector (max 20 keys)
return_urlstringNoURL to redirect customer after 3DS/redirect flow
webhook_urlstringNoURL for async webhook notifications
test_modeboolNoProcess as test transaction

Response Fields

FieldTypeDescription
merchant_transaction_idstringYour transaction reference (echoed back)
connector_transaction_idstringConnector's transaction ID (e.g., Stripe pi_xxx)
statusPaymentStatusCurrent status: AUTHORIZED, PENDING, FAILED, etc.
errorErrorInfoError details if status is FAILED
status_codeuint32HTTP-style status code (200, 402, etc.)
incremental_authorization_allowedboolWhether amount can be increased later

Example

SDK Setup

from orchestratorx_prism import PaymentClient

payment_client = PaymentClient(
connector='stripe',
api_key='YOUR_API_KEY',
environment='SANDBOX'
)

Request

request = {
"merchant_transaction_id": "txn_order_001",
"amount": {
"minor_amount": 1000,
"currency": "USD"
},
"payment_method": {
"card": {
"card_number": {"value": "4242424242424242"},
"card_exp_month": {"value": "12"},
"card_exp_year": {"value": "2027"},
"card_cvc": {"value": "123"},
"card_holder_name": {"value": "John Doe"}
}
},
"auth_type": "NO_THREE_DS",
"capture_method": "MANUAL",
"test_mode": True
}

response = await payment_client.authorize(request)

Response

{
"merchant_transaction_id": "txn_order_001",
"connector_transaction_id": "pi_3Oxxx...",
"status": "AUTHORIZED",
"status_code": 200,
"incremental_authorization_allowed": False
}

Next Steps

  • capture - Finalize the payment and transfer funds
  • void - Release held funds if order cancelled
  • get - Check current authorization status