You can register an eMandate and authorize the first payment in a single step by creating an order with the method set to emandate. This requires providing customer details and token configuration.
Parameters:
amount (integer, required): The amount to be captured (in paise).currency (string, required): The currency of the payment (defaults to INR).customer_id (string, required): The ID of the customer.method (string, required): Set to emandate for registration.payment_capture (boolean): If true, payment status changes to captured automatically.token (array): Contains authorization details:first_payment_amount (integer): Amount for the first transaction.auth_type (string): netbanking, debitcard, or aadhaar.max_amount (integer): Maximum amount (in paise) allowed for subsequent charges (range: 500 - 100000000).expire_at (integer): Unix timestamp for token expiration.bank_account (array): Details including beneficiary_name, account_number, account_type, and ifsc_code.
$api->order->create(array(
'amount' => 0,
'currency' => 'INR',
'method'=>'emandate',
'customer_id'=>$customerId,
'receipt'=>'Receipt No. 5',
'notes'=> array('note_key 1'=> 'Beam me up Scotty','note_key 2'=> 'Engage'),
'token'=>array(
'first_payment_amount'=>100,
'auth_type'=>'netbanking',
'max_amount'=>'9999900',
'expire_at'=>'4102444799',
'notes'=>array('note_key 1'=> 'Tea, Earl Grey… decaf.','note_key 2'=> 'Tea. Earl Gray. Hot.'),
'bank_account'=>array(
'beneficiary_name'=>'Gaurav Kumar',
'account_number'=>'11214311215411',
'account_type'=>'savings',
'ifsc_code'=>'HDFC0001233'
)
)
));