---
title: "Capture payin"
method: POST
path: "/v1/payins/{payin_id}/capture"
tags: ["Payins"]
---

# Capture payin

`POST /v1/payins/{payin_id}/capture`

## Request

- Base URL: `https://api.sandbox.rainforestpay.com`
- URL: `https://api.sandbox.rainforestpay.com/v1/payins/{payin_id}/capture`
- Auth: HTTP bearer

Capture an authorized payin. The payin status must be Authorized to capture.

## Parameters

- `#/paths/~1v1~1payins/get/parameters/0` (unresolved $ref)
- `#/paths/~1v1~1payins~1{payin_id}/get/parameters/1` (unresolved $ref)

## Request body

- object
  - `amount` integer: The amount to capture, in minor units. Must be less than or equal to the amount authorized. If omitted or set to 0, the full authorized amount will be captured.
  - `amount_splits` object[]: Update the amount split, which represents how the payin should be split between the originating merchant, the platform, and one or more other merchants. If omitted, the amount split defined on the payin config will be used.
    - `rate` integer: The amount split defined as a rate, in percent mille (1 PCM = 0.001%). The amount split will be calculated on the authorized amount of the payin. For example, 3000 is 3%.
    - `rate_cap` integer: The amount split rate cap, in minor units. Used to cap the rate to a specified amount. For example, 1000 is 10.00 USD. The following validation must be met: If the rate is greater than 0%, then the rate_cap must be greater than $0. For example, to bill a rate of 1% up to $100 set the value to 10000. If the rate is 0%, then the rate_cap must be $0.
    - `amount` integer, required: The amount split, in minor units. For example, 1000 is 10.00 USD.
    - `currency_code` CurrencyCode, required (unresolved $ref)
    - `type` 'PLATFORM' | 'MERCHANT', required: The type of receiver for this split. `PLATFORM` allocates the split amount to the platform. `MERCHANT` allocates the split amount to the merchant specified by merchant_id.
    - `merchant_id` string: Required when type is `MERCHANT`. The unique identifier of the merchant receiving this split. The merchant status must be ACTIVE. The following constraints must be met: - Cannot match the merchant_id of the originating merchant on the payin. - Cannot be duplicated within the same amount_splits array. - Not valid when type is `PLATFORM`. Prefix is mid in production and sbx_mid in sandbox.
    - `amount_split_reversal_config` object: Controls whether this amount split is reversed on a refund for the full amount or an ACH return. When not provided, both attributes default to false.
      - `on_full_refund` boolean: Determines whether this amount split is reversed when a refund for the full amount is processed on this payin. When `true`, the receiver's allocation is pulled back on the refund. When `false`, the receiver retains their allocation and the originating merchant absorbs this amount of the refund. This configuration only applies to full refunds. For partial refunds, amount_splits on the refund request can be provided to specify the reversal amounts.
      - `on_ach_return` boolean: Determines whether this amount split is reversed when an ACH return is processed on this payin. When `true`, the receiver's allocation is pulled back on the ACH return. When `false`, the receiver retains their allocation and the originating merchant absorbs this amount of the ACH return.
  - `metadata` Schema (unresolved $ref)

## Response `200`

OK

- object
  - `status` Status (unresolved $ref)
  - `data` Data (unresolved $ref)
  - `errors` Errors (unresolved $ref)

## Other responses

- `400` (unresolved $ref)
- `401` (unresolved $ref)
- `403` (unresolved $ref)
- `404` (unresolved $ref)
- `5XX` (unresolved $ref)

---

[API](https://skmtc.dev/rainforestpay/apis/payments.md) - [All operations](https://skmtc.dev/rainforestpay/apis/payments/llms.txt) - [OpenAPI document](https://skmtc.dev/rainforestpay/apis/payments/revisions/9d7d0b1553a8?raw)
