> For the complete documentation index, see [llms.txt](https://peach-organization.gitbook.io/peach/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://peach-organization.gitbook.io/peach/webhooks/webhooks-for-automations/subscription-ending-webhook.md).

# Subscription ending webhook

When a subscription is detected to be ending soon, an automation can be triggered. The subscription details can be sent to the endpoint of your choice

| Parameter                     | Values             | Description                                                  |
| ----------------------------- | ------------------ | ------------------------------------------------------------ |
| automationTrigger             | string             | Event type that triggered the webhook (`subscriptionEnding`) |
| contactId                     | string (UUID)      | Unique contact identifier                                    |
| paymentDate                   | number (timestamp) | Date/time of the relevant payment                            |
| donorFirstName                | string             | Donor first name                                             |
| donorLastName                 | string             | Donor last name                                              |
| donorDisplayName              | string             | Full donor name for display                                  |
| email                         | string             | Donor email address                                          |
| receiptEmail                  | string             | Email address for receipt delivery                           |
| donorPhoneNumber              | string             | Donor phone number                                           |
| documentLanguage              | string             | Document language                                            |
| donationCurrency              | string             | Currency of the donation                                     |
| paymentType                   | string             | Payment type                                                 |
| donationSum                   | number             | Total donation sum                                           |
| donationFirstSum              | number             | First payment amount in the subscription                     |
| donationSumInCampaignCurrency | number             | Donation amount in campaign currency                         |
| isHok                         | boolean            | Indicates a recurring (HOK) donation                         |
| isInstallments                | boolean            | Indicates installment-based payment                          |
| splitAcrossMonths             | number             | Number of months the donation is split across                |
| additionalRecurringMonths     | number             | Additional recurring months                                  |
| additionalRecurringSum        | number             | Additional recurring amount                                  |
| managedExternally             | boolean            | Whether subscription is managed externally                   |
| cancelled                     | boolean            | Whether the subscription was cancelled                       |
| completed                     | boolean            | Whether the process is completed                             |
| futureCommitment              | boolean            | Indicates future commitment donation                         |
| status                        | string             | Subscription status (`scheduled`, etc.)                      |
| scheduleDate                  | string (date)      | Scheduled end or event date                                  |
| nextBillingCycle              | number             | Next billing cycle number                                    |
| failedReason                  | string / null      | Reason for failure, if any                                   |
| purchaseTitle                 | string             | Title of the transaction                                     |
| paymentCategory               | string             | Category of payment (`donation`)                             |
| donationMethod                | string             | Donation method (`manual`, etc.)                             |
| campaignId                    | string             | Campaign identifier                                          |
| accountId                     | string             | Account identifier                                           |
| agentId                       | string             | Agent handling the donation                                  |
| tz                            | string             | Donor Israeli ID / company number                            |
| exchangeRate                  | number             | Exchange rate applied                                        |
| exchangeRateToUSD             | number             | Exchange rate to USD                                         |
| paymentId                     | string (UUID)      | Payment identifier                                           |
| paymentMethodId               | string (UUID)      | Payment method identifier                                    |
| paymentMethodSource           | string             | Source of payment method                                     |
| receiptSendMethod             | string             | Method of sending receipt (`email`)                          |
| createReceipt                 | boolean            | Whether to generate a receipt                                |
| externalReceiptCreated        | boolean            | Whether receipt was created externally                       |
| masavBusinessName             | string             | MASAV business name                                          |
| incomes                       | array              | List of income breakdown objects                             |
| items                         | array              | Purchased items (if applicable)                              |
| webhook                       | string / null      | Webhook reference                                            |
| backend                       | boolean            | Internal backend flag                                        |
| partition                     | string             | Internal partition key                                       |
| createdAt                     | number (timestamp) | Creation timestamp                                           |
| updatedAt                     | number (timestamp) | Last update timestamp                                        |
| updatedByUserId               | string (UUID)      | User who last updated the record                             |
| requiresTracking              | boolean            | Indicates if tracking is required                            |
| source                        | string / null      | Source of the transaction                                    |
| externalTransactionId         | string / null      | External transaction identifier                              |
| externalSubscriptionId        | string / null      | External subscription identifier                             |
| paypalSubscriptionId          | string / null      | PayPal subscription ID                                       |
| paypalOrderId                 | string / null      | PayPal order ID                                              |
| authNumber                    | string / null      | Authorization number                                         |
| transactionRef                | string / null      | Transaction reference                                        |
| transactionResult             | string / null      | Transaction result                                           |
| cc4dig                        | string / null      | Last 4 digits of credit card                                 |
| receiptMethodId               | string / null      | Receipt method identifier                                    |
| isFormSubmission              | boolean            | Indicates form-based submission                              |
