Callback Notifications
Learn what payment callback notifications are and how to set them up in Spell.
Callback notifications are a crucial communication mechanism between Spell and your application. They allow Spell to proactively send event notifications to a server address you’ve configured whenever a specific event occurs.
What Are Callback Notifications?
A callback notification is a server-to-server communication method. When a significant event occurs within the Spell system that matches your callback configuration (such as a successful payment or an order status change), we will send a POST
request with the event information in real-time to your pre-configured receiving address (Callback URL).
Why Are Callback Notifications Necessary?
- Real-time updates: There’s no need to constantly poll our API to check for order status changes. Spell will notify your system the moment an event happens.
- Reliability: A digital signature mechanism ensures the authenticity and integrity of the notification, preventing data from being tampered with or forged.
- Automation: Your system can automatically respond to various business events (e.g., confirming successful order creation, sending a product key), enabling a fully automated business workflow.
Key Concepts
An account can configure multiple callback events, but the callback system will only function after it’s registered. A callback configuration includes the following key concepts:
- Callback Event: The specific action or status change that triggers a notification, such as an order being paid or an order being overdue.
- Callback URL: The server endpoint you provide to receive notifications.
- Signature Verification: A specific algorithm used to sign the notification content, ensuring the trustworthiness of the notification source and the integrity of the data.
How It Works
- Event Occurs: An event that requires a notification to you happens within the Spell system.
- Notification Creation: Spell organizes the notification data and generates a digital signature.
- Request Sent: A
POST
request (including a signature header) is sent to your callback URL. - Verification and Processing: Your server verifies the signature and processes the business logic.
- Reception Acknowledged: A successful response is returned to prevent duplicate notifications.
Common Use Cases
- Payment Results: Receive real-time updates on successful, failed, or refunded payments.
- Order Status Synchronization: Get various status changes throughout the order’s lifecycle.
- User Behavior Tracking: Monitor specific user actions and events.
- System Event Alerts: Receive system-level alerts and notifications.