Integration Flow

Learn how to integrate with the APIs you need, to transfer money from a physical account to a beneficiary.

The figure below shows the steps involved in making a transfer from a physical account.

584

Transfer from Physical Accounts Integration Flow

Follow the steps below to make a transfer to an account.

  1. Create a beneficiary

  2. Create a transfer

  3. Verify OTP

1. [Prerequisite] Create a Beneficiary

To transfer money to an individual or an entity, account holders must add them to their account as a beneficiary.

Currently, only bank account beneficiaries are supported for transfers from physical accounts.

Learn how to create a beneficiary.

2. Create Transfer

After creating a beneficiary, you can initiate a transfer to the beneficiary. On successfully initiating a transfer, an OTP is sent to the debit account holder’s mobile number.

Use the below endpoint to create a transfer. This sends an OTP to the account holder's mobile number.

POST: https://api.zwitch.io/v1/transfers

Below is a sample request and response for the Create Transfer API.

{
  "type": "account_number",
  "debit_account_id": "sa_WWAHxveQ4TXAEs2dxRSbeDh9V",
  "beneficiary_id": "sab_eKiCE1tH8GVAkmzbTUzOLNqqg",
  "amount": 3.69,
  "payment_mode": "neft",
  "currency_code": "inr",
  "payment_remark": "Lego Death Star",
  "merchant_reference_id": "1002424",
  "metadata": {
    "key_1": "DD",
    "key_2": "XOF"
  }
}
{
  "id": "tr_bWpNjgRoIbUaau1pa1u4zR1gm",
  "object": "transfer",
  "type": "account_number",
  "amount": 3.69,
  "debit_account_id": "sa_WWAHxveQ4TXAEs2dxRSbeDh9V",
  "beneficiary_id": "sab_eKiCE1tH8GVAkmzbTUzOLNqqg",
  "status": "otp_required",
  "currency_code": "inr",
  "message": "OTP verification is pending",
  "payment_mode": "neft",
  "payment_remark": "Lego Death Star",
  "paid_to": "10000000001642",
  "otp_attempts": 0,
  "metadata": {
    "key_1": "DD",
    "key_2": "XOF"
  },
  "merchant_reference_id": "1002424",
  "transacted_at": 1663930294,
  "is_sandbox": true,
  "created_at": 1663930294
}

Learn more about the Create Transfer API.

3. Verify Transfer OTP

To process the transfer, you need to verify the OTP received. This serves as a check, verifies that the account holder initiated the transfer, and helps prevent fraud. The bank starts to process the transfer only after the OTP is verified.

Use the below endpoint to verify the OTP received.

POST: https://api.zwitch.io/v1/transfers/{transfer_id}/verify-otp

Below is a sample request and response for the Verify Transfer OTP API.

{
  "otp": "000000"
}
{
  "id": "tr_xHWHXYMIljxokPBsNFVRBq0Ao",
  "object": "transfer",
  "type": "account_number",
  "amount": 3.69,
  "debit_account_id": "sa_WWAHxveQ4TXAEs2dxRSbeDh9V",
  "beneficiary_id": "sab_eKiCE1tH8GVAkmzbTUzOLNqqg",
  "status": "success",
  "bank_reference_number": "STCB220221051342",
  "currency_code": "inr",
  "message": "success",
  "payment_mode": "neft",
  "payment_remark": "Lego Death Star",
  "paid_to": "10000000001642",
  "otp_attempts": 1,
  "metadata": {
    "key_1": "DD",
    "key_2": "XOF"
  },
  "merchant_reference_id": "1002062",
  "transacted_at": 1660896361,
  "is_sandbox": true,
  "created_at": 1660896345
}

Learn more about the Verify Transfer OTP API.

3.1. Resend Transfer OTP

Due to unforeseen circumstances, such as cellular network failures, the account holder might not receive the OTP. In such scenarios, you can resend the OTP to the account holder's mobile number.

📘

Maximum OTP Resend Attempts

You can resend the OTP a maximum of 3 times.

Use the below endpoint to resend the OTP to the account holder's mobile number.

POST: https://api.zwitch.io/v1/transfers/{transfer_id}/resend-otp

Below is a sample response for the Resend Transfer OTP API.

{
  "id": "tro_DessUsYCmS43Po9lhRnOI0HIW",
  "transfer_id": "tr_I0c4sIyfXu8amW4Gs3ioPe1Nq",
  "object": "transfer_otp",
  "status": "success",
  "message": "OTP has been generated and sent on registered Mobile No",
  "is_sandbox": true,
  "created_at": 1660896810
}

Learn more about the Resend Transfer OTP API.