Documentation Index
Fetch the complete documentation index at: https://docs.tumipay.co/llms.txt
Use this file to discover all available pages before exploring further.
Webhooks
TumiPay Card Payments sends webhooks to notify your system about important events in the payment lifecycle. Webhooks are sent asynchronously via HTTP POST requests with JSON payloads, allowing you to react to events in real-time without polling the API.What are Webhooks?
Webhooks are HTTP callbacks that notify your application when specific events occur. Instead of continuously checking for updates, TumiPay sends a POST request to your configured endpoint whenever a transaction or subscription status changes.
Overview
When you integrate Card Payment webhooks, your system receives automatic notifications for:- Transaction Events: Authorization, capture, and decline events
- Subscription Events: Creation, cancellation, and expiration events
- A unique webhook identifier
- An event type identifier
- A timestamp
- An idempotency key for duplicate detection
- Event-specific data
- An HMAC SHA256 signature for security verification
Webhook Configuration
Before receiving webhooks, you must configure your webhook endpoint. To configure webhooks for Card Payment, please contact the support team.How to Configure Webhooks
To set up webhook notifications, you need to:
- Contact Support: Send an email to soporte@tumipay.co or request assistance through the support channel
- Provide Your Webhook URL: Your HTTPS endpoint where webhooks will be sent (must be publicly accessible)
- Receive Secret Key: You will receive a shared secret key used to sign and verify webhook payloads
- Activation: The support team will activate webhook delivery for your account
Webhook URL
Your HTTPS endpoint where webhooks will be sent. Must be publicly accessible.
Secret Key
A shared secret used to sign and verify webhook payloads. Keep this secure!
Status
Active or inactive. Only one active webhook configuration per merchant is supported.
For webhook configuration assistance, contact:
- Support Email: soporte@tumipay.co
- Technical Email: tecnologia@tumipay.co
HTTP Headers
Every webhook request includes specific HTTP headers that provide metadata and security information.Webhook Headers
Example Request Headers
Signature Verification
All webhooks are signed using HMAC SHA256 to ensure authenticity and integrity. You must verify the signature before processing any webhook.Signature Format
The signature is a hexadecimal string (64 characters) representing the HMAC SHA256 hash. Example:c829a84733035c391f71cfeb73113a6b3161eac74f37e97c930bc44040c8e515
Verification Process
Extract the signature
Get the signature from the
X-Webhook-Signature header (it’s a hexadecimal string)Code Examples
Event Types
TumiPay Card Payments sends the following webhook event types: Transaction Events:transaction.authorized- A transaction has been successfully authorizedtransaction.captured- A transaction has been successfully capturedtransaction.declined- A transaction has been declined
subscription.created- A subscription has been successfully createdsubscription.cancelled- A subscription has been cancelledsubscription.expired- A subscription has expired
Payload Structure
All webhook payloads follow a consistent structure:| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for this webhook (UUID) |
event | string | Event type identifier (e.g., transaction.authorized, subscription.created) |
timestamp | string | ISO 8601 timestamp in UTC format |
idempotency_key | string | Key for duplicate detection (format: {event}:{entity_uuid}) |
data | object | Event-specific data structure containing transaction or subscription details |
Event Payloads
This section provides complete JSON examples for each webhook event type. Each example shows the full payload structure you’ll receive.transaction.authorized
When it’s sent: When a transaction is successfully authorized (preauthorization completed). Transaction Types:PRE_AUTH_TRANSACTION- Initial pre-authorizationRENEWAL_PRE_AUTH_TRANSACTION- Renewal pre-authorization
Note: The
subscription object is optional and may not be present if the transaction is not associated with a subscription.transaction.captured
When it’s sent: When a transaction is successfully captured (payment completed). Example:Note: The
linked_transaction_id field references the original authorization transaction that was captured. This field is only present when the completed/capture transaction was performed from a renewal preauthorization, so it will only be included in those cases.transaction.declined
When it’s sent: When a transaction is declined by the payment provider. Example:subscription.created
When it’s sent: When a subscription is successfully created. Example:subscription.cancelled
When it’s sent: When a subscription is cancelled. Example:subscription.expired
When it’s sent: When a subscription expires. Example:Idempotency
Webhooks include anidempotency_key in both the payload and the X-Idempotency-Key header. This key is deterministic and follows the format: {event_type}:{entity_uuid}
Idempotency Key Format
Example:
- Event:
transaction.authorized - Transaction UUID:
transaction-uuid-123 - Idempotency Key:
transaction.authorized:transaction-uuid-123
Recommended Implementation
Example Implementation
Retry Logic
TumiPay Card Payments implements automatic retry logic for failed webhook deliveries.Retry Configuration
HTTP Status Codes
Webhooks are considered successful if your endpoint returns a 2xx HTTP status code (200-299). Any other status code will trigger a retry.Best Practices
1. Verify Signatures
Always verify the webhook signature before processing. This ensures authenticity and prevents tampering.
2. Handle Idempotency
Use the idempotency key to prevent duplicate processing. Store processed keys and check them before processing.
3. Respond Quickly
Return 200 OK as quickly as possible (within 20 seconds). Process webhooks asynchronously if necessary.
4. Log Everything
Log all received webhooks for debugging and audit purposes. Include webhook ID, event type, and timestamp.
5. Validate Payloads
Validate the payload structure before processing. Ensure required fields are present and have expected types.
6. Handle Errors Gracefully
If processing fails, log the error but still return 200 OK to prevent unnecessary retries. Implement your own retry mechanism if needed.
7. Use HTTPS
Always use HTTPS endpoints for webhook delivery. TumiPay only sends webhooks to secure URLs.
8. Monitor Delivery
Monitor your webhook endpoint for availability and response times. Set up alerts for failures or delays.
Example Webhook Handlers
PHP Example
Node.js Example
Support
For questions or issues related to webhooks, please contact:- Technical Support: tecnologia@tumipay.co
- General Support: soporte@tumipay.co