Preauthorize a card

This document shows you how to preauthorize a card.

Card preauthorization allows a merchant to preauthorize a specific amount to be paid by a customer. Once preauthorized successfully, a hold is put on the amount specified and left for the merchant to capture that amount at a later time or date. Merchants can perform any of the following actions after preauthorizing:

Void: This allows the merchant to release the hold on the funds i.e. if value was not given for the service, the merchant would typically be required to void the transaction.

Refund: This allows the merchant to refund a captured amount.

Capture: This allows a merchant to capture or collect the preauthorized funds from the customer i.e. after value or service has been given to the customer a merchant would capture the preauthorized amount.

To preauthorize a card, simply pass a preauthorize parameter in your card charge payload and set the value to true before encryption.

{
    'preauthorize': true
}

Sample payload

{
  card_number: '*****',
  cvv: '157',
  expiry_month: '5',
  expiry_year: '22',
  amount: '1',
  fullname: 'ayo',
  tx_ref: `ref-${Date.now()}`,
  currency: 'NGN',
  country: 'NG',
  email: '[email protected]',
  redirect_url:'https://api.myurl.com',
  meta: {
    values: 'TESTX29',
    random: '9988',
  },
  preauthorize: true
};

Secure Preauth Charge

To secure a preauth charge, you can pass a usesecureauth parameter in your card charge payload and set the value to true before encryption.

Sample payload

{
  card_number: '*****',
  cvv: '157',
  expiry_month: '5',
  expiry_year: '22',
  amount: '1',
  fullname: 'ayo',
  tx_ref: `ref-${Date.now()}`,
  currency: 'NGN',
  country: 'NG',
  email: '[email protected]',
  redirect_url:'https://api.myurl.com',
  meta: {
    values: 'TESTX29',
    random: '9988',
  },
  preauthorize: true,
  usesecureauth: true,
};

Passing usesecureauth parameter means that Flutterwave will charge the card using our VBVSECURECODE auth model which returns a URL in the response as meta.authorization.redirect. Redirect the user to this URL, on completion, we will send the user to the redirect_url you specified in the initial request:

{
  status: 'success',
  message: 'Charge initiated',
  data: {
   ...
  meta: {
    authorization: {
      mode: 'redirect',
      redirect: 'https://redirect-url/'
    }
  }
}

📘

Expiration

Once an amount is preauthorized on a card and not captured within Seven (7) working days, the hold on the funds is automatically reversed