> ## Documentation Index
> Fetch the complete documentation index at: https://docs.juicyway.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bank Transfer

> Capture payments via bank transfer with virtual accounts

## Overview

Bank transfer capture generates a virtual account where the customer can deposit funds. This is an asynchronous process - you'll receive webhook notifications when the transfer is detected and completed.

<Note>
  Virtual accounts are typically valid for 24 hours. Monitor the `expires_at` field in the response to know when the account will expire.
</Note>

## Capture Flow

<Steps>
  <Step title="Generate Virtual Account">
    Call the capture endpoint to get bank account details
  </Step>

  <Step title="Customer Transfer">
    Customer initiates transfer to provided account
  </Step>

  <Step title="Payment Detection">
    System detects incoming transfer
  </Step>

  <Step title="Confirmation">
    Receive webhook notification of successful payment
  </Step>
</Steps>

## Endpoint

```http theme={null}
POST /payment-sessions/{payment_id}
```

### Path Parameters

<ParamField path="payment_id" type="string" required>
  The ID of the payment session to capture
</ParamField>

### Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.spendjuice.com/payment-sessions/265710b4-255d-11ee-add2-2ae94e9097ac" \
  -H "Authorization:  YOUR_API_KEY" \
  -H "Content-Type: application/json"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.spendjuice.com/payment-sessions/265710b4-255d-11ee-add2-2ae94e9097ac',
    {
      method: 'POST',
      headers: {
        'Authorization': ' YOUR_API_KEY',
        'Content-Type': 'application/json'
      }
    }
  );

  const result = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.spendjuice.com/payment-sessions/265710b4-255d-11ee-add2-2ae94e9097ac',
      headers={
          'Authorization': ' YOUR_API_KEY',
          'Content-Type': 'application/json'
      }
  )
  ```
</CodeGroup>

### Response Example

```json theme={null}
{
  "data": {
    "auth_type": null,
    "expires_at": "2024-03-20T11:56:43.482556Z",
    "links": {},
    "message": "Waiting for payment resolution",
    "payment": {
      "amount": 100000,
      "cancellation_reason": null,
      "correlation_id": "26571e60-255d-11ee-b2a8-2ae94e9097ac",
      "currency": "NGN",
      "customer": {
        "billing_address": {
          "city": "Ikeja",
          "country": "NG",
          "line1": "1, Church Street",
          "line2": "235 Hello Drive",
          "state": "Lagos State",
          "zip_code": "23401"
        },
        "email": "customer@example.com",
        "first_name": "John",
        "last_name": "Doe"
      },
      "date": "2024-03-19T11:20:50.050770Z",
      "description": "Product Purchase",
      "id": "265710b4-255d-11ee-add2-2ae94e9097ac",
      "order": {
        "identifier": "ORD12345",
        "items": [
          {
            "name": "Premium Package",
            "type": "digital"
          }
        ]
      }
      "mode": "live",
      "payment_method": {
        "account_name": "JUICE PAYMENTS",
        "account_number": "7650266816",
        "account_type": "savings",
        "bank_name": "Wema Bank",
        "id": "498c981d-b549-47c1-bb26-abc798b7f398",
        "type": "bank_account"
      },
      "reference": "ord_1234567890",
      "status": "pending"
    },
    "status": "pending"
  }
}
```

## Processing Times

<Card>
  **Average Processing Times**

  * NGN transfers: 5-15 minutes
  * CAD transfers: 1-2 business days

  Times may vary based on:

  * Bank network status
  * Time of day
  * Transaction volume
</Card>

## Webhook Events

Monitor these webhook events for transfer status:

<AccordionGroup>
  <Accordion title="payment.session.created">
    Virtual account generated successfully
  </Accordion>

  <Accordion title="deposit.received">
    Transfer detected but not yet confirmed
  </Accordion>

  <Accordion title="payment.session.succeeded">
    Transfer confirmed and credited
  </Accordion>

  <Accordion title="payment.session.failed">
    Transfer failed or expired
  </Accordion>
</AccordionGroup>

## Best Practices

1. **Display Information**
   * Show account details clearly
   * Include transfer instructions
   * Display expiration time
   * Show expected processing time
2. **Error Handling**
   * Handle expired accounts
   * Implement retry logic
   * Monitor transfer status
   * Log all webhook events
3. **User Experience**
   * Provide clear transfer instructions
   * Display payment status updates
   * Send email/SMS notifications
   * Include support contact info

<Card title="Need Help?">
  For assistance with bank transfers:

  * Check our [Error Handling Guide](/errors)
  * Review [Webhook Implementation](/webhooks)
  * Contact [Support](mailto:support@juicyway.com)
</Card>
