# Make your first transfer

> Create a recipient, initiate a transfer, approve it with OTP if required, and confirm the final status with webhooks or the verify endpoint.

This tutorial shows you how to send a single transfer to a customer with Paystack. You will confirm the destination account, create a recipient, initiate the transfer, and confirm the final status.

## 1. Prerequisites

Before you start, make sure you have:

- Your Paystack test secret key
- A server that can make HTTPS requests to the Paystack API
- A public webhook URL that Paystack can send events to

<localized-block regions="ng">
<callout type="info">

In test mode, use account number `1000000001` and bank code `057` (Zenith Bank). Test transfers complete immediately.

</callout>
</localized-block>

Set your secret key in your shell before making requests:

```bash
export PAYSTACK_SECRET_KEY="sk_test_xxxxxxxxxxxxxxxxxxxxx"
```

## 2. Confirm the account details

<localized-block regions="ng, gh">

Resolve the bank account first so you can confirm you are sending money to the right person before creating a recipient.

<localized-request-response src="disbursements/recipients/resolve-account">



</localized-request-response>

Check `data.account_name` in the response and confirm it matches the customer you intend to pay.

</localized-block>

<localized-block regions="za">

Account resolution isn't available for South African bank accounts. To check an account before you pay it, use [account validation](/disbursements/transfers/verify-account#account-validation). This tutorial skips that step.

</localized-block>

<localized-block regions="ke">

Account resolution isn't available in Kenya. Confirm the M-PESA phone number with your customer before you create the recipient.

</localized-block>

## 3. Create a transfer recipient

<localized-block regions="ng, gh, za">

Create a transfer recipient with the customer's bank details. Save the `recipient_code` from the response.

<localized-request-response src="disbursements/recipients/create-bank">



</localized-request-response>
</localized-block>

<localized-block regions="ke">

Create a `mobile_money` recipient with the customer's M-PESA number. Save the `recipient_code` from the response.

<localized-request-response src="disbursements/recipients/create-mobile-money">



</localized-request-response>
</localized-block>

Store the `recipient_code` in your database so you can reuse it for future transfers to the same account. See [Transfer recipients](/disbursements/transfers/recipients) for every recipient type available in your market.

## 4. Initiate the transfer

Create the transfer from your Paystack balance. Send the amount in <localized-value page-key="markets" path="subunit">



</localized-value>

, so <localized-value page-key="markets" path="currency_code">



</localized-value>

 1,000 becomes `100000`. Generate a unique `reference` for each transfer so you can verify it and retry it safely.

<localized-request-response src="disbursements/transfers/initiate">



</localized-request-response>

Save the `transfer_code` and `reference` from the response. In live mode, the transfer may remain `pending` briefly while it is processed. Use webhooks to receive the final outcome.

## 5. Approve the transfer with OTP

If OTP is turned on for transfers, the response has `message: Transfer requires OTP to continue` and `data.status: otp`. Finalize the transfer with the `transfer_code` and the OTP sent to the business owner:

<localized-request-response src="disbursements/transfers/finalize">



</localized-request-response>

If the status is `pending` or `success`, skip this step. To send transfers without OTP, see [Transfer approval](/disbursements/transfers/transfer-approval).

## 6. Handle the webhook

Listen for `transfer.success`, `transfer.failed`, and `transfer.reversed` on your webhook URL. Verify the `x-paystack-signature` header with an HMAC SHA512 hash of the raw request body before you trust the event.

<callout type="warning">

Compute the signature from the raw request body exactly as Paystack sent it. Parsing and re-serializing the payload before verification can break the hash.

</callout>

```js
import crypto from 'node:crypto'
import express from 'express'

const app = express()

app.post('/webhooks/paystack', express.raw({ type: 'application/json' }), (req, res) => {
  const secret = process.env.PAYSTACK_SECRET_KEY
  const signature = req.get('x-paystack-signature')
  const hash = crypto
    .createHmac('sha512', secret)
    .update(req.body)
    .digest('hex')

  if (hash !== signature) {
    return res.status(401).send('Invalid signature')
  }

  const event = JSON.parse(req.body.toString('utf8'))

  switch (event.event) {
    case 'transfer.success':
      console.log('Transfer succeeded:', event.data.transfer_code)
      break
    case 'transfer.failed':
      console.log('Transfer failed:', event.data.transfer_code)
      break
    case 'transfer.reversed':
      console.log('Transfer reversed:', event.data.transfer_code)
      break
    default:
      break
  }

  return res.sendStatus(200)
})
```

Update your database with the final transfer status when one of those events arrives.

## 7. Verify the transfer

If you need the status without waiting for a webhook, verify the transfer with the `reference` you sent:

<localized-request-response src="disbursements/transfers/verify">



</localized-request-response>

Read the transfer status from `data.status`. The HTTP status code only tells you whether the API call succeeded.

## 8. Test it

In test mode, run the full flow with your Paystack test secret key.

<localized-block regions="ng">

Use account number `1000000001` and bank code `057` (Zenith Bank) when you resolve the account and create the recipient.

</localized-block>

Test transfers complete immediately, so you should see `transfer.success` without waiting.

After testing, repeat the same flow in live mode with a real account, a live secret key, and a production webhook URL.
