Webhook Implementation
How to implement the webhook endpoint for receiving retry instructions from Slicker
Overview
As part of the Slicker integration, you need to implement a webhook endpoint that Slicker will call when it determines a payment should be retried. This webhook is the mechanism by which Slicker delivers its optimization decisions to your billing system.
Implementation Requirements
Endpoint Configuration
- Protocol: HTTPS only (unencrypted HTTP is not supported)
- Method: POST
- URL: You define the URL and provide it to Slicker during integration setup
- Content Type: application/json
Authentication
Your webhook must implement one of the following authentication methods to ensure that only Slicker can trigger retries:
Bearer Token Authentication
You’ll provide this token to Slicker during integration setup.
Basic Authentication
You’ll provide the username and password to Slicker during integration setup.
Request Format
The webhook will receive a JSON payload containing retry instructions:
Key Fields
Field | Description |
---|---|
requestId | Unique identifier for this retry request |
invoiceId | Identifier for the invoice that should be retried |
subscriptionId | Identifier for the subscription associated with the invoice |
actionSuggestion | Type of action to take (RETRY, CARD_CHANGE, etc.) |
idealRetryTime | Optimal time to execute the retry according to Slicker’s algorithms |
Action Suggestion Values
The actionSuggestion
field will contain one of the following values:
ACTION_SUGGESTION_RETRY
: Attempt to process the payment againACTION_SUGGESTION_CARD_CHANGE
: Request an updated payment method from the customerACTION_SUGGESTION_CARD_CONFIRMATION
: Request the customer to confirm their payment method
Response Format
Your webhook should respond with a 200 OK status code and a JSON body if the retry instruction was successfully received:
For error scenarios, use appropriate HTTP status codes (400, 401, 429, 500) and include an error message:
Implementation Best Practices
Security
- Use HTTPS with valid SSL certificates
- Set up authentication with strong credentials
- (Optional) Implement IP whitelisting (Slicker can provide IP ranges)
Reliability
- Acknowledge receipt quickly and process asynchronously
- Implement idempotent processing based on request IDs to handle potential duplicate requests
- Return appropriate error codes if requests can’t be processed
Monitoring
- Log all webhook calls for debugging and auditing
- Set up alerts for failed webhook calls
- Monitor webhook endpoint uptime
Reference Implementation
For a detailed specification of the webhook API, see the Merchant API Reference.
Support
If you need assistance with your webhook implementation:
- Contact your Slicker integration specialist
- Email support@slickerhq.com