Webhook service (2.0.0)

Download OpenAPI specification:Download

fabric OMS webhooks APIs For multi tenant service

Webhook Server Controller

These endpoints help in performing CRUD operations on webhook subscriptions

Retry webhook

This endpoint lets you manually re-trigger a webhook event.

SecurityAuthorization or context
Request
header Parameters
required
object (XSiteContext)

x-site-context value

Request Body schema: application/json
orderNumber
string

Order number

channel
required
string

channel

tenant
required
string

tenantId

apiVersion
string

api version

event
required
string

name of the event that needs to be triggered

payload
required
object
eventRequestId
required
string

unique identifier of the request

Responses
200

OK

400

Bad Request

500

Internal Server Error

post/retry
Request samples
application/json
{
  • "orderNumber": "oms_234322",
  • "channel": "WHBM",
  • "tenant": "5ef879t578f89",
  • "apiVersion": "1.0.0",
  • "event": "ORDER_CREATED",
  • "payload": "{\n \"orderId\":\"4fr4g45frew-24f54vre-3fre\"\n }",
  • "eventRequestId": "5ef879t5-78f89"
}
Response samples
application/json
[
  • "{\n\n \"statusCodeValue\": 200,\n \"statusCode\": \"OK\"\n }"
]

Query webhook event log

Lets you query log of webhook events based on the filter criteria.

SecurityAuthorization or context
Request
header Parameters
required
object (XSiteContext)

x-site-context value

Request Body schema: application/json
limit
integer <int32>
Default: 10

Numbers of records to be returned.

offset
integer <int64>
Default: 0

Number of records to skipped.

sortBy
string
Default: "updatedAt"

Item property on which data needed to be sorted on.

sortDirection
string
Default: "desc"

Direction of sorting i.e ascending or descending

Enum: "asc" "desc"
required
object
Default: {}

JSON to do filtration of records. to filter records json structure should be similar to target entity structure i.e order, shipment etc

Responses
200

OK

400

Bad Request

500

Internal Server Error

post/event/query
Request samples
application/json
{
  • "limit": 10,
  • "offset": 0,
  • "sortBy": "updatedAt",
  • "sortDirection": "desc",
  • "filters": {
    }
}
Response samples
application/json
{
  • "count": 100,
  • "limit": 10,
  • "offset": 1,
  • "webhookEventLogs": [
    ]
}

Get all webhook definitions

Retrieves all webhook definitions for give tenant-Id, offset and limit.

SecurityAuthorization or context
Request
query Parameters
offset
required
integer <int32>
limit
required
integer <int32>
eventType
string
apiVersion
string
header Parameters
required
object (XSiteContext)

x-site-context value

Responses
200

List of webhook definitions

400

Bad Request

500

Internal Server Error

get/
Response samples
application/json
[
  • {
    }
]

Create webhook definition

Creates webhook definition with the given target, events, request type, and other values as passed in the request body.

SecurityAuthorization or context
Request
header Parameters
required
object (XSiteContext)

x-site-context value

Request Body schema: application/json
tenantId
string
target
required
string

target url

targetApiKey
string

Api key of the target service , if authentication is required

protocol
required
string
source
required
string

Source of event triggers

apiVersion
string
Deprecated
format
string

Content-Type of request body while triggering Webhook

callbackUrl
string
Deprecated
createdDate
string <date-time>
updatedDate
string <date-time>
events
required
Array of strings

List of events for which the webhook need to trigger the target

requestType
required
string

List of events for which the webhook need to trigger the target

Enum: "POST" "PUT" "PATCH" "GET" "DELETE"
Responses
200

Returns Webhook Definition that is successfully created

409

Webhook Definition with target, tenantId, protocol, source, apiVersion already exists!

500

Internal Server Error

post/
Request samples
application/json
{
  • "tenantId": "string",
  • "target": "http://www.test.com",
  • "targetApiKey": "adfasdWdsaQFSsdf",
  • "protocol": "HTTP",
  • "source": "OMS",
  • "apiVersion": "string",
  • "format": "application/json",
  • "callbackUrl": "string",
  • "createdDate": "2019-08-24T14:15:22Z",
  • "updatedDate": "2019-08-24T14:15:22Z",
  • "events": "[ORDER_CREATED]",
  • "requestType": "POST"
}
Response samples
application/json
{
  • "webhookId": "string",
  • "tenantId": "string",
  • "target": "http://www.test.com",
  • "targetApiKey": "adfasdWdsaQFSsdf",
  • "protocol": "HTTP",
  • "source": "OMS",
  • "apiVersion": "string",
  • "format": "application/json",
  • "callbackUrl": "string",
  • "createdDate": "2019-08-24T14:15:22Z",
  • "updatedDate": "2019-08-24T14:15:22Z",
  • "events": "[ORDER_CREATED]",
  • "requestType": "POST"
}

Get webhook definition by ID

Retrieves webhook definition for a given webhook ID

SecurityAuthorization or context
Request
path Parameters
webhookId
required
string
header Parameters
required
object (XSiteContext)

x-site-context value

Responses
200

Returns Webhook Definition that is successfully updated

404

Not Found

500

Internal Server Error

get/{webhookId}
Response samples
application/json
{
  • "webhookId": "string",
  • "tenantId": "string",
  • "target": "http://www.test.com",
  • "targetApiKey": "adfasdWdsaQFSsdf",
  • "protocol": "HTTP",
  • "source": "OMS",
  • "apiVersion": "string",
  • "format": "application/json",
  • "callbackUrl": "string",
  • "createdDate": "2019-08-24T14:15:22Z",
  • "updatedDate": "2019-08-24T14:15:22Z",
  • "events": "[ORDER_CREATED]",
  • "requestType": "POST"
}

Delete webhook definition by ID

Deletes webhook definition of a given webhook ID

SecurityAuthorization or context
Request
path Parameters
webhookId
required
string
header Parameters
required
object (XSiteContext)

x-site-context value

Responses
200

Returns webhook definition that is successfully deleted

404

Not Found

500

Internal Server Error

delete/{webhookId}
Response samples
application/json
{
  • "webhookId": "string",
  • "tenantId": "string",
  • "target": "http://www.test.com",
  • "targetApiKey": "adfasdWdsaQFSsdf",
  • "protocol": "HTTP",
  • "source": "OMS",
  • "apiVersion": "string",
  • "format": "application/json",
  • "callbackUrl": "string",
  • "createdDate": "2019-08-24T14:15:22Z",
  • "updatedDate": "2019-08-24T14:15:22Z",
  • "events": "[ORDER_CREATED]",
  • "requestType": "POST"
}

Update webhook definition by ID

Updates webhook definition for a given webhook ID

SecurityAuthorization or context
Request
path Parameters
webhookId
required
string
header Parameters
required
object (XSiteContext)

x-site-context value

Request Body schema: application/json
tenantId
string
target
required
string

target url

targetApiKey
string

Api key of the target service , if authentication is required

protocol
required
string
source
required
string

Source of event triggers

apiVersion
string
Deprecated
format
string

Content-Type of request body while triggering Webhook

callbackUrl
string
Deprecated
createdDate
string <date-time>
updatedDate
string <date-time>
events
required
Array of strings

List of events for which the webhook need to trigger the target

requestType
required
string

List of events for which the webhook need to trigger the target

Enum: "POST" "PUT" "PATCH" "GET" "DELETE"
Responses
200

Returns Webhook Definition that is successfully updated

404

Not Found

409

Webhook Definition with target, tenantId, protocol, source, apiVersion already exists!

500

Internal Server Error

patch/{webhookId}
Request samples
application/json
{
  • "tenantId": "string",
  • "target": "http://www.test.com",
  • "targetApiKey": "adfasdWdsaQFSsdf",
  • "protocol": "HTTP",
  • "source": "OMS",
  • "apiVersion": "string",
  • "format": "application/json",
  • "callbackUrl": "string",
  • "createdDate": "2019-08-24T14:15:22Z",
  • "updatedDate": "2019-08-24T14:15:22Z",
  • "events": "[ORDER_CREATED]",
  • "requestType": "POST"
}
Response samples
application/json
{
  • "webhookId": "string",
  • "tenantId": "string",
  • "target": "http://www.test.com",
  • "targetApiKey": "adfasdWdsaQFSsdf",
  • "protocol": "HTTP",
  • "source": "OMS",
  • "apiVersion": "string",
  • "format": "application/json",
  • "callbackUrl": "string",
  • "createdDate": "2019-08-24T14:15:22Z",
  • "updatedDate": "2019-08-24T14:15:22Z",
  • "events": "[ORDER_CREATED]",
  • "requestType": "POST"
}