Webhook Setup Guide

Before setting up your webhook subscriptions, see our Webhook Integration Best Practices.

Summary

This guide walks you through setting up webhooks to receive real-time notifications of system events. You will learn how to prepare your endpoint, subscribe to a webhook, and manage your subscriptions.


Base URL

All webhook subscription API calls use the following base URL structure. Replace tenantslug with your organization's tenant slug.

https://backoffice.infinicept.com/api/{tenantslug}/webhooks

Authentication

Webhooks support basic authentication and shared secret (plaintext) authentication methods to secure your endpoint.


Basic Authentication - Recommended as the industry standard with broad compatibility and universal tooling support.

{
  "Method": 2,
  "Username": "[YOUR WEBHOOK USERNAME]",
  "Password": "[YOUR WEBHOOK PASSWORD]"
}

Shared Secret (Plaintext) - Offers simpler implementation and testing with a single credential to manage.

{
  "Method": 1,
  "SharedSecret": "[YOUR WEBHOOK SHARED SECRET]"
}

Prepare your endpoint

Before creating a subscription, ensure your webhook endpoint:

  • Uses an HTTPS URL with a valid TLS certificate issued for its hostname. Deliveries to an endpoint with a self-signed, expired, or mismatched certificate fail.
  • Is reachable at a public internet address. URLs that resolve to a loopback (such as localhost) or link-local address are not accepted.
  • Can accept HTTP POST requests.
  • Returns a 2xx HTTP status code for successful processing.
  • Can accept the webhook's payload structure.

Infinicept checks the destination URL when you create or update a subscription, and again each time a webhook is sent. If your endpoint redirects, the redirect target must meet the same requirements.


Subscribe to a webhook

Use this request to create a webhook subscription to receive notification of certain events (based on webhook type).


Request

POST https://backoffice.infinicept.com/api/{tenantslug}/webhooks

Request body

Field NameTypeRequired/OptionalDescription
TypeintegerRequiredThe webhook type. Values include: 4 = Instructional Funding Submitted, 5 = Submerchant Deposit Rejected, 6 = Funding Deposit Funded, 7 = Funding Deposit Rejected, 8 = Funding Deposit Partially Rejected.
DestinationURLstringRequiredThe URL of your webhook endpoint. It must use HTTPS and resolve to a public internet address.
AuthenticationMethodobjectRequiredContains the authentication method and credentials used to secure your endpoint.
MethodintegerRequiredValues include: 0 = None, 1 = Shared Secret (Plaintext), 2 = Basic authentication
UsernamestringRequired when Method = 2When using Basic authentication, this is the username used for authenticating your webhook endpoint.
PasswordstringRequired when Method = 2When using Basic authentication, this is the password used for authenticating your webhook endpoint.
SharedSecretstringRequired when Method = 1When using Shared Secret (Plaintext) authentication, this is the shared secret used for authenticating your webhook endpoint.

Example request

{
  "Type": 6,
  "DestinationURL": "https://your-domain.com/webhooks/funding-deposit-funded",
  "AuthenticationMethod": {
    "Method": 1,
    "SharedSecret": "[YOUR WEBHOOK SHARED SECRET]"
  }
}

Authorization

Required HeadersDescription
x-AuthenticationKeyIdThe API key id used to authenticate and authorize your request to Infinicept. API keys are managed within your Backoffice tenant.
x-AuthenticationKeyValueThe API key value used to authenticate and authorize your request to Infinicept. API keys are managed within your Backoffice tenant.

Response

{
  "commandFingerprint": "123e4567-e89b-12d3-a456-426614174000",
  "status": 0,
  "createTime": "2024-01-15T10:30:00.000Z",
  "endTime": null,
  "error": null,
  "message": null
}

Command status values

StatusDescription
0 - ProcessingThe command is being executed
1 - CompletedThe command executed successfully
2 - FailedThe command failed (check error field for details)
3 - CanceledThe command was canceled before completion

If the DestinationURL in a Subscribe or Update request does not meet the endpoint requirements, the request returns 400 Bad Request with one of the following messages. No subscription is created or changed.

MessageCauseResolution
DestinationURL must be an absolute URL.The URL is missing its scheme or hostname, such as your-domain.com/webhooks.Send the full URL, starting with https://.
DestinationURL must use https.The URL starts with http://.Serve your endpoint over HTTPS and update the URL.
DestinationURL must resolve to a public internet address.The hostname or IP address resolves to a loopback or link-local address.Use a hostname that resolves to a public internet address.

Verify your subscription

Retrieve your subscription details to confirm it was created successfully.


Request

GET https://backoffice.infinicept.com/api/{tenantslug}/webhooks

Authorization

Required HeadersDescription
x-AuthenticationKeyIdThe API key id used to authenticate and authorize your request to Infinicept. API keys are managed within your Backoffice tenant.
x-AuthenticationKeyValueThe API key value used to authenticate and authorize your request to Infinicept. API keys are managed within your Backoffice tenant.

Response

[
  {
    "id": 4,
    "type": 6,
    "destinationURL": "https://your-domain.com/webhooks/funding-deposit-funded",
    "authenticationMethod": 1
  }
FieldDescription
idThe numeric value assigned to the subscription representing the order in which the subscription was created
typeThe integer value of the webhook type
destinationURLThe URL of your webhook endpoint
authenticationMethodThe authentication method used with your webhook subscription


Manage your subscriptions

Use these endpoints to create and manage webhook subscriptions.

Subscribe to a Webhook

Review Webhook Subscription Details

Update Webhook Subscription Details

List All Webhook Subscriptions


Did this page help you?