|
1
|
import { Note, InlineIcon } from "docs-ui" |
|
2
|
import { EyeMini, SquareTwoStackMini, ArrowPathMini, Trash } from "@medusajs/icons" |
|
3
|
|
|
4
|
export const metadata = { |
|
5
|
title: `Webhook Endpoints in Cloud`, |
|
6
|
} |
|
7
|
|
|
8
|
# {metadata.title} |
|
9
|
|
|
10
|
In this guide, you'll learn how to manage the HTTP endpoints that receive webhook event deliveries for your organization. |
|
11
|
|
|
12
|
<Note> |
|
13
|
|
|
14
|
Webhook events are available on the Launch, Scale, and Enterprise plans. Learn more about the different plans in the [Pricing](../../pricing/page.mdx) page. |
|
15
|
|
|
16
|
</Note> |
|
17
|
|
|
18
|
## What are Webhook Endpoints? |
|
19
|
|
|
20
|
A webhook endpoint is an HTTPS URL that receives event payloads from Medusa when certain actions occur in your organization. |
|
21
|
|
|
22
|
Only one endpoint can be configured at a time per organization. The endpoint will receive all webhook events for the organization, regardless of which project or environment the event originated from. |
|
23
|
|
|
24
|
--- |
|
25
|
|
|
26
|
## Create a Webhook Endpoint |
|
27
|
|
|
28
|
To add a webhook endpoint to your organization: |
|
29
|
|
|
30
|
1. Make sure you're viewing the [correct organization's dashboard in Cloud](../../organizations/page.mdx#switch-organization). |
|
31
|
2. Click on a project from the dashboard. |
|
32
|
3. Click **Webhooks** > **Endpoints** in the sidebar. |
|
33
|
4. Click **Create endpoint**. |
|
34
|
5. In the form that opens, fill in the following fields: |
|
35
|
- **Endpoint URL** (required): The HTTPS address where events will be delivered. |
|
36
|
- **Enabled**: whether the endpoint is active immediately. This is enabled by default. |
|
37
|
6. Click **Create endpoint** to save the endpoint. |
|
38
|
|
|
39
|
<Note> |
|
40
|
|
|
41
|
You can add only one endpoint to your organization. The **Create endpoint** button is disabled if an endpoint already exists. |
|
42
|
|
|
43
|
</Note> |
|
44
|
|
|
45
|
--- |
|
46
|
|
|
47
|
## Manage an Existing Endpoint |
|
48
|
|
|
49
|
Once an endpoint is created, it appears as a card on the Endpoints page. |
|
50
|
|
|
51
|
### Edit the Endpoint URL |
|
52
|
|
|
53
|
To update the URL of an existing endpoint: |
|
54
|
|
|
55
|
1. In the endpoint card, click the **URL** field and update the address. |
|
56
|
2. Click **Save** to apply the change. |
|
57
|
|
|
58
|
### Reveal or Copy the Signing Secret |
|
59
|
|
|
60
|
Medusa generates a signing secret for each endpoint. You can use the secret to verify that incoming requests are from Medusa. |
|
61
|
|
|
62
|
<Note> |
|
63
|
|
|
64
|
Learn how to verify webhook signatures in the [Webhooks Reference](../reference/page.mdx#verify-webhook-signatures) guide. |
|
65
|
|
|
66
|
</Note> |
|
67
|
|
|
68
|
To manage the signing secret: |
|
69
|
|
|
70
|
1. In the endpoint card, find the **Signing Secret** section. The value is hidden by default. |
|
71
|
2. Click the <InlineIcon Icon={EyeMini} alt="reveal" /> icon to show the secret, or click the <InlineIcon Icon={SquareTwoStackMini} alt="copy" /> icon to copy it to the clipboard. |
|
72
|
|
|
73
|
### Rotate the Signing Secret |
|
74
|
|
|
75
|
Rotating the signing secret generates a new secret and invalidates the previous one. This is useful if you suspect that the secret has been compromised or if you want to rotate it periodically for security reasons. |
|
76
|
|
|
77
|
<Note type="warning"> |
|
78
|
|
|
79
|
Rotating the signing secret invalidates the previous secret immediately. Update your webhook handler to use the new secret immediately after rotating it to avoid failed deliveries. |
|
80
|
|
|
81
|
</Note> |
|
82
|
|
|
83
|
To rotate the signing secret: |
|
84
|
|
|
85
|
1. In the endpoint card, click the <InlineIcon Icon={ArrowPathMini} alt="rotate" /> icon in the **Signing Secret** section. |
|
86
|
2. Confirm the action in the prompt that appears. |
|
87
|
|
|
88
|
Medusa generates a new secret and the previous one is no longer valid. |
|
89
|
|
|
90
|
### Enable or Disable the Endpoint |
|
91
|
|
|
92
|
To enable or disable the endpoint without deleting it, toggle the switch in the top-right corner of the endpoint card. |
|
93
|
|
|
94
|
If an endpoint is disabled, Medusa will not send any events to it until it is re-enabled. |
|
95
|
|
|
96
|
### Delete the Endpoint |
|
97
|
|
|
98
|
<Note type="warning"> |
|
99
|
|
|
100
|
Deleting an endpoint is irreversible. Any in-flight event deliveries to that endpoint will fail. |
|
101
|
|
|
102
|
</Note> |
|
103
|
|
|
104
|
To delete a webhook endpoint: |
|
105
|
|
|
106
|
1. In the endpoint card, click the <InlineIcon Icon={Trash} alt="delete" /> icon. |
|
107
|
2. Confirm the deletion in the prompt that appears. |
|
108
|
|
|
109
|
The endpoint is removed and Medusa will stop sending events to it. |