Skip to content

Latest commit

 

History

History
104 lines (75 loc) · 3.64 KB

webhooks.mdx

File metadata and controls

104 lines (75 loc) · 3.64 KB
title og:description
Hook notifications
Understand how webhook notifications work with the Mangopay API, with an example format and notes on retries.

Introduction

Mangopay provides a webhook feature to submit notifications to other applications whenever a specific event occurs.

When creating the Hook object for an event type, you define the URL to which the notification is sent.

List of event types

The hook notification has the following format:

https://www.example.com?EventType=EventType&RessourceId=ResourceId&Date=Date

Doing a GET call on the ResourceId allows you to check that the event is still relevant and ensure that the hook is authentic.

**Note – Use a TLS 1.2 certificate**

Your endpoint must be protected using a TLS 1.2 certificate. Endpoints using self-signed certificates, SSL certificates or TLS versions 1.0 and 1.1 may be rejected by our webhook systems.

IP addresses

Mangopay sends webhook notifications from the IP addresses listed below. Depending on your firewall or network security setup, you may need to add them to an allowlist to receive notifications.

The CIDR ranges and the full lists given below express the same IP addresses. The /30 indicates a block of 4 IPs in ascending decimals from the first, the /29 indicates a block of 8.

**Note – Contact Mangopay for full list**

The IPs below are redacted for security reasons. When your platform is looking to test webhooks in Sandbox, contact Mangopay via the Dashboard for the full list.

Sandbox

CIDR ranges

  • X.XX.XXX.156/30
  • X.XXX.XXX.152/30

Full list

  • X.XX.XXX.156
  • X.XX.XXX.157
  • X.XX.XXX.158
  • X.XX.XXX.159
  • X.XXX.XXX.152
  • X.XXX.XXX.153
  • X.XXX.XXX.154
  • X.XXX.XXX.155

Production

CIDR ranges

  • X.XX.XXX.176/29
  • X.XXX.XXX.160/29

Full list

  • X.XX.XXX.176
  • X.XX.XXX.177
  • X.XX.XXX.178
  • X.XX.XXX.179
  • X.XX.XXX.180
  • X.XX.XXX.181
  • X.XX.XXX.182
  • X.XX.XXX.183
  • X.XXX.XXX.160
  • X.XXX.XXX.161
  • X.XXX.XXX.162
  • X.XXX.XXX.163
  • X.XXX.XXX.164
  • X.XXX.XXX.165
  • X.XXX.XXX.166
  • X.XXX.XXX.167

Notification failure

Hook notifications can fail. This means the hooked URL did not respond with a 200 - status code within 2 seconds after the notification was sent.

If this happens, the Mangopay API will behave as follows:

  • Every 10 failed notifications - You will receive an email warning you of the issue.
  • After 1 successful notification - The counter is reset. Please note that changing the hook’s URL will not reset the failure count.
  • After 100 consecutive failed notifications - The hook Validity will automatically be set to INVALID and its Status to DISABLED.
**Caution - Hook invalidity is irreversible**

Once the hook is set as INVALID, you cannot restore it to VALID. You will have to create a new hook.

Retries of failed notifications

Hook notifications come with a retry feature, which means that the Mangopay API will resubmit a failed notification until it reaches 100 consecutive failures.

To make sure the notification failures don’t lead to the hook being set to INVALID too quickly, the retries are spaced as follows:

  • Every 10 minutes for the first hour
  • Every 8 hours once the first hour is passed, and for the next 3 days
Learn more about event types
<Card title="Endpoint" href="/api-reference/webhooks/hook-object">The Hook object</Card>