> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Authorize and capture payout

POST https://api-sandbox.payabli.com/api/MoneyOut/payout
Content-Type: application/json

Authorizes a payout and captures it in the same request, returning the capture result. Use this endpoint when you need the capture outcome synchronously: it does the same work as calling `POST /MoneyOut/authorize` followed by `GET /MoneyOut/capture/{referenceId}`, in a single call.

Risk and fraud review runs at both the authorize and capture stages, exactly as it does for the two-call flow.

Payabli ignores the `autoCapture` field in the request body, since this endpoint always captures inline.

If the capture fails, the payout stays authorized. Retry the capture with `GET /MoneyOut/capture/{referenceId}` using the `referenceId` from the error response rather than resubmitting, which would create a second payout. See the [Manage payouts guide](/guides/pay-out-developer-payouts-manage#authorize-and-capture-in-one-call) for details.

Reference: https://docs.payabli.com/developers/api-reference/moneyout/authorize-and-capture-a-payout

## Authentication

- `Authorization` header (bearer token, required)
- `requestToken` header (required) — Long-lived API token sent in the `requestToken` header. See [API token authentication](/developers/api-tokens).

## Servers

- `https://api-sandbox.payabli.com/api` (Sandbox, default)
- `https://api.payabli.com/api` (Production)

## Request

### Query parameters

- `sameDayACH` (boolean, optional, default: false) — When `true`, Payabli authorizes the payout for same-day ACH processing instead of standard ACH. Same-day ACH must be enabled for the paypoint, otherwise the authorization fails with a `400` response and `responseCode` `3492`. Only ACH payouts honor this flag. Wire and RTP payouts ignore it. Because this endpoint captures immediately, pass `autoConvertSameDayAch` with a value of `true` to fall back to standard ACH if the capture runs after the same-day ACH cutoff.
- `doNotCreateBills` (boolean, optional, default: false) — When `true`, Payabli won't automatically create a bill for this payout transaction.
- `allowDuplicatedBills` (boolean, optional, default: false) — When `true`, the payout bypasses the requirement for unique bills, identified by vendor invoice number. This allows you to make more than one payout for a bill, like a split payment.
- `updateVendorPaymentMethod` (boolean, optional, default: false) — When `true`, Payabli updates the vendor's stored default payment method to the method used in this payout.
- `autoConvertSameDayAch` (boolean, optional, default: false) — Controls what happens to a payout authorized with `sameDayACH` set to `true` when the capture runs after the same-day ACH cutoff. When `true`, Payabli converts the payout to a standard ACH payment and captures it. When `false`, the capture is declined. This parameter has no effect on payouts that weren't authorized for same-day ACH.

### Headers

- `idempotencyKey` (string, optional) — _Optional but recommended_ A unique ID that you can include to prevent duplicating objects or transactions in the case that a request is sent more than once. This key isn't generated in Payabli, you must generate it yourself. This key persists for 2 minutes. After 2 minutes, you can reuse the key if needed.

### Body (application/json)

- `entryPoint` (string, required) — The entrypoint identifier.
- `paymentMethod` (object, required) — Payment method object for vendor payouts. * `{ method: "managed" }` - Managed payment method * `{ method: "vcard" }` - Virtual card payment method * `{ method: "check" }` - Check payment method * `{ method: "ach", achHolder: "...", achRouting: "...", achAccount: "...", achAccountType: "..." }` - ACH payment method with bank details * `{ method: "ach", storedMethodId: "..." }` - ACH payment method using stored method ID * `{ method: "wire", achHolder: "...", achRouting: "...", achAccount: "...", achAccountType: "..." }` - Wire transfer payment method (US only, irrevocable) * `{ method: "rtp", achHolder: "...", achRouting: "...", achAccount: "...", achAccountType: "..." }` - Real-Time Payments method (US only, irrevocable)
  - `method` (string, required) — Payment method type - "managed", "vcard", "check", "ach", "wire", or "rtp"
  - `achHolder` (string, optional) — Account holder name for ACH payments. Required when method is "ach" and not using `storedMethodId`.
  - `achRouting` (string, optional) — Bank routing number for ACH payments. Required when method is "ach" and not using `storedMethodId`.
  - `achAccount` (string, optional) — Bank account number for ACH payments. Required when method is "ach" and not using `storedMethodId`.
  - `achAccountType` (string, optional) — Account type for ACH payments ("checking" or "savings"). Required when method is "ach" and not using `storedMethodId`.
  - `achCode` (string, optional) — Standard Entry Class (SEC) code is a three letter code that describes how an ACH payment was authorized. Supported values are: - **PPD** (Prearranged Payment and Deposit) — Used for credits or debits where an accountholder authorizes a company to initiate either a single or recurring transaction to their personal bank account. Common examples include direct deposit of payroll, mortgage payments, or utility bills. This is the default value for subscription payments. - **WEB** (Internet-Initiated/Mobile Entry) — Used for debit entries when authorization is obtained from an accountholder via the internet or a wireless network. Common examples are online bill payments, ecommerce purchases, and mobile app payments where the consumer enters their banking information online. - **TEL** (Telephone-Initiated Entry) — Used for one-time debit entries where authorization is obtained from a consumer via telephone. Common examples are phone-based purchases or bill payments where the consumer provides their banking information over the phone. - **CCD** (Corporate Credit or Debit) — Used for fund transfers between business accounts. This code is specifically for business-to-business transactions. Common examples include vendor payments and other business-to-business payments. - **BOC** (Back Office Conversion) — Used to convert paper checks received in-person at a point-of-sale or staffed payment location into electronic ACH debits. Required for Remote Deposit Capture (RDC) transactions. Only supports consumer checks; business, government, and mailed checks aren't eligible.
  - `achHolderType` (enum, optional, default: personal) — The bank's accountholder type: personal or business.
    - Allowed values: `personal`, `business`
  - `storedMethodId` (string, optional) — ID of the stored ACH payment method. Only applicable when method is `ach`. Use this to reference a previously saved ACH method instead of providing bank details directly.
  - `initiator` (string, optional) — The transaction's initiator. Indicates who initiated the transaction.
  - `storedMethodUsageType` (string, optional) — **Strongly recommended.** The usage type for the stored method, used for merchant-initiated transactions (MIT). If you don't specify a value, Payabli defaults to `unscheduled`. Available values: - `unscheduled`: One-time or otherwise not pre-scheduled. - `subscription`: Subscription payments. For example, monthly rental fees or ongoing service subscriptions. - `recurring`: Recurring payments per a set plan. For example, splitting an HOA special assessment over 6 monthly payments. See [Understanding CIT and MIT Indicators](/guides/pay-in-transactions-cit-mit-overview) for more information.
- `paymentDetails` (object, required) — Object containing payment details.
  - `checkNumber` (string, optional) — A check number between 1 and 500,000,000. This value must be passed as a string. This value can be used for fraud prevention with the positive pay service. When no check number is provided, Payabli automatically manages check numbering and sequencing for checks issued from the same bank account.
  - `currency` (string, optional) — Currency code ISO-4217. If no code is provided, then the currency in the paypoint setting is used. Default is **USD**.
  - `serviceFee` (double, optional) — Service fee to be deducted from the total amount. This amount must be a number, percentages aren't accepted. If you are using a percentage-based fee schedule, you must calculate the value manually.
  - `totalAmount` (double, optional) — Total amount to be charged. If a service fee is included, then this amount should include the service fee. If you're using managed payables (`paymentMethod.method` of `managed`), you can partially pay a single bill by setting this below the bill's outstanding balance. See [Partially pay a bill](/guides/pay-out-developer-bills-manage#partially-pay-a-bill).
  - `unbundled` (boolean, optional) — Indicates whether the payout should be bundled into a single transaction or processed separately. If set to `true`, each bill will be processed as a separate payout. If `false` or not provided, then multiple bills will be paid with a single payout.
- `vendorData` (object, required) — Object containing vendor data.
  - `vendorNumber` (string, optional) — Custom number identifying the vendor. Must be unique in paypoint. Can't be blank.
  - `vendorId` (integer, optional) — Payabli identifier for the vendor record. Required when `vendorNumber` isn't included.
- `source` (string, optional) — Custom identifier to indicate the transaction or request source.
- `orderId` (string, optional) — Custom identifier for the transaction.
- `orderDescription` (string, optional) — Text description of the transaction.
- `invoiceData` (list of object, optional) — Bills to pay with this payout, each referenced by `billId`.
  - `billId` (long, required) — The bill's ID in Payabli. This value is automatically generated by Payabli when the bill is created.
- `accountId` (string, optional) — Custom identifier for payment connector.
- `subdomain` (string, optional) — Refers to the payment page identifier. If provided, then the transaction is linked to the payment page.
- `subscriptionId` (long, optional) — Payabli identifier of the subscription associated with the transaction.
- `autoCapture` (boolean, optional) — When `true`, Payabli captures the transaction asynchronously after a successful authorization. The authorization request returns once the transaction is authorized; capture happens later, and the response doesn't confirm capture. To confirm capture succeeded, listen for the [`payout_transaction_approvedcaptured`](/developers/webhooks/payout-transaction-approved-captured) webhook event. When `false`, you must manually capture the transaction after a successful authorization. Defaults to `false`. See [Manage payouts with the API](/guides/pay-out-developer-payouts-manage) for more information.

## Response

### 200

Success

- `responseCode` (integer, required) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `pageIdentifier` (string, required, nullable) — Auxiliary validation used internally by payment pages and components.
- `roomId` (long, required) — Field not in use on this endpoint. It always returns `0`.
- `isSuccess` (boolean, required) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.
- `responseText` (string, required) — Response text for operation: 'Success' or 'Declined'.
- `responseData` (object, required)
  - `authCode` (string, required, nullable) — Authorization code for the transaction.
  - `referenceId` (string, required, nullable) — The transaction reference ID, used to capture the transaction. Returns `null` when no transaction is created, such as a declined authorization.
  - `resultCode` (integer, required) — Result code for the operation. Value `1` indicates a successful operation, values `2` and `3` indicate errors. A value of `10` indicates that an operation has been initiated and is pending.
  - `resultText` (string, required) — Text describing the result. If `ResultCode` = 1, will return `Approved` or a general success message. If `ResultCode` = 2 or 3, will contain the cause of the error or decline.
  - `avsResponseText` (string, required, nullable) — Text code describing the result for address validation (applies only for card transactions).
  - `cvvResponseText` (string, required, nullable) — Text code describing the result for CVV validation (applies only for card transactions).
  - `customerId` (long, required) — Payabli-generated unique ID of the vendor on the payout. Returns the same value as `vendorId`, or `0` when no vendor is associated.
  - `vendorId` (long, required) — Payabli-generated unique ID of the vendor on the payout. Returns the same value as `customerId`, or `0` when no vendor is associated.
  - `methodReferenceId` (string, required, nullable) — The stored method's identifier (sometimes referred to as 'token') in Payabli. When `null`, the method wasn't created, or doesn't exist, depending on the operation performed.

### 202

Accepted but held for review. Returned when a velocity fraud alert (response code `9051`) is triggered. The transaction is accepted and held for risk review rather than rejected, so the body carries `isSuccess: false` and `responseCode: 9051`.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (object, optional) — Object with detailed error context.
  - `explanation` (string, optional) — Human-readable explanation of what happened.
  - `todoAction` (string, optional) — Suggested resolution.

## Examples

**Request**

```json
{
  "entryPoint": "8cfec329267",
  "paymentMethod": {
    "method": "managed"
  },
  "paymentDetails": {
    "totalAmount": 47
  },
  "vendorData": {
    "vendorNumber": "VEN-123"
  },
  "orderDescription": "Window Painting",
  "invoiceData": [
    {
      "billId": 54323
    }
  ]
}
```

**Response**

```json
{
  "responseCode": 1,
  "pageIdentifier": null,
  "roomId": 0,
  "isSuccess": true,
  "responseText": "Success",
  "responseData": {
    "authCode": null,
    "referenceId": "129-219",
    "resultCode": 1,
    "resultText": "Captured",
    "avsResponseText": null,
    "cvvResponseText": null,
    "customerId": 456,
    "vendorId": 456,
    "methodReferenceId": null
  }
}
```

**SDK Code**

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        clientId: "YOUR_CLIENT_ID",
        clientSecret: "YOUR_CLIENT_SECRET",
    });
    await client.moneyOut.payout({
        body: {
            entryPoint: "8cfec329267",
            orderDescription: "Window Painting",
            paymentMethod: {
                method: "managed",
            },
            paymentDetails: {
                totalAmount: 47,
            },
            vendorData: {
                vendorNumber: "VEN-123",
            },
            invoiceData: [
                {
                    billId: 54323,
                },
            ],
        },
    });
}
main();

