Subscribe to events
curl --request POST \
--url https://sandbox-api.instockrx.com/webhook-endpoints \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"url": "<string>",
"events": [
"<string>"
],
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: ['<string>'], description: '<string>'})
};
fetch('https://sandbox-api.instockrx.com/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/webhook-endpoints"
payload = {
"url": "<string>",
"events": ["<string>"],
"description": "<string>"
}
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"events": [
"<string>"
],
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"signingSecret": "whsec_abc123…",
"description": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"lastDeliveredAt": "2023-11-07T05:31:56Z",
"failureCount": 1
}Webhook Endpoints
Subscribe to events
Scope: webhooks:manage.
POST
/
webhook-endpoints
Subscribe to events
curl --request POST \
--url https://sandbox-api.instockrx.com/webhook-endpoints \
--header 'Content-Type: application/json' \
--header 'X-InStockRx-Api-Key: <api-key>' \
--data '
{
"url": "<string>",
"events": [
"<string>"
],
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-InStockRx-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: ['<string>'], description: '<string>'})
};
fetch('https://sandbox-api.instockrx.com/webhook-endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox-api.instockrx.com/webhook-endpoints"
payload = {
"url": "<string>",
"events": ["<string>"],
"description": "<string>"
}
headers = {
"X-InStockRx-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"events": [
"<string>"
],
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"signingSecret": "whsec_abc123…",
"description": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"lastDeliveredAt": "2023-11-07T05:31:56Z",
"failureCount": 1
}Authorizations
Headers
Which pharmacy in your group you are acting as. Required whenever your group holds more than one pharmacy — omitting it is then 400 missing-pharmacy-context. With exactly one pharmacy it may be omitted, but send it anyway: the call starts failing the day a second pharmacy is added.
Body
application/json
Response
201 - application/json
Created — signingSecret is shown ONCE.