Webhooks in Ecart Pay
Webhooks are automatic notifications that Ecart Pay sends to your server when certain events occur in your account, such as updating or deleting billing information. This allows your system to react in real-time to important changes without constantly polling our API.
With Ecart Pay, you can manage your webhooks in two ways:
- Through the administration panel, where you can easily create, edit, deactivate, or delete your webhooks from the interface.
- Through our API, if you prefer to automate management from your own system.
Configure Webhooks from the Administration Panel
Note: Webhook management from the panel will be available soon. In the meantime, you can use our API to configure your webhooks.
When the functionality is available, you'll be able to access it easily from your Ecart Pay account:
- Log in to the administration panel.
- Go to Settings > Integrations > Webhooks.
- From this section you can:
- Create a new webhook by specifying the URL and events.
- Edit existing webhooks.
- Deactivate or delete webhooks.
Create a Webhook from the Panel
- At the top of the Webhooks view, you'll see the following section.
- Enter the URL of your server where you'll receive the events.
- Select one or more available events.
- Save the changes.
- Copy your Global Secret, which will be used to verify the authenticity of incoming notifications.
Once saved, Ecart Pay will begin sending notifications to the configured URL when the selected events occur.
This secret is used to generate an HMAC signature in each sent event, which you can use to validate that the notification comes from Ecart Pay.
Create a Webhook via API
To create a webhook, you need to make a POST request to our API:
Endpoint: POST /api/webhooks
Required Headers:
Authorization: <your_jwt_token>
Content-Type: application/json
Request Body:
{
"url": "https://your-server.com/webhook",
"events": ["billing_information.updated", "billing_information.deleted"]
}
Parameters:
url
(string, required): The URL of your server where you'll receive notificationsevents
(array, required): List of events you want to receive
Creation Response
{
"_id": "507f1f77bcf86cd799439011",
"account_id": "507f1f77bcf86cd799439012",
"url": "https://your-server.com/webhook",
"events": ["billing_information.updated", "billing_information.deleted"],
"active": true,
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:30:00.000Z"
}
This documentation is updated regularly. For the latest version, consult our documentation repository.
Updated 1 day ago