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:
Body params | Data type | Requirement | 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 | *optional | The categories the customer wants to subscribe to. Optional if specifying eventTypes. |
eventTypes | array of objects | *optional | 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. |
*Read the description for more information.
The following example 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 possible response codes for this endpoint are as follows. For details, see i18nkey codes and their error messages:
- 201 Created
- 400 Bad Request
- 401 Unauthorized
Updated 1 day ago