-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Doc(Webhooks): add event notifications doc, including events list
- Loading branch information
1 parent
175753d
commit 7beac4b
Showing
6 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE rules SYSTEM "https://resources.jetbrains.com/writerside/1.0/redirection-rules.dtd"> | ||
<rules> | ||
<!-- format is as follows | ||
<rule id="<unique id>"> | ||
<accepts>page.html</accepts> | ||
</rule> | ||
--> | ||
<rule id="4e9a7da2"> | ||
<description>Created after removal of "Snippets" from ProWallet</description> | ||
<accepts>Snippets.html</accepts> | ||
</rule> | ||
<rule id="3db36a5c"> | ||
<description>Created after removal of "Snippets" from ProWallet</description> | ||
<accepts>Snippets.html</accepts> | ||
</rule> | ||
</rules> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE topic | ||
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd"> | ||
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd" | ||
title="Snippets" id="Snippets" is-library="true"> | ||
|
||
<snippet id="order_event_sample"> | ||
<code-block lang="json" collapsible="true"> | ||
{ | ||
"event": "orders.status", | ||
"id" : "e1a3b4c5-6d7e-8f9a-0b1c-2d3e4f5a6b7c", | ||
"payload": { | ||
"order": { | ||
"referenceId": "G1446845368", | ||
"currentStatus": "CHARGE_PENDING" | ||
} | ||
} | ||
} | ||
</code-block> | ||
</snippet> | ||
</topic> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Webhook events | ||
|
||
**%product_name%** sends webhooks to notify your system about the following events: | ||
|
||
- [Order events](Webhook-events.md#order-events) | ||
|
||
## Order events | ||
|
||
<table> | ||
<tr> | ||
<td>Event</td> | ||
<td>Trigger</td> | ||
<td>Sample</td> | ||
</tr> | ||
<tr> | ||
<td><code>order.created</code></td> | ||
<td>When an order is created</td> | ||
<td> | ||
<include from="Snippets.topic" element-id="order_event_sample"/> | ||
</td> | ||
</tr> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Webhooks | ||
|
||
**%product_name%** supports webhooks, which allow you to receive real-time HTTP POST notifications when certain events occur in **%product_name%**. Webhooks are particularly useful for integrating **%product_name%** with your own systems, or for integrating with third-party services. | ||
|
||
## How to use | ||
|
||
To use webhooks, you need add a webhook subscription to your **%product_name%** account. You can do this by using [Webhook management](Webhook-management.md) endpoints. | ||
|
||
> The webhooks will send the notification to the URL using the `POST` HTTP verb | ||
> | ||
{style="note"} | ||
|
||
## Messages | ||
|
||
Webhooks send messages to the URL you specify using the `POST` method. The messages are in JSON format and contain information about the event that triggered the webhook. | ||
|
||
For example, when an order is paid by the customer, an event that let your system know that the order has been paid. | ||
|
||
When your system receive the message, it must verify that the notification message: | ||
|
||
- Comes from **%product_name%** | ||
- Was not altered in transit | ||
- Was intended for your organization | ||
- Has a valid format | ||
|
||
Then, the endpoint that attends the URL subscribed must respond with a `200 OK` status code to acknowledge the message. | ||
|
||
### Format | ||
|
||
The message format is as follows: | ||
|
||
<include from="Snippets.topic" element-id="order_event_sample"/> | ||
|
||
> The payload content may vary depending on the event that triggered the webhook. | ||
> | ||
{style="tip"} | ||
|
||
## Security | ||
|
||
For security, message are sent over HTTPS. |