API Reference
Log In
API Reference

Webhooks

In This Section

In the Webhooks section of the borderless™ documentation you will find:

  • Definition of Webhook
  • Using Webhooks
  • Setting Up Webhooks
  • Payment Webhook
  • Mass Payout Report Webhook
  • Mass Claim Payout Report Webhook

What is a Webhook?

A Webhook is a notification sent from borderless™ when an event is triggered (without the need for you to submit a request). Using Webhooks allows us to communicate with your system in real time whenever one of your clients pays with borderless™ or whenever you complete an API Request.

Using Webhooks

When an event is triggered, borderless™ will send an HTTP POST request containing the data that is created to your Webhook listener URL.

The POST request will have json body containing webhook information and two custom headers: x-borderless-webhook and x-borderless-webhook-timestamp. To verify the webhook and ensure it came from borderless™ visit How To Verify Webhooks section.

❗️

IMPORTANT

It is your responsibility to verify webhook signature with your secret before accepting the data received is on behalf of borderless™.

👍

Pro Tip

Your webhook secret can be found at the Developer Dashboard after enabling webhooks.

Setting Up Webhooks

To get started setting up webhooks, please refer to the Webhooks Guide

Payment Webhook

When a payment is issued and you have webhooks enabled for your account, we will notify you via webhook instead of email.

The webhook received will come in the json body of the POST request sent to your endpoint. The payload will provide information about the payment such as its amount, the description, and the status of the payment.

Payment Webhook Structure

FieldNameTypeDescriptionRequired
eventTypeEnumPayment | Account | PlanYes
paymentEntryTypeEnumRECEIVED_PAYMENT | CREATED_PAYMENTYes
paymentReferenceIdStringThis field is present when payment was executed successfully. In some cases where payment is failed upon submission, there is no paymentReferenceId assignedNo
paymentTypeEnumLOCAL | INTERNATIONALNo
statusEnumPENDING | SCHEDULED | UNCLAIMED | REQUESTED | PROCESSING | IN_TRANSIT | COMPLETE | CANCELED | DECLINED | FAILED | RETURNEDNo
payerStringPayer handle (or email if handle doesn’t exist)No
descriptionStringDescription of the paymentYes
amountNumberIf payment entry type is RECEIVED_PAYMENT the value of the field will be amount received in beneficiary bank currency before fee (if beneficiary pays the fee)

If payment entry type is CREATED_PAYMENT, amount is the payment amount before fees (if payer pays the fee)
Yes
totalAmountNumberIf payment entry type is RECEIVED_PAYMENT the value of the field will be totalAmount received after the fee (if beneficiary pays the fee)

If payment entry type is CREATED_PAYMENT, the value of the field will be totalAmount paid after the fee (if payer pays the fee)
Yes
feeNumberIf payment entry type is RECEIVED_PAYMENT the value of the field will be fee amount of beneficiary (if beneficiary pays the fee)

If payment entry type is CREATED_PAYMENT, the value of the field will be fee amount of payer (if payer pays the fee)
Yes
currencyEnum3-letter currency code

If payment entry type is RECEIVED_PAYMENT currency field reflects beneficiary bank currency

If payment entry type is CREATED_PAYMENT currency field reflects payer payment currency
Yes
beneficiaryStringBeneficiary handle (if exists) or emailNo
beneficiaryAmountNumberThis field appears only when payment entry type is CREATED_PAYMENT. This field indicates beneficiary amount before fee (if beneficiary pays the fee)No
beneficiaryFeeNumberThis field appears only when payment entry type is CREATED_PAYMENT. This field indicates beneficiary fee amount (if beneficiary pays the fee)No
beneficiaryTotalAmountNumberThis field appears only when payment entry type is CREATED_PAYMENT. This field indicates beneficiary total amount after fee (if beneficiary pays the fee)No
beneficiaryCurrencyEnumThis field appears only when payment entry type is CREATED_PAYMENT. This field indicates beneficiary 3 letter currencyNo
batchIdStringIf payment was executed via mass payout, batchId of the payout will be assignedNo
estimatedArrivalStringISO Date string of estimated arrivalNo
paymentMethodEnumBANK_ACCOUNT | FUNDING_BALANCENo
clientPaymentRefStringIf payment was executed via api and unique identifier of clientPaymentRef was provided then it will reflect in this fieldNo
createdAtStringISO Date string of when payment was createdNo

