Create a new webhook

Creates a new webhook, based on a given webhookEventTypeName or webhookEventTypeId.

SecurityCommonAuth
Request
Request Body schema: application/json
One of:
webhookEventTypeName
required
string (webhookEventTypeName) <= 256 characters

The name of the webhook event type to work with.

accountId
string or null
url
required
string <= 512 characters

The URL of the webhook endpoint.

authorizationHeader
string or null <= 512 characters

The authorization header content for the webhook.

sharedSecret
string or null <= 36 characters

When provided, this is used to sign the webhook payload and generate the x-em-signature header.

enabled
required
boolean

Webhook event type availability (whether the webhook is enabled or not).

Responses
201

Created

400

Bad request

401

Unauthorised

403

Forbidden

404

Not found

405

Method not allowed

415

Unsupported media type

429

Too many requests

500

Internal server error

post/webhooks
Request samples
application/json
{
  • "webhookEventTypeName": "AccountCreated",
  • "accountId": "C12345",
  • "authorizationHeader": "Basic AXVubzpwQDU1dzByYM==",
  • "sharedSecret": "123e4567-e89b-12d3-a456-426614174000",
  • "enabled": true
}
Response samples
application/json
{
  • "id": "da91434a-4026-42ea-84b8-d0317b64af9c",
  • "productId": "911db6db-ef58-4992-87cd-2fe2cfde05f9",
  • "webhookEventTypeId": "da91434a-4026-42ea-84b8-d0317b64af9c",
  • "accountId": "C12345",
  • "authorizationHeader": "Basic AXVubzpwQDU1dzByYM==",
  • "webhookEventTypeName": "OrderCreated",
  • "enabled": true,
  • "sharedSecret": "123e4567-e89b-12d3-a456-426614174000",
  • "createdAt": "2021-01-30T08:30:00Z",
  • "updatedAt": "2021-01-30T08:30:00Z"
}