Create a subscription
Use POST {URI}/webhooks
endpoint to subscribe to webhook events and receive timely notifications for events occurring within Tango. For instance, subscribing to the itemAvailability
event ensures you receive notifications when a catalog item undergoes changes such as becoming temporarily unavailable, regaining availability at a later time, or being marked as deprecated. This capability enhances your system's responsiveness and keeps you informed of critical updates in real time. See our Supported webhook events.
Endpoint | Purpose |
---|---|
POST {URI}/webhooks | To create subscription |
Here are the parameters used with POST {URI}/webhooks
to create subscription to events on your platform:
Parameter | Data type | Description |
---|---|---|
url | string | (Required) The URL of the customer's webhook listener. It must be a valid URL. |
headers | array of objects | Appropriate for the authentication method the customer wants Tango to use when calling their webhook listener. |
-name | string | (Required) The name of the header. |
-value | string | (Required) The value of the header. |
categories | array of objects | The categories the customer wants to subscribe to. Optional if specifying eventTypes. |
eventTypes | array of objects | The event types the customer wants to subscribe to. Optional if specifying categories. |
signingCertificate | string | (Required) The public X509 certificate used to sign the webhook payload. The certificate must be base64 encoded. |
The following response shows how you can subscribe to events by using POST {URI}/webhooks
:
{
"webhookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"expiresAt": "2024-06-13T19:01:16.536Z"
}
The following response messages are available for this endpoint:
- 201 Created
- 400 Bad Request
- 401 Unauthorized
Updated about 2 months ago