```

```python
from payabli import payabli, AuthorizePaymentMethod, RequestOutAuthorizePaymentDetails, RequestOutAuthorizeVendorData, RequestOutAuthorizeInvoiceData

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

client.money_out.payout(
    entry_point="8cfec329267",
    order_description="Window Painting",
    payment_method=AuthorizePaymentMethod(
        method="managed",
    ),
    payment_details=RequestOutAuthorizePaymentDetails(
        total_amount=47,
    ),
    vendor_data=RequestOutAuthorizeVendorData(
        vendor_number="VEN-123",
    ),
    invoice_data=[
        RequestOutAuthorizeInvoiceData(
            bill_id=54323,
        )
    ],
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.resources.moneyout.requests.PayoutRequest;
import io.github.payabli.api.types.AuthorizePaymentMethod;
import io.github.payabli.api.types.AuthorizePayoutBody;
import io.github.payabli.api.types.RequestOutAuthorizeInvoiceData;
import io.github.payabli.api.types.RequestOutAuthorizePaymentDetails;
import io.github.payabli.api.types.RequestOutAuthorizeVendorData;
import java.util.Arrays;
import java.util.Optional;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

        client.moneyOut().payout(
            PayoutRequest
                .builder()
                .body(
                    AuthorizePayoutBody
                        .builder()
                        .entryPoint("8cfec329267")
                        .paymentMethod(
                            AuthorizePaymentMethod
                                .builder()
                                .method("managed")
                                .build()
                        )
                        .paymentDetails(
                            RequestOutAuthorizePaymentDetails
                                .builder()
                                .totalAmount(47.0)
                                .build()
                        )
                        .vendorData(
                            RequestOutAuthorizeVendorData
                                .builder()
                                .vendorNumber("VEN-123")
                                .build()
                        )
                        .orderDescription("Window Painting")
                        .invoiceData(
                            Optional.of(
                                Arrays.asList(
                                    RequestOutAuthorizeInvoiceData
                                        .builder()
                                        .billId(54323L)
                                        .build()
                                )
                            )
                        )
                        .build()
                )
                .build()
        );
    }
}
```

```csharp
using PayabliApi;
using System.Threading.Tasks;
using System.Collections.Generic;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        await client.MoneyOut.PayoutAsync(
            new PayoutRequest {
                Body = new AuthorizePayoutBody {
                    EntryPoint = "8cfec329267",
                    OrderDescription = "Window Painting",
                    PaymentMethod = new AuthorizePaymentMethod {
                        Method = "managed"
                    },
                    PaymentDetails = new RequestOutAuthorizePaymentDetails {
                        TotalAmount = 47
                    },
                    VendorData = new RequestOutAuthorizeVendorData {
                        VendorNumber = "VEN-123"
                    },
                    InvoiceData = new List<RequestOutAuthorizeInvoiceData>(){
                        new RequestOutAuthorizeInvoiceData {
                            BillId = 54323L
                        },
                    }

                }
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    request := &payabli.PayoutRequest{
        Body: &payabli.AuthorizePayoutBody{
            EntryPoint: "8cfec329267",
            PaymentMethod: &payabli.AuthorizePaymentMethod{
                Method: "managed",
            },
            PaymentDetails: &payabli.RequestOutAuthorizePaymentDetails{
                TotalAmount: payabli.Float64(
                    47,
                ),
            },
            VendorData: &payabli.RequestOutAuthorizeVendorData{
                VendorNumber: payabli.String(
                    "VEN-123",
                ),
            },
            OrderDescription: payabli.String(
                "Window Painting",
            ),
            InvoiceData: []*payabli.RequestOutAuthorizeInvoiceData{
                &payabli.RequestOutAuthorizeInvoiceData{
                    BillId: int64(54323),
                },
            },
        },
    }
    client.MoneyOut.Payout(
        context.TODO(),
        request,
    )
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\MoneyOut\Requests\PayoutRequest;
use Payabli\Types\AuthorizePayoutBody;
use Payabli\Types\AuthorizePaymentMethod;
use Payabli\Types\RequestOutAuthorizePaymentDetails;
use Payabli\Types\RequestOutAuthorizeVendorData;
use Payabli\Types\RequestOutAuthorizeInvoiceData;

$client = new PayabliClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$client->moneyOut->payout(
    new PayoutRequest([
        'body' => new AuthorizePayoutBody([
            'entryPoint' => '8cfec329267',
            'orderDescription' => 'Window Painting',
            'paymentMethod' => new AuthorizePaymentMethod([
                'method' => 'managed',
            ]),
            'paymentDetails' => new RequestOutAuthorizePaymentDetails([
                'totalAmount' => 47,
            ]),
            'vendorData' => new RequestOutAuthorizeVendorData([
                'vendorNumber' => 'VEN-123',
            ]),
            'invoiceData' => [
                new RequestOutAuthorizeInvoiceData([
                    'billId' => 54323,
                ]),
            ],
        ]),
    ]),
);

```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/MoneyOut/payout")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"entryPoint\": \"8cfec329267\",\n  \"paymentMethod\": {\n    \"method\": \"managed\"\n  },\n  \"paymentDetails\": {\n    \"totalAmount\": 47\n  },\n  \"vendorData\": {\n    \"vendorNumber\": \"VEN-123\"\n  },\n  \"orderDescription\": \"Window Painting\",\n  \"invoiceData\": [\n    {\n      \"billId\": 54323\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "entryPoint": "8cfec329267",
  "paymentMethod": ["method": "managed"],
  "paymentDetails": ["totalAmount": 47],
  "vendorData": ["vendorNumber": "VEN-123"],
  "orderDescription": "Window Painting",
  "invoiceData": [["billId": 54323]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyOut/payout")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```