# plan/update webhook

## Plan webhook notifications

Subscribe to the `plan/update` webhook to get notifications about the plan status change.\
 You'll receive a webhook notification to your server indicating the current status. 

Note:\
**The body will include the`plan` object**:

<br />

| Name            | Type                   | Description                                                         |
| :-------------- | :--------------------- | :------------------------------------------------------------------ |
| `planId`        | string                 | Unique identifier for the plan                                      |
| `vendorId`      | string                 | Identifier of the vendor associated with the plan                   |
| `merchantId`    | string                 | Identifier of the merchant associated with the plan                 |
| `name`          | string                 | Name of the plan                                                    |
| `description`   | string                 | Detailed description of the plan                                    |
| `setupFee`      | number                 | One-time fee for setting up the plan                                |
| `rampIntervals` | RampInterval\[]        | Array of pricing intervals for ramp pricing models                  |
| `pricingModel`  | string                 | Pricing model used for the plan (fixed or ramp)                     |
| `autoRenewal`   | boolean                | Defines auto-renewal                                                |
| `periodUOM`     | Enum string (optional) | Unit of time measurement for the billing cycle (e.g., days, months) |
| `period`        | number                 | BThe length of the plan in 'PeriodUOM' units                        |
| `currency`      | string                 | Currency in which the plan is priced (e.g., USD, EUR)               |
| `price`         | number                 | Recurring charge for the plan                                       |
| `status`        | Enum string            | Defines the status of the plan                                      |
| `trialUOM`      | Enum string (optional) | Defines trial period cycle type (days, weeks, months, years)        |
| `trialPeriod`   | number (optional)      | The length of the trial period in 'PeriodUOM' units                 |
| `group`         | string (optional)      | Grouping identifier for the plan                                    |
| `createdAt`     | string                 | Timestamp of when the plan was created                              |
| `updatedAt`     | string                 | Timestamp of when the plan was last updated                         |

<br />

## Webhook notifications examples

**Plan created**

The following webhook notification demonstrates a plan being created.

```json
{
    "planId": "6830a24aa8eb23a618833f35",
    "vendorId": "6830a24aa8eb23e89b833f36",
    "merchantId": "66d58bd06098898a5de10bdc",
    "name": "Test Plan",
    "description": "Description",
    "setupFee": 10,
    "rampIntervals": [],
    "autoRenewal": false,
    "periodUom": "month",
    "period": 12,
    "currency": "GBP",
    "trialPeriod": 0,
    "price": 99.99,
    "status": "active",
    "pricingModel": "fixed",
    "createdAt": "2025-05-23T16:28:58.554Z",
    "updatedAt": "2025-05-23T16:28:58.554Z"
}
```

**Plan updated**

The following webhook notification example demonstrates a plan being updated.

```json
{
    "planId": "6830a2a1a8eb23767e833f39",
    "vendorId": "6830a2a1a8eb234ee1833f3a",
    "merchantId": "66d58bd06098898a5de10bdc",
    "name": "Test Plan",
    "description": "Description",
    "setupFee": 10,
    "rampIntervals": [],
    "autoRenewal": false,
    "periodUom": "month",
    "period": 12,
    "currency": "GBP",
    "trialPeriod": 0,
    "price": 99.99,
    "status": "paused",
    "pricingModel": "fixed",
    "createdAt": "2025-05-23T16:30:25.804Z",
    "updatedAt": "2025-05-23T16:30:25.804Z"
}
```
