---
updatedAt: 2025-09-30T15:27:20.000Z
agentTools:
  projectIndex: https://docs.nexiopay.com/llms.txt
---

# Create a webhook secret

Creates a secret to be used in legacy webhooks for a merchant account or payout account. 

Set up a webhook secret for additional security. After you create a secret, each webhook includes a header containing a signature. You can use the signature to verify that all data received is authentic.

For a tutorial about configuring and using webhooks, see [Configuring legacy webhooks](doc:configuring-legacy-webhooks) in Guides.

<!-- theme: info -->
> 📘 Note
> 
> For the current workflow, see the [Register webhook URLs](ref:registerwebhookurls) endpoint instead.

<!-- theme: warning -->
> ⚠️ Try It
> 
> To use the Try It feature for this endpoint, you must use the credentials for your [Sandbox API user](doc:sandbox-environments).


<div style="display:none;">

## Request parameters
- merchantId
- payoutAccountId

## Response parameters
- secret

</div>

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Dev Tools API Reference",
    "version": "3.0.0",
    "description": "Use the dev tools endpoints to create and view webhooks. For more information, see [Webhooks](doc:webhooks) in Guides.",
    "contact": {
      "name": "Integrations Support",
      "email": "integrations@nexiopay.com",
      "url": "https://nexiointegrations.slack.com/"
    },
    "license": {
      "name": "ISC",
      "url": "https://docs.nexiopay.com/page/license"
    }
  },
  "security": [
    {
      "Basic_Authentication": []
    },
    {
      "One-time-use_Token": []
    }
  ],
  "servers": [
    {
      "description": "Sandbox",
      "url": "https://api.nexiopaysandbox.com",
      "variables": {}
    }
  ],
  "components": {
    "securitySchemes": {
      "Basic_Authentication": {
        "type": "http",
        "scheme": "basic",
        "description": "Basic authentication is a simple authentication scheme built into the HTTP protocol. \n\nFor the \"Try It\" feature, type your API username and password in the appropriate fields. The system then automatically creates the Authorization header that contains the word `Basic` followed by a space and a base64-encoded string `username:password`. \n\nFor example: `Authorization: Basic ZGVtbzpwQDU1dzByZA==` \n\nFor your own requests, learn how to do the conversion in the [Authentication](doc:authentication#basic-authentication) guide. \n\nFor more information about this security protocol, see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample"
      },
      "One-time-use_Token": {
        "type": "apiKey",
        "name": "token",
        "in": "query",
        "description": "The one-time-use token authentication scheme requires a token supplied in the named query parameter that can only be used to submit a single API request and that expires after one hour. \n\nFor the \"Try It\" feature, first generate the one-time-use token through either the [Create one-time-use token](ref:createonetimeusetoken) or the [Create APM one-time-use token](ref:createapmonetimeusetoken) endpoint. Copy the resulting token and then paste it in the appropriate field for the current endpoint. \n\nFor your own requests, learn how to generate the one-time-use token in the [Authentication](doc:authentication#one-time-use-tokens) guide. Then, use it as normal for this endpoint. \n\nFor more information about the \"apiKeys\" security protocol, see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object"
      }
    },
    "responses": {
      "401": {
        "description": "Unauthorized.\n\nFor help with this error and other error codes, see [Common errors](doc:common-errors) in the Guides area.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "A message from Nexio about the state of the request",
                  "example": "Unauthorized"
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Webhook Service",
      "description": "APIs for webhooks"
    }
  ],
  "paths": {
    "/webhook/v3/secret": {
      "post": {
        "description": "Creates a secret to be used in legacy webhooks for a merchant account or payout account. \n\nSet up a webhook secret for additional security. After you create a secret, each webhook includes a header containing a signature. You can use the signature to verify that all data received is authentic.\n\nFor a tutorial about configuring and using webhooks, see [Configuring legacy webhooks](doc:configuring-legacy-webhooks) in Guides.\n\n<!-- theme: info -->\n> 📘 Note\n> \n> For the current workflow, see the [Register webhook URLs](ref:registerwebhookurls) endpoint instead.\n\n<!-- theme: warning -->\n> ⚠️ Try It\n> \n> To use the Try It feature for this endpoint, you must use the credentials for your [Sandbox API user](doc:sandbox-environments).\n\n\n<div style=\"display:none;\">\n\n## Request parameters\n- merchantId\n- payoutAccountId\n\n## Response parameters\n- secret\n\n</div>",
        "operationId": "CreateWebhookSecret",
        "tags": [
          "Webhook Service"
        ],
        "security": [
          {
            "Basic_Authentication": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Create secret for merchant account",
                    "x-tags": [
                      "object"
                    ],
                    "properties": {
                      "merchantId": {
                        "type": "string",
                        "description": "The merchant ID to create a secret for. The ID parameter name to use is `merchantId`.\n\nEither this parameter or `payoutAccountId` is required.",
                        "example": "000999"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "title": "Create secret for payout account",
                    "x-tags": [
                      "component"
                    ],
                    "properties": {
                      "payoutAccountId": {
                        "type": "string",
                        "description": "The Nexio ID for the payout account. The ID parameter name to use is `payoutAccountId`.\n\nEither this parameter or `merchantId` is required.",
                        "example": "3927"
                      }
                    }
                  }
                ]
              }
            }
          },
          "description": "The body of the request requires a single merchant ID or payout account ID."
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "secret": {
                      "title": "secret",
                      "type": "string",
                      "description": "The secret to be used in verifying the webhook's signature. Store the secret in a secure location in order to use it for that verification process. \n\nFor a tutorial about verifying the signature, see [Receiving webhooks](doc:receiving-webhooks) in Guides.",
                      "example": "446946d5-bdd9-48c7-9504-0459d19c08e5",
                      "x-tags": [
                        "component"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          }
        },
        "summary": "Create a webhook secret"
      }
    }
  }
}
```