...
Code Block | ||||
---|---|---|---|---|
| ||||
{
"name": "<name>",
"description": "<description>",
"organizationId": "<organization_id>"
"hooks": [
{
"type": "event_created",
"method": "POST",
"endpoint": "<hook_endpoint>"
},
{
"type": "event_removed",
"method": "POST",
"endpoint": "<hook_endpoint>"
},
{
"type": "event_updated",
"method": "POST",
"endpoint": "<hook_endpoint>"
},
{
"type": "order_created",
"method": "POST",
"endpoint": "<hook_endpoint>"
},
{
"type": "order_removed",
"method": "POST",
"endpoint": "<hook_endpoint>"
},
{
"type": "order_updated",
"method": "POST",
"endpoint": "<hook_endpoint>"
},
{
"type": "order_cancelled",
"method": "POST",
"endpoint": "<hook_endpoint>"
}
],
"authentication": {
"grant_type": "client_credentials",
"endpoint": "<oauth_endpoint>",
"credentials": {
"client_id": "<client_id>",
"client_secret": "<client_secret>"
},
"header_format": "Authorization",
"header_value_format": "Bearer %ACCESS_TOKEN%"
}
} |
...
Parameter | Required | Description | ||
---|---|---|---|---|
<name> | Yes | Webhook name | ||
<description> | No | Webhook detailed description <organization_id> | Yes | Organization ID which you need to specify the webhook for |
<hook_endpoint> | Yes | Your server URL where you want to receive the webhook request Can be separate for each hook type | ||
<oauth_endpoint> | No | Your server OAuth endpoint URL OAuth authorization will be omitted if empty | ||
<client_id> | No | Client Id for your OAuth endpoint | ||
<client_secret> | No | Client Secret for your OAuth endpoint |
...
Code Block | ||||
---|---|---|---|---|
| ||||
{
"name": "My Test Webhook",
"description": "Webhook for testing all the hook types",
"organizationId": "123",
"hooks": [
{
"type": "event_created",
"method": "POST",
"endpoint": "https://requestb.in/123"
},
{
"type": "event_removed",
"method": "POST",
"endpoint": "https://requestb.in/123"
},
{
"type": "event_updated",
"method": "POST",
"endpoint": "https://requestb.in/123"
},
{
"type": "order_created",
"method": "POST",
"endpoint": "https://requestb.in/123"
},
{
"type": "order_removed",
"method": "POST",
"endpoint": "https://requestb.in/123"
},
{
"type": "order_updated",
"method": "POST",
"endpoint": "https://requestb.in/123"
},
{
"type": "order_cancelled",
"method": "POST",
"endpoint": "https://requestb.in/123"
}
],
"authentication": {
"grant_type": "client_credentials",
"endpoint": "https://requestb.in/123",
"credentials": {
"client_id":"doo",
"client_secret":"super-strong-secret"
},
"header_format": "Authorization",
"header_value_format": "Bearer %ACCESS_TOKEN%"
}
} |
...