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
merchantTransactionIdstringYesYour unique transaction reference
amountMoneyYesThe amount for the payment in minor units (e.g., 1000 = $10.00)
orderTaxAmountint64NoTax amount for the order in minor units
shippingCostint64NoCost of shipping for the order in minor units
paymentMethodPaymentMethodYesPayment method to be used (card, wallet, bank)
captureMethodCaptureMethodNoMethod for capturing. Values: MANUAL, AUTOMATIC
customerCustomerNoCustomer information for fraud scoring
addressPaymentAddressNoBilling and shipping address
authTypeAuthenticationTypeYesAuthentication flow type (e.g., THREE_DS, NO_THREE_DS)
enrolledFor3dsboolNoWhether 3DS enrollment check passed
authenticationDataAuthenticationDataNo3DS authentication results
metadataSecretStringNoAdditional metadata for the connector (max 20 keys)
returnUrlstringNoURL to redirect customer after 3DS/redirect flow
webhookUrlstringNoURL for async webhook notifications
testModeboolNoProcess as test transaction

Response Fields

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

Example

SDK Setup

use OrchestratorXPrism\PaymentClient;

$paymentClient = new PaymentClient([
'connector' => 'stripe',
'apiKey' => 'YOUR_API_KEY',
'environment' => 'SANDBOX'
]);

Request

$request = [
'merchantTransactionId' => 'txn_order_001',
'amount' => [
'minorAmount' => 1000,
'currency' => 'USD'
],
'paymentMethod' => [
'card' => [
'cardNumber' => ['value' => '4242424242424242'],
'cardExpMonth' => ['value' => '12'],
'cardExpYear' => ['value' => '2027'],
'cardCvc' => ['value' => '123'],
'cardHolderName' => ['value' => 'John Doe']
]
],
'authType' => 'NO_THREE_DS',
'captureMethod' => 'MANUAL',
'testMode' => true
];

$response = $paymentClient->authorize($request);

Response

[
'merchantTransactionId' => 'txn_order_001',
'connectorTransactionId' => 'pi_3Oxxx...',
'status' => 'AUTHORIZED',
'statusCode' => 200,
'incrementalAuthorizationAllowed' => false
]

Next Steps

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