A payout request starts the process for paying vendors. Creating a payout request authorizes it immediately, but the transaction isn’t flagged for batch processing until it’s captured.

This guide explains how to authorize payout transactions with the Payabli API. The first step in processing payouts is to authorize a payout transaction. When the payout is authorized, use the returned referenceId to capture the transaction.

Payout considerations

When working with payouts, keep these points in mind.

  • You can include multiple invoices on a payout request, provided that the invoices are for the same vendor.
  • At this time, payouts can be made to US and Canadian vendors only. Only paper check payments are available for Canadian vendors currently.
  • Payout processing supports ASCII characters only. Don’t send non-ASCII characters in any fields related to payout processing.

Build the request

First, choose an endpoint. If you’re testing, use the Sandbox endpoint..

Authenticate

Authenticate by sending your API token in the request header with the key requestToken:
--header 'requestToken: API TOKEN'

Path parameters

These are optional path parameters.

forceCustomerCreation
boolean
default:
"false"

When true, the request creates a new customer record, regardless of whether the customer data matches an existing customer.

allowDuplicatedBills
boolean
default:
"false"

When true, the authorization bypasses the requirement for unique bills, identified by vendor invoice number. This allows you to make more than one payout authorization for a bill, like a split payment.

doNotCreateBills
boolean
default:
"false"

When true, Payabli won’t create an associated bill for this payout transaction. You don’t have to use Payabli’s bill engine to make payouts, but Payabli automatically creates a bill for a payout request if this parameter is null or false.

Body parameter

These are the required and recommended body parameters. See the API reference for all available parameters. To authorize the request, be sure to pass your API token as requestToken in the request header.

body
object

Send bill image with payout authorization

For the smoothest payout experience, Payabli recommends always sending an image of a vendor bill. If you use Payabli’s bill engine, you can add the bill image when you create the bill. If not, you can include a bill image with your payout authorization request.

You have two options for attaching the image in the payout authorization request:

  • Base64-encoded string
  • A publicly-accessible fURL where the file is hosted

In payout authorization requests, how these options work depends on whether the doNotCreateBills is true or false. If you have a public link for the bill’s file, pass the file’s URL (furl) in the request, and set doNotCreateBills to true. Payabli will send the link to the payout processor.

If you don’t have a public link for the bill image file, you can include the file as Base64-encoded content. Payabli saves the file and send a link to the processor. In this situation, you must set doNotCreateBills to false or Payabli won’t save the file or send it to the payout processor.

MethoddoNotCreateBills is truedoNotCreateBills is false
Base64-encodedPayabli doesn’t save a file for the base64-encoded content because doNotCreateBills is true. During the money out capture process, Payabli sends out the capture to the payout processor without any file information.Payabli stores base64-encoded content as a file when doNotCreateBills is false. During the capture process, Payabli generates a publicly accessible URL for the file and sends it to the payout processor.
fURLIf you have the file hosted publicly, you can send the file’s URL as the fURL instead. When doNotCreateBills is true, Payabli doesn’t save the file. During the capture process, Payabli passes the URL you sent with the request to the payout processor.If you have the file hosted publicly, you can send the file’s URL instead. Since doNotCreateBills is false, Payabli uses the URL from the request to save the file. During the capture process, Payabli generates a publicly accessible URL for the file and sends it to the payout processor.

Example request

This example authorizes a payout from the “test” entrypoint. The amount is $47, the vendor number is 7895433, and the only invoice being paid is 54323-7.

Authorize transaction for payout
curl --request POST \
     --url 'https://api-sandbox.payabli.com/api/MoneyOut/authorize?forceVendorCreation=false' \
     --header 'accept: application/json' \
     --header 'content-type: application/*+json' \
     --header 'requestToken: <insert API token>' \
     --data '
{
     "paymentMethod": {
          "method": "managed"
     },
     "paymentDetails": {
          "totalAmount": 47
     },
     "vendorData": {
          "vendorNumber": "7895433",
          "name1": "Erin Enterprises, Inc.",
          "ein": "123456789",
          "phone": "1232006965",
          "address1": "123 Tom Cooper Way",
          "address2": "Suite #2",
          "city": "Longwood",
          "state": "FL",
          "zip": "90045",
          "country": "US",
          "remitAddress1": "P.O. Box 1554 ",
          "remitAddress2": "#3",
          "remitCity": "Longwood",
          "remitState": "FL",
          "remitZip": "78045",
          "customerVendorAccount": "74544221-1"
     },
     "invoiceData": [ {
        "invoiceNumber": "54323-7",
        "netAmount": "47",
        "attachments": [
          {
            "ftype": "pdf",
            "filename": "the-bill.pdf",
            "furl": "https://mysite.com/the-bill.pdf"
          }
        ]
      }
     ],
     "entryPoint": "test",
     "orderDescription": "paying Michelle!"
}
'

Example response

A successful request returns a JSON response. You need the referenceId from the response to capture the transaction. In this example, the ID is 129-219.

Payout authorization success response
{
  "responseText": "Success",
  "isSuccess": true,
  "responseData": {
    "referenceId": "129-219",
    "resultCode": 1,
    "resultText": "Authorized",
    "customerId": 53
  }
}
Now, you must capture the payout using the referenceId returned.