Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
titleJSON
{
  "name": "<name>",
  "description": "<description>",
  "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%"
  }
}

NOTE: in case you don't have OAuth endpoint and want to omit the authorization step with your server - don't include authentication property into the AddWebhook object

Parameters

ParameterRequiredDescription
<name>YesWebhook name
<description>NoWebhook detailed description

<hook_endpoint>

Yes

Your server URL where you want to receive the webhook request

Can be separate for each hook type

<oauth_endpoint>

NoYes

Your server OAuth endpoint URLOAuth authorization will be omitted if empty

<client_id>

NoClient Id for your OAuth endpoint 

<client_secret>

NoClient Secret for your OAuth endpoint 

...