Examples of payment webhook bodies shown below.

Successfully executed payment (CREATED_PAYMENT)
(this webhook will be sent to payer if payer have webhooks enabled)

{
  "eventType": "Payment",
  "paymentEntrType": "CREATED_PAYMENT",
  "status": "COMPLETE",
  "paymentReferenceId": "UATPYXYZ",
  "amount": 7,
  "fee": 0,
  "totalAmount": 7,
  "currency": "GBP",
  "description": "test pay",
  "beneficiary": "US-Buziness",
  "beneficiaryAmount": 8.5,
  "beneficiaryFee": 0.75,
  "beneficiaryTotalAmount": 7.75,
  "beneficiaryCurrency": "USD",
  "clientPaymentRef": null,
  "paymentMethod": "FUNDING_BALANCE",
  "paymentType": "INTERNATIONAL",
  "estimatedArrival": "2023-10-05T00:00:00.000Z",
  "batchId": null,
  "createdAt": "2023-10-05T15:09:33.187Z"
}
Received Payment webhook (RECEIVED_PAYMENT) 
(this webhook will be sent to beneficiary if beneficiary have webhooks enabled)

{
  "eventType": "Payment",
  "paymentEntrType": "RECEIVED_PAYMENT",
  "status": "PROCESSING",
  "paymentReferenceId": "97230",
  "payer": "US-Buziness",
  "description": "test with attachment",
  "amount": 5.76,
  "fee": 0.51,
  "totalAmount": 5.25,
  "currency": "GBP",
  "clientPaymentRef": null,
  "paymentMethod": "BANK_ACCOUNT",
  "paymentType": "INTERNATIONAL",
  "estimatedArrival": "2023-10-06T00:00:00.000Z",
  "batchId": null,
  "createdAt": "2023-10-05T15:06:06.438Z"
}

Payment webhook of failed payment (Failed upon submission) will have very minimal 
set of fields because there is no tracking for this payment created:

{
  "beneficiary": "^b5dd1",
  "amount": 100,
  "reason": "Financial Institution Request Error",
  "description": "demo pay to LT",
  "status": "FAILED",
  "batchId": "3b738307-7"
}

Mass Payout Report Webhook

When the Mass Payout is completed the report about successful and unsuccessful payments is sent via email. If you have webhooks enabled for your account, we will notify you via webhook as well.

The webhook received will come in the json body of the POST request sent to your endpoint. The payload will provide information about the executed payments, their amounts, statuses, or reasons why we were not able to submit your payments.

Mass Payout Report Webhook Structure

ParameterDescriptionType
batchIdUnique identifier for mass payout.String
successfulPaymentsThe number of successful payments out of total submitted.Number
failedPaymentsThe number of failed payments out of total submitted.Number
totalSubmittedPaymentsThe number of total payments submitted.Number
paymentsReportArray of objects where each object will contain data of either successfully submitted payment or payments that failed at submit.Array of objects
paymentsReport[n].idId of order in which payment was submitted.Number
paymentsReport[n].handleThe handle of the recipient (either internal or external).String
paymentsReport[n].amountThe payment amount submitted.Number
paymentsReport[n].paymentReferenceIdA unique number generated to identify each individual payment (this field is displayed only when payment is submitted successfully).String
paymentsReport[n].submissionStatusEither successful or unsuccessful payment submission.String
paymentsReport[n].causeReason why payment submission was unsuccessful.String
paymentsReport[n].clientPaymentRefPayment reference provided by clientString

You can find an example of a Mass Payout Report body, below:

{
  "batchId": "aaa00000-a",
  "successfulPayments": 2,
  "failedPayments": 2,
  "totalSubmittedPayments": 4,
  "paymentsReport": [
    {
      "id": 1,
      "handle": "MaltaPerson",
      "amount": 10,
      "submissionStatus": "FAILED",
      "cause": "This payment is below the minimum payment amount. Increase your payment amount or contact support. (I-6008)"
    },
    {
      "id": 2,
      "handle": "FrenchBusiness",
      "amount": 24,
      "paymentReferenceId": "65552",
      "submissionStatus": "SUCCESS",
  		"clientPaymentRef": "5f4vv-fv54v4"
    },
    {
      "id": 3,
      "handle": "^00000",
      "amount": 11,
      "paymentReferenceId": "65544",
      "submissionStatus": "SUCCESS"
    },
    {
      "id": 4,
      "handle": "^aaaaa",
      "amount": 23,
      "submissionStatus": "FAILED",
      "cause": "Could not find account for handle ^aaaaa. (I-6005)"
    }
  ]
}

Mass Claim Payout Report Webhook

When the Mass Claim Payout is completed the report about successful and unsuccessful payments is sent via email. If you have webhooks enabled for your account, we will notify you via webhook as well.

The webhook received will come in a json body of the POST request sent to your endpoint. The payload will provide information about the sent or executed payments, their amounts, statuses, or reasons why we were not able to submit your payments.

Mass Claim Payout Report Webhook Structure

ParameterDescriptionType
batchIdUnique identifier for mass claim payout.String
successfulClaimPaymentsThe number of successful payments out of total submitted.Number
failedClaimPaymentsThe number of failed payments out of total submitted.Number
totalSubmittedClaimPaymentsThe number of total payments submitted.Number
claimPaymentsReportArray of objects where each object will contain data of either successfully submitted payment or payments that failed at submit.Array of objects
paymentsReport[n].idId of order in which payment was submitted.Number
paymentsReport[n].emailEmail address of the recipient.String
paymentsReport[n].handleThe handle of the recipient. (Only if the email is already registered with borderless™ and has associated handle)String
paymentsReport[n].beneCountryTwo letter country code of the recipient.String
paymentsReport[n].amountThe payment amount submitted.Number
paymentsReport[n].paymentReferenceIdA unique number generated to identify each individual payment (this field is displayed only when payment is submitted successfully).String
paymentsReport[n].submissionStatusEither successful or unsuccessful payment submission.String
paymentsReport[n].paymentLinkPayment link that we send to recipient to claim their payment.String
paymentsReport[n].causeReason why payment submission was unsuccessful.String

You can find an example of a Mass Claim Payout Report body, below:

{
  "batchId": "bbb00000-b",
  "successfulClaimPayments": 2,
  "failedClaimPayments": 2,
  "totalSubmittedClaimPayments": 4,
  "claimPaymentsReport": [
    {
      "id": 1,
      "email": "[email protected]",
      "beneCountry": "US",
      "amount": 23,
      "submissionStatus": "UNSUCCESSFUL",
      "cause": "You cannot pay yourself. (I-4703)"
    },
    {
      "id": 2,
      "email": "[email protected]",
      "beneCountry": "GB",
      "amount": 32,
      "submissionStatus": "SENT",
      "paymentLink": "http://localhost/claim-payment?paymentId=5df4df45sd4f54sdf4ff5"
    },
    {
      "id": 3,
      "email": "[email protected]",
      "handle": "Veronika-Person",
      "beneCountry": "US",
      "amount": 10,
      "paymentReferenceId": "65606",
      "submissionStatus": "SUCCESS"
    },
    {
      "id": 4,
      "email": "[email protected]",
      "amount": 5,
      "submissionStatus": "UNSUCCESSFUL",
      "cause": "This payment is below the minimum payment amount. Increase your payment amount, specify country or contact support. (I-6008)"
    }
  ]
}