---
updatedAt: 2026-07-06T22:41:25.000Z
agentTools:
  projectIndex: https://docs.nmi.com/llms.txt
---

# Delete a Subscription

Deletes a subscription

**Required scope:** `subscriptions:write`


# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Payments Sign-Up API",
    "description": "Payments Sign-Up API",
    "version": "1.0.0",
    "license": {
      "name": "Proprietary",
      "url": "https://api.nmipayments.com/license"
    }
  },
  "servers": [
    {
      "url": "https://sandbox.signup.nmi.com/api/v1",
      "description": "Sandbox"
    },
    {
      "url": "https://secure.nmi.com/api/v5/signup",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Webhook Subscriptions",
      "description": "Manage Webhook Subscriptions"
    },
    {
      "name": "Webhook Events",
      "description": "### Webhook Events Information\n#### Verifying the signature of incoming webhooks\nThis package assumes that an incoming webhook request has a Signature header that can be used to verify the payload has not been tampered with. This is how the signature can be validated.\n```computedSignature = hash_hmac('sha256', [CONTENT], [CONFIGURED SIGNING SECRET]);```\n"
    }
  ],
  "paths": {
    "/subscriptions/{subscription}": {
      "delete": {
        "tags": [
          "Webhook Subscriptions"
        ],
        "security": [
          {
            "oauth": [
              "subscriptions:write"
            ]
          }
        ],
        "summary": "Delete a Subscription",
        "description": "Deletes a subscription\n\n**Required scope:** `subscriptions:write`\n",
        "operationId": "deleteSubscription",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Provide a random key (for example, UUID) to make the request idempotent",
            "schema": {
              "type": "string",
              "minLength": 10,
              "maxLength": 100
            },
            "required": false
          },
          {
            "name": "subscription",
            "in": "path",
            "description": "The ID of the subscription to update",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/subscription-id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "Success Code: DELETED",
                      "maxLength": 100
                    },
                    "message": {
                      "type": "string",
                      "description": "Success Message",
                      "maxLength": 10000
                    }
                  }
                },
                "examples": {
                  "success": {
                    "summary": "Subscription deleted",
                    "description": "Subscription deleted",
                    "value": {
                      "code": "DELETED",
                      "message": "Webhook subscription deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/error-not-found"
          }
        }
      }
    }
  },
  "webhooks": {
    "application.updated.data.requested": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Underwriter Requested Information",
        "description": "This event is triggered when additional information is requested during underwriting process.",
        "operationId": "sendApplicationUpdatedDataRequestedEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "application.updated.data.requested"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "app_id",
                      "dba",
                      "pending_reason"
                    ],
                    "properties": {
                      "app_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 20,
                        "example": "app_341c7b5b432a3158"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "pending_reason": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Credit"
                      },
                      "partner_identifier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 255,
                        "description": "Optional partner-supplied identifier captured on the originating public sign-up form, echoed back so partners can correlate this event with their submission. Null when no identifier was captured for the lead.",
                        "example": "partner-ref-12345"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Application Pended",
                  "description": "This is an example of a webhook payload when the underwriter requests additional information during the underwriting process.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "application.updated.data.requested",
                    "event_body": {
                      "app_id": "app_341c7b5b432a3158",
                      "dba": "Network Merchant Inc",
                      "pending_reason": "Credit",
                      "partner_identifier": "partner-ref-12345"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "application.approved": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Application is approved",
        "description": "Sent when the merchant application is approved.",
        "operationId": "sendApplicationApprovedEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "application.approved"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "app_id",
                      "dba"
                    ],
                    "properties": {
                      "app_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 20,
                        "example": "app_341c7b5b432a3158"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "partner_identifier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 255,
                        "description": "Optional partner-supplied identifier captured on the originating public sign-up form, echoed back so partners can correlate this event with their submission. Null when no identifier was captured for the lead.",
                        "example": "partner-ref-12345"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Application Approved",
                  "description": "This is an example of a webhook payload when the application is approved by the underwriter.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "application.approved",
                    "event_body": {
                      "app_id": "app_341c7b5b432a3158",
                      "dba": "Network Merchant Inc",
                      "partner_identifier": "partner-ref-12345"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "application.declined": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Application is declined",
        "description": "This event is triggered when the merchant application is declined.",
        "operationId": "sendApplicationDeclinedEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "application.declined"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "app_id",
                      "dba",
                      "reject_reason"
                    ],
                    "properties": {
                      "app_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 20,
                        "example": "app_341c7b5b432a3158"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "reject_reason": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Security Issue"
                      },
                      "partner_identifier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 255,
                        "description": "Optional partner-supplied identifier captured on the originating public sign-up form, echoed back so partners can correlate this event with their submission. Null when no identifier was captured for the lead.",
                        "example": "partner-ref-12345"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Application Declined",
                  "description": "This is an example of a webhook payload when the application is declined due to reasons such as credit score.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "application.declined",
                    "event_body": {
                      "app_id": "app_341c7b5b432a3158",
                      "dba": "Network Merchant Inc",
                      "reject_reason": "Security Issue",
                      "partner_identifier": "partner-ref-12345"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "application.cancelled": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Application is cancelled",
        "description": "This event is triggered when the merchant application is cancelled.",
        "operationId": "sendApplicationCancelledEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "application.cancelled"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "app_id",
                      "dba",
                      "reject_reason"
                    ],
                    "properties": {
                      "app_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 20,
                        "example": "app_341c7b5b432a3158"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "reject_reason": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "partner_identifier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 255,
                        "description": "Optional partner-supplied identifier captured on the originating public sign-up form, echoed back so partners can correlate this event with their submission. Null when no identifier was captured for the lead.",
                        "example": "partner-ref-12345"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Application Cancelled",
                  "description": "The application has been cancelled or withdrawn.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "application.cancelled",
                    "event_body": {
                      "app_id": "app_341c7b5b432a3158",
                      "dba": "Network Merchant Inc",
                      "reject_reason": "",
                      "partner_identifier": "partner-ref-12345"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "application.merchant.closed": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant account is closed",
        "description": "This event is triggered when the merchant account is closed.",
        "operationId": "sendApplicationMerchantClosedEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "application.merchant.closed"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "app_id",
                      "dba",
                      "mid",
                      "reject_reason"
                    ],
                    "properties": {
                      "app_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 20,
                        "example": "app_341c7b5b432a3158"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "mid": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "1234000000000011"
                      },
                      "reject_reason": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Compliance Issue"
                      },
                      "partner_identifier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 255,
                        "description": "Optional partner-supplied identifier captured on the originating public sign-up form, echoed back so partners can correlate this event with their submission. Null when no identifier was captured for the lead.",
                        "example": "partner-ref-12345"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant Account Closed",
                  "description": "This is an example of a webhook payload when the merchant account is closed.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "application.merchant.closed",
                    "event_body": {
                      "app_id": "app_341c7b5b432a3158",
                      "dba": "Network Merchant Inc",
                      "mid": "1234000000000011",
                      "reject_reason": "Compliance Issue",
                      "partner_identifier": "partner-ref-12345"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "application.merchant.boarded": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant is ready to process",
        "description": "This event is triggered when the merchant is boarded and ready to process.",
        "operationId": "sendApplicationMerchantBoardedEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "application.merchant.boarded"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "app_id",
                      "dba",
                      "mid",
                      "gateway_id"
                    ],
                    "properties": {
                      "app_id": {
                        "type": "string",
                        "minLength": 20,
                        "maxLength": 20,
                        "example": "app_341c7b5b432a3158"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "mid": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "1234000000000011"
                      },
                      "gateway_id": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "4532454"
                      },
                      "partner_identifier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 255,
                        "description": "Optional partner-supplied identifier captured on the originating public sign-up form, echoed back so partners can correlate this event with their submission. Null when no identifier was captured for the lead.",
                        "example": "partner-ref-12345"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant Boarded",
                  "description": "The merchant is boarded and ready to process.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "application.merchant.boarded",
                    "event_body": {
                      "app_id": "app_341c7b5b432a3158",
                      "dba": "Network Merchant Inc",
                      "mid": "1234000000000011",
                      "gateway_id": "545632",
                      "partner_identifier": "partner-ref-12345"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "merchant.chargeback.added": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant: New Chargeback",
        "description": "This event is triggered when a chargeback is added for a merchant.",
        "operationId": "sendMerchantChargebackAddedEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "merchant.chargeback.added"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "mid",
                      "dba",
                      "date",
                      "amount"
                    ],
                    "properties": {
                      "mid": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "1234000000000011"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "date": {
                        "type": "string",
                        "maxLength": 10,
                        "example": "2024-01-15"
                      },
                      "amount": {
                        "type": "string",
                        "maxLength": 20,
                        "example": "150.00"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant Chargeback Added",
                  "description": "This is an example of a webhook payload when a chargeback is added for a merchant.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "merchant.chargeback.added",
                    "event_body": {
                      "mid": "1234000000000011",
                      "dba": "Network Merchant Inc",
                      "date": "2024-01-15",
                      "amount": "150.00"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "merchant.deposit.new": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant: New Deposit",
        "description": "This event is triggered when a new deposit is made for a merchant.",
        "operationId": "sendMerchantDepositNewEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "merchant.deposit.new"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "mid",
                      "dba",
                      "amount"
                    ],
                    "properties": {
                      "mid": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "1234000000000011"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "amount": {
                        "type": "string",
                        "maxLength": 20,
                        "example": "1250.75"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant Deposit New",
                  "description": "This is an example of a webhook payload when a new deposit is made for a merchant.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "merchant.deposit.new",
                    "event_body": {
                      "mid": "1234000000000011",
                      "dba": "Network Merchant Inc",
                      "amount": "1250.75"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "merchant.first-batch": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant: First Batch",
        "description": "This event is triggered when a merchant processes their first batch of transactions.",
        "operationId": "sendMerchantFirstBatchEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "merchant.first-batch"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "mid",
                      "dba",
                      "date",
                      "amount"
                    ],
                    "properties": {
                      "mid": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "1234000000000011"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "date": {
                        "type": "string",
                        "maxLength": 10,
                        "example": "2024-01-20"
                      },
                      "amount": {
                        "type": "string",
                        "maxLength": 20,
                        "example": "2450.00"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant First Batch",
                  "description": "This is an example of a webhook payload when a merchant processes their first batch of transactions.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "merchant.first-batch",
                    "event_body": {
                      "mid": "1234000000000011",
                      "dba": "Network Merchant Inc",
                      "date": "2024-01-20",
                      "amount": "2450.00"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "merchant.processing.start": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant: Started Processing",
        "description": "This event is triggered when a merchant starts processing transactions.",
        "operationId": "sendMerchantProcessingStartEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "merchant.processing.start"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "mid",
                      "dba"
                    ],
                    "properties": {
                      "mid": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "1234000000000011"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant Processing Start",
                  "description": "This is an example of a webhook payload when a merchant starts processing transactions.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "merchant.processing.start",
                    "event_body": {
                      "mid": "1234000000000011",
                      "dba": "Network Merchant Inc"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "merchant.processing.stop": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant: Stopped Processing",
        "description": "This event is triggered when a merchant stops processing transactions.",
        "operationId": "sendMerchantProcessingStopEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "merchant.processing.stop"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "mid",
                      "dba"
                    ],
                    "properties": {
                      "mid": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "1234000000000011"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant Processing Stop",
                  "description": "This is an example of a webhook payload when a merchant stops processing transactions.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "merchant.processing.stop",
                    "event_body": {
                      "mid": "1234000000000011",
                      "dba": "Network Merchant Inc"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "merchant.residuals.published": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant: Residual Report Published",
        "description": "This event is triggered when merchant residuals reports are published.",
        "operationId": "sendMerchantResidualsPublishedEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "merchant.residuals.published"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "month",
                      "year",
                      "processor_id",
                      "processor_name"
                    ],
                    "properties": {
                      "month": {
                        "type": "integer",
                        "example": 3
                      },
                      "year": {
                        "type": "integer",
                        "example": 2024
                      },
                      "processor_id": {
                        "type": "integer",
                        "example": 123
                      },
                      "processor_name": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "TSYS"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant Residuals Published",
                  "description": "This is an example of a webhook payload when merchant residuals reports are published.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "merchant.residuals.published",
                    "event_body": {
                      "month": 3,
                      "year": 2024,
                      "processor_id": 123,
                      "processor_name": "TSYS"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "merchant.retrieval.added": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant: New Retrieval",
        "description": "This event is triggered when a retrieval is added for a merchant.",
        "operationId": "sendMerchantRetrievalAddedEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "merchant.retrieval.added"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "mid",
                      "dba"
                    ],
                    "properties": {
                      "mid": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "1234000000000011"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant Retrieval Added",
                  "description": "This is an example of a webhook payload when a retrieval is added for a merchant.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "merchant.retrieval.added",
                    "event_body": {
                      "mid": "1234000000000011",
                      "dba": "Network Merchant Inc"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "merchant.statement.new": {
      "post": {
        "tags": [
          "Webhook Events"
        ],
        "summary": "Merchant: New Statement",
        "description": "This event is triggered when a new statement is available for a merchant.",
        "operationId": "sendMerchantStatementNewEvent",
        "security": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_id": {
                    "type": "string",
                    "maxLength": 36,
                    "example": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60"
                  },
                  "event_type": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/event-types"
                      },
                      {
                        "example": "merchant.statement.new"
                      }
                    ]
                  },
                  "event_body": {
                    "type": "object",
                    "required": [
                      "mid",
                      "dba",
                      "date"
                    ],
                    "properties": {
                      "mid": {
                        "type": "string",
                        "maxLength": 30,
                        "example": "1234000000000011"
                      },
                      "dba": {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Network Merchant Inc"
                      },
                      "date": {
                        "type": "string",
                        "maxLength": 10,
                        "example": "2024-03-31"
                      }
                    }
                  }
                }
              },
              "examples": {
                "eventExample": {
                  "summary": "Merchant Statement New",
                  "description": "This is an example of a webhook payload when a new statement is available for a merchant.",
                  "value": {
                    "event_id": "38cf9efa-8aec-4a4e-98e2-6bb2411fdc60",
                    "event_type": "merchant.statement.new",
                    "event_body": {
                      "mid": "1234000000000011",
                      "dba": "Network Merchant Inc",
                      "date": "2024-03-31"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/oauth/token",
            "scopes": {
              "*": "Full access",
              "packages:read": "Read packages information",
              "applications:read": "Read access to applications",
              "applications:write": "Write access to applications",
              "subscriptions:read": "Read access to subscriptions",
              "subscriptions:write": "Write access to subscriptions (subscribe/updated/delete)"
            }
          }
        }
      }
    },
    "schemas": {
      "subscription-id": {
        "type": "string",
        "description": "The unique identifier of the subscription.",
        "pattern": "^sub_[a-f0-9]{16}$",
        "minLength": 20,
        "maxLength": 20
      },
      "event-types": {
        "type": "string",
        "enum": [
          "application.updated.data.requested",
          "application.approved",
          "application.declined",
          "application.cancelled",
          "application.merchant.closed",
          "application.merchant.boarded",
          "merchant.chargeback.added",
          "merchant.deposit.new",
          "merchant.first-batch",
          "merchant.processing.start",
          "merchant.processing.stop",
          "merchant.residuals.published",
          "merchant.retrieval.added",
          "merchant.statement.new"
        ],
        "example": "application.merchant.boarded"
      }
    },
    "responses": {
      "error-not-found": {
        "description": "Error response for resource not found",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Error code",
                  "maxLength": 100
                },
                "message": {
                  "type": "string",
                  "description": "Error message",
                  "maxLength": 10000
                }
              }
            },
            "examples": {
              "not-found": {
                "summary": "Resource Not Found",
                "description": "The resource cannot be found",
                "value": {
                  "code": "NOT_FOUND",
                  "message": "Resource not found"
                }
              }
            }
          }
        }
      }
    }
  }
}
````