# Manual capture

Authorise funds first, then capture later after delivering goods or services. Also known as 'Auth and Capture' or two-step flow.

## Use cases

- Hotel bookings
- Car rentals
- Pre-orders
- Fraud review workflows
- Physical goods (capture on shipment)

## Steps

### 1. Create payment intent — `POST /payments`

Create a payment intent with capture_method set to 'manual'. This authorises the payment without capturing funds.

Request body:

```json
{
  "amount": 6500,
  "currency": "ZAR",
  "confirm": false,
  "description": "Test payment from Interactive Docs",
  "return_url": "https://example.com/flows/simple-purchase?status=complete",
  "is_iframe_redirection_enabled": true,
  "billing": {
    "address": {
      "line1": "123 Main Street",
      "line2": "Apartment 4B",
      "city": "Cape Town",
      "state": "Western Cape",
      "zip": "8001",
      "country": "ZA",
      "first_name": "John",
      "last_name": "Doe"
    },
    "phone": {
      "number": "821234567",
      "country_code": "+27"
    },
    "email": "john.doe@example.com"
  },
  "shipping": {
    "address": {
      "line1": "456 Delivery Road",
      "line2": "Unit 7",
      "city": "Cape Town",
      "state": "Western Cape",
      "zip": "8001",
      "country": "ZA",
      "first_name": "John",
      "last_name": "Doe"
    },
    "phone": {
      "number": "821234567",
      "country_code": "+27"
    },
    "email": "john.doe@example.com"
  },
  "capture_method": "manual",
  "authentication_type": "three_ds"
}
```

### 2. Mount SDK

Initialise the SDK and mount the checkout component for customer authorisation.

### 3. Customer authorises

Customer enters payment details and authorises the payment. Funds are held but not transferred.

### 4. Capture or void authorisation

In **requires_capture**, complete the flow in one of two ways:

• **Capture** — POST /payments/{id}/capture after fulfilment (full or partial).

• **Void** — POST /payments/{id}/cancel to release the hold without charging.

Request body (Capture):

```json
{
  "amount_to_capture": 6500
}
```

Request body (Void authorisation):

```json
{
  "cancellation_reason": "abandoned"
}
```

## Response

Payment endpoints return the payment object. Key fields to read:

- `payment_id` — the payment identifier.
- `status` — current payment status (see the state transitions below).
- `client_secret` — pass to the SDK to complete the payment client-side.
- `next_action` — present when a redirect or 3-D Secure challenge is required.

## Key parameters

- capture_method: 'manual'
- Two-step: authorise then capture
- Supports partial capture
- Uncaptured funds auto-released

## Flow diagram

```mermaid
flowchart LR
    A[Create Payment] --> B[Mount SDK]
    B --> C[Customer Authorises]
    C --> D{Authorised?}
    D -->|Yes| E[Funds Held]
    E --> F[Deliver Goods/Service]
    E --> V{Capture or Void?}
    V -->|Capture| G[Capture Payment]
    G --> H{Full or Partial?}
    H -->|Full| I[succeeded]
    H -->|Partial| J[partially_captured]
    V -->|Void| X[Hold Released]
    D -->|No| K[Show Error]
```

## Payment state transitions

```mermaid
stateDiagram-v2
    [*] --> requires_payment_method: Create Payment
    requires_payment_method --> requires_confirmation: Add Payment Method
    requires_confirmation --> processing: Confirm
    processing --> requires_capture: Authorised
    processing --> failed: Authorisation Failed
    requires_capture --> succeeded: Full Capture
    requires_capture --> partially_captured: Partial Capture
    requires_capture --> cancelled: Void
    succeeded --> [*]
    partially_captured --> [*]
    cancelled --> [*]
```

---

Interactive version: https://playground.peachpayments.com/flows/manual-capture
