Register a webhook subscription
curl --request POST \
--url https://api.interchange.io/api/v2/buyer/webhook-subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"secret": "<string>",
"eventTypes": [
"discovery.revision"
]
}
'import requests
url = "https://api.interchange.io/api/v2/buyer/webhook-subscriptions"
payload = {
"url": "<string>",
"secret": "<string>",
"eventTypes": ["discovery.revision"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', secret: '<string>', eventTypes: ['discovery.revision']})
};
fetch('https://api.interchange.io/api/v2/buyer/webhook-subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"subscription": {
"id": "<string>",
"url": "<string>",
"eventTypes": [
"discovery.revision"
],
"status": "active",
"failureCount": 4503599627370495,
"lastSuccess": "<string>",
"lastFailure": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Webhook Subscriptions
Register a webhook subscription
Register a webhook endpoint to receive push events for subscribed event types, starting with discovery.revision (progressive discovery updates — see the SSE-equivalent GET /discovery/{discoveryId}/events). Deliveries are HMAC-SHA256 signed with the provided secret in the X-Webhook-Signature header.
POST
/
webhook-subscriptions
Register a webhook subscription
curl --request POST \
--url https://api.interchange.io/api/v2/buyer/webhook-subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"secret": "<string>",
"eventTypes": [
"discovery.revision"
]
}
'import requests
url = "https://api.interchange.io/api/v2/buyer/webhook-subscriptions"
payload = {
"url": "<string>",
"secret": "<string>",
"eventTypes": ["discovery.revision"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', secret: '<string>', eventTypes: ['discovery.revision']})
};
fetch('https://api.interchange.io/api/v2/buyer/webhook-subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"subscription": {
"id": "<string>",
"url": "<string>",
"eventTypes": [
"discovery.revision"
],
"status": "active",
"failureCount": 4503599627370495,
"lastSuccess": "<string>",
"lastFailure": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Authorizations
API key or access token
Body
application/json
Response
Register a webhook subscription
Show child attributes
Show child attributes