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.

EndpointPurpose
POST {URI}/webhooksTo create subscription

Here are the parameters used with POST {URI}/webhooks to create subscription to events on your platform:

ParameterData typeDescription
urlstring(Required) The URL of the customer's webhook listener. It must be a valid URL.
headersarray of objectsAppropriate for the authentication method the customer wants Tango to use when calling their webhook listener.
-namestring(Required) The name of the header.
-valuestring(Required) The value of the header.
categoriesarray of objectsThe categories the customer wants to subscribe to. Optional if specifying eventTypes.
eventTypesarray of objectsThe event types the customer wants to subscribe to. Optional if specifying categories.
signingCertificatestring(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

Rewards as a Service™ and the RaaS® API are provided by Tango Card, Inc. © 2024 Tango Card, Inc.