Create Webhook Subscription {#tms-net-tkn-webhook-create-sub-intro}
===================================================================

This section describes how to create a webhook subscription.

> IMPORTANT  
> If you are a portfolio owner and you want to receive life-cycle management notifications for network tokens that are created by all merchants under your portfolio, you must create the webhook subscription using the organizationId of the portfolio.  
> If you are a merchant and you want to receive life-cycle management notifications for network tokens that are created by all transacting merchant IDs (MIDs) under a ` TMS ` vault, you must create the webhook subscription using the organizationId of the ` TMS ` vault owner.

Endpoint
--------

**Test:** `POST ``https://apitest.cybersource.com``/notification-subscriptions/v1/webhooks`{#tms-net-tkn-webhook-create-sub-intro_restcust-test}  
**Production:** `POST ``https://api.cybersource.com``/notification-subscriptions/v1/webhooks`  
**Production in India:** `POST ``https://api.in.cybersource.com``/notification-subscriptions/v1/webhooks`{#tms-net-tkn-webhook-create-sub-intro_restcust-prod-india}

Required Fields for Creating Webhook Subscription {#tms-net-tkn-webhook-create-sub-reqfields}
=============================================================================================

clientRequestAction
:

keyInformation.provider
:

keyInformation.tenant
:
The value must be set to `nrtd`.

keyInformation.keyType
:

keyInformation.organizationId
:

keyInformation.expiryDuration
:
{#tms-net-tkn-webhook-create-sub-reqfields_dl_bcz_qry_dwb}

REST Example: Creating a Webhook Subscription {#tms-net-tkn-webhook-create-sub-ex-rest}
=======================================================================================

Request

```
{
   "organization": {"organizationId": "TMSVaultOwnerOrgID"},
   "product": {"productId": "tokenManagement"},
   "webhook":    {
      "webhookId": "e33b4ff7-f94a-2de4-e053-a2588e0a0403",
      "webhookUrl": "https://URL",
      "createdOn": "2021-12-15 23:46:00.053",
      "eventTypes":       [
         {"name": "tms.networktoken.binding"},
         {"name": "tms.networktoken.provisioned"},
         {"name": "tms.networktoken.updated"}
      ],
      "status": "ACTIVE",
      "retryPolicy":       {
         "algorithm": "ARITHMETIC",
         "firstRetry": 5,
         "interval": 5,
         "numberOfRetries": 4,
         "deactivateFlag": false,
         "repeatSequenceCount": 4,
         "repeatSequenceWaitTime": 5
      },
      "securityPolicy": [      {
         "digitalSignatureEnabled": "yes",
         "proxyType": "external",
         "security_id": "c05cc30a-ce9b-487f-be38-65ab5977b5bc",
         "security_type": "key"
      }]
   }
}
```

{#tms-net-tkn-webhook-create-sub-ex-rest_codeblock_v4l_mlt_lwb}  
Response to a Successful Request

```
{
  "organizationId": "TMSVaultOwnerOrgID",
  "productId": "terminalManagement",
  "eventTypes": [
    "tms.networktoken.binding",
    "tms.networktoken.provisioned",
    "tms.networktoken.updated"
  ],
  "webhookId": "e33b4ff7-f94a-2de4-e053-a2588e0a0403",
  "webhookUrl": "https://NewURL",
  "healthCheckUrl": "https://URL",
  "createdOn": "2022-07-07 17:24:05.116",
  "status": "ACTIVE",
  "retryPolicy": {
    "algorithm": "ARITHMETIC",
    "firstRetry": 1,
    "interval": 1,
    "numberOfRetries": 3,
    "deactivateFlag": false,
    "repeatSequenceCount": 0,
    "repeatSequenceWaitTime": 0
  },
  "securityPolicy": {
    "securityType": "KEY",
    "proxyType": "external",
    "digitalSignatureEnabled": "yes"
  },
  "version": "3",
  "deliveryType": "nrtdCentral",
  "notificationScope": "DESCENDANTS"
}
```

{#tms-net-tkn-webhook-create-sub-ex-rest_codeblock_x4l_mlt_lwb}
