Breaking Change: `payment_intent.failed` Replaces `payment_intent.payment_failed`
Breaking Change: payment_intent.failed Replaces payment_intent.payment_failed
Version: v1.0.62
Summary
Calmony Pay v1.0.62 corrects a deviation from the official REST API contract. The webhook event name emitted when a payment intent fails has been renamed:
| Before (incorrect) | After (correct) |
|---|---|
payment_intent.payment_failed | payment_intent.failed |
This change brings the API into full conformance with the pinned Calmony Pay REST API Contract specification.
Background
When a payment intent confirmation attempt fails (for example, when Cardstream declines the charge), Calmony Pay emits a webhook event to all registered endpoints that are subscribed to the relevant event type. The specification defines this event as payment_intent.failed. Prior to this release, the code was incorrectly emitting payment_intent.payment_failed, causing a mismatch between the published contract and the live API behaviour.
What Changed
Event emission
The POST /v1/payment_intents/:id/confirm endpoint now emits payment_intent.failed on unsuccessful payment attempts.
Example webhook payload (failure case):
{
"type": "payment_intent.failed",
"data": {
"object": {
"id": "pi_xxxxxxxxxxxx",
"status": "requires_payment_method",
...
}
}
}
Webhook endpoint registration
The list of recognised event types returned by GET /v1/webhook_endpoints and accepted when creating or updating an endpoint via POST /v1/webhook_endpoints now includes payment_intent.failed instead of payment_intent.payment_failed.
Action Required
This is a breaking change for any integration that subscribes to the payment_intent.payment_failed event.
1. Update your webhook handler
Change your handler to match the new event name:
// Before
if (event.type === 'payment_intent.payment_failed') {
handleFailure(event.data.object);
}
// After
if (event.type === 'payment_intent.failed') {
handleFailure(event.data.object);
}
2. Re-register any affected webhook endpoints
If you registered a webhook endpoint with payment_intent.payment_failed in the enabled_events list, delete and re-create it using the corrected event name:
POST /v1/webhook_endpoints
Authorization: Bearer <api_key>
Content-Type: application/json
{
"url": "https://your-app.example.com/webhooks/calmony",
"enabled_events": [
"payment_intent.succeeded",
"payment_intent.failed"
]
}
No Changes to Successful Payment Events
The event name for a successful payment intent — payment_intent.succeeded — is unchanged and requires no migration.
Need Help?
Refer to the API Reference for the full list of webhook event types, or contact support if you need assistance migrating your integration.