Payouts

Initiating a Payout Transaction

This documentation provides guidance on initiating a card payout transaction using the Facilero API. By sending a POST request, you can transfer funds to a specified card. Once the payout request is processed, a webhook (callback) containing the transaction details will be sent to your server.

API Endpoint

Live

POST https://live.facilero.com/v1/payouts/card

Sandbox

POST https://live.sandbox.com/v1/payouts/card

Request Headers:

  • Content-Type: application/json
  • Authorization: Bearer <AUTH_TOKEN>
    Replace <AUTH_TOKEN> with the access token obtained from the Authorization Service.

Request Body:

The request should be in JSON format and include the following parameters:

FieldTypeRequiredDescription
requestIdStringYesUnique identifier for the payout request.
midStringYesMerchant account ID to associate the payout.
userEmailStringYesEmail address of the recipient.
amountStringYesThe amount to be transferred.
cardObject CardDetailsYesContains card information (see CardDetails Object below).
billingDetailsObject (BillingDetails)NoContains billing details such as name, address, and contact info (see BillingDetails Object).
callbackUrlStringNoURL to receive the status update of the payout.
metadataMap<String, String>NoAdditional key-value metadata for custom use.

CardDetails Object

FieldTypeRequiredDescription
cardHolderStringYesName of the cardholder as printed on the card.
expMonthStringYesExpiration month of the card (MM format).
expYearStringYesExpiration year of the card (YYYY format).
numberStringYesCard number in string format.
cvvStringNoCard verification code (CVV/CVC).

BillingDetails Object

FieldTypeRequiredDescription
firstNameStringNoFirst name of the customer.
lastNameStringNoLast name of the customer.
addressStringNoBilling address line 1.
postalCodeStringNoPostal code.
cityStringNoBilling city.
stateStringNoBilling state or province.
countryCodeStringNoBilling country (ISO Alpha-2 format, e.g., US, FR).
phoneStringNoCustomer’s phone number.
emailStringNoCustomer’s email address.

Example Request

curl -X POST "https://live.facilero.com/v1/payouts/card" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <AUTH_TOKEN>" \
  -d '{
    "requestId": "req12345",
    "mid": "merchant001",
    "userEmail": "[email protected]",
    "amount": "100.00",
    "card": {
      "cardHolder": "John Doe",
      "expMonth": "12",
      "expYear": "2025",
      "number": "4111111111111111",
    },
    "billingDetails":{
      "firstName": "John",
      "lastName": "Doe",
    	"phone": "+1234567890",
    	"email": "[email protected]",
      "countryCode: "AU"
    },
    "callbackUrl": "https://yourserver.com/callback",
    "metadata": {
      "customKey1": "customValue1",
      "customKey2": "customValue2"
    }
  }'

Response Details

The payout endpoint provides structured responses to indicate the success or failure of the request.

Response Body

FieldTypeRequiredDescription
transactionIdStringYesUnique identifier for the transaction.
transactionStatusStringYesCurrent status of the transaction (e.g., NEW, PENDING, FAILED, etc.).
declineCodeIntNoDecline code if the transaction fails.

Example Successful Response

HTTP Status: 200 OK
Response Body:

{
  "transactionId": "txn12345",
  "transactionStatus": "PENDING",
  "declineCode": null,
}

Example Failed Response

HTTP Status: 200 OK
Response Body:

{
  "transactionId": "txn12345",
  "transactionStatus": "FAILED",
  "declineCode": 101,
}

Callback: Merchant Payout DTO

Once the payout is processed, a webhook will be sent to the callbackUrl specified in the request. The callback provides details about the payout and its status.

Payout Callback DTO

The callback object includes the following fields:

FieldTypeRequiredDescription
transactionIdStringYesThe unique identifier for the payout transaction.
requestIdStringYesThe original request ID provided when initiating the payout.
midStringYesMerchant ID associated with the payout.
transactionStatusEnumYesThe status of the payout (e.g., PENDING, SUCCEED, FAILED).
declineCodeIntegerNoCode indicating the reason for failure (if applicable).
cardMaskStringYesMasked card number (e.g., 4111********1111).
cardHolderStringYesName of the cardholder (if available).
totalAmountDoubleYesThe total amount transferred.
callbackUrlStringNoThe URL where the callback was sent.
createdAtStringYesTimestamp when the payout transaction was created.

Example Callback Object

{
  "transactionId": "txn12345",
  "requestId": "req67890",
  "mid": "merchant001",
  "transactionStatus": "SUCCEED",
  "declineCode": null,
  "cardMask": "411111******1111",
  "cardHolder": "John Doe",
  "totalAmount": 100.0,
  "callbackUrl": "https://yourserver.com/callback",
  "createdAt": "2024-01-01T12:00:00Z"
}