Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 2.4 KB

webhooks.mdx

File metadata and controls

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

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

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

The hook notification has the following format:

http://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 v1.2+ certificate**

Your endpoint should be protected using a TLS 1.2 certificate or better. Endpoints using self-signed certificates, SSL certificates or TLS certificates v1.0 and v1.1 may be rejected by our webhook systems.

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>