Receive payment retry instructions from Slicker
curl --request POST \
--url https://api.your-company.com/slicker-webhook/recovery_action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "req_2uqkAo1bwllmzrgV2qtGv48DtGI",
"invoiceId": "inv_12345678",
"subscriptionId": "sub_12345678",
"actionSuggestion": "ACTION_SUGGESTION_RETRY",
"idealRetryTime": "2023-01-18T09:30:00Z"
}
'import requests
url = "https://api.your-company.com/slicker-webhook/recovery_action"
payload = {
"requestId": "req_2uqkAo1bwllmzrgV2qtGv48DtGI",
"invoiceId": "inv_12345678",
"subscriptionId": "sub_12345678",
"actionSuggestion": "ACTION_SUGGESTION_RETRY",
"idealRetryTime": "2023-01-18T09:30:00Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: 'req_2uqkAo1bwllmzrgV2qtGv48DtGI',
invoiceId: 'inv_12345678',
subscriptionId: 'sub_12345678',
actionSuggestion: 'ACTION_SUGGESTION_RETRY',
idealRetryTime: '2023-01-18T09:30:00Z'
})
};
fetch('https://api.your-company.com/slicker-webhook/recovery_action', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.your-company.com/slicker-webhook/recovery_action",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requestId' => 'req_2uqkAo1bwllmzrgV2qtGv48DtGI',
'invoiceId' => 'inv_12345678',
'subscriptionId' => 'sub_12345678',
'actionSuggestion' => 'ACTION_SUGGESTION_RETRY',
'idealRetryTime' => '2023-01-18T09:30:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.your-company.com/slicker-webhook/recovery_action"
payload := strings.NewReader("{\n \"requestId\": \"req_2uqkAo1bwllmzrgV2qtGv48DtGI\",\n \"invoiceId\": \"inv_12345678\",\n \"subscriptionId\": \"sub_12345678\",\n \"actionSuggestion\": \"ACTION_SUGGESTION_RETRY\",\n \"idealRetryTime\": \"2023-01-18T09:30:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.your-company.com/slicker-webhook/recovery_action")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requestId\": \"req_2uqkAo1bwllmzrgV2qtGv48DtGI\",\n \"invoiceId\": \"inv_12345678\",\n \"subscriptionId\": \"sub_12345678\",\n \"actionSuggestion\": \"ACTION_SUGGESTION_RETRY\",\n \"idealRetryTime\": \"2023-01-18T09:30:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.your-company.com/slicker-webhook/recovery_action")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requestId\": \"req_2uqkAo1bwllmzrgV2qtGv48DtGI\",\n \"invoiceId\": \"inv_12345678\",\n \"subscriptionId\": \"sub_12345678\",\n \"actionSuggestion\": \"ACTION_SUGGESTION_RETRY\",\n \"idealRetryTime\": \"2023-01-18T09:30:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Retry scheduled"
}{
"success": false,
"error_code": "invalid_request",
"message": "Missing required field or invalid format"
}{
"success": false,
"error_code": "unauthorized",
"message": "Invalid or missing authentication credentials"
}{
"success": false,
"error_code": "rate_limit_exceeded",
"message": "Too many requests, please try again later"
}{
"success": false,
"error_code": "server_error",
"message": "An unexpected error occurred"
}Deprecated endpoints
Handle recovery action
POST
/
recovery_action
Receive payment retry instructions from Slicker
curl --request POST \
--url https://api.your-company.com/slicker-webhook/recovery_action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "req_2uqkAo1bwllmzrgV2qtGv48DtGI",
"invoiceId": "inv_12345678",
"subscriptionId": "sub_12345678",
"actionSuggestion": "ACTION_SUGGESTION_RETRY",
"idealRetryTime": "2023-01-18T09:30:00Z"
}
'import requests
url = "https://api.your-company.com/slicker-webhook/recovery_action"
payload = {
"requestId": "req_2uqkAo1bwllmzrgV2qtGv48DtGI",
"invoiceId": "inv_12345678",
"subscriptionId": "sub_12345678",
"actionSuggestion": "ACTION_SUGGESTION_RETRY",
"idealRetryTime": "2023-01-18T09:30:00Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: 'req_2uqkAo1bwllmzrgV2qtGv48DtGI',
invoiceId: 'inv_12345678',
subscriptionId: 'sub_12345678',
actionSuggestion: 'ACTION_SUGGESTION_RETRY',
idealRetryTime: '2023-01-18T09:30:00Z'
})
};
fetch('https://api.your-company.com/slicker-webhook/recovery_action', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.your-company.com/slicker-webhook/recovery_action",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'requestId' => 'req_2uqkAo1bwllmzrgV2qtGv48DtGI',
'invoiceId' => 'inv_12345678',
'subscriptionId' => 'sub_12345678',
'actionSuggestion' => 'ACTION_SUGGESTION_RETRY',
'idealRetryTime' => '2023-01-18T09:30:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.your-company.com/slicker-webhook/recovery_action"
payload := strings.NewReader("{\n \"requestId\": \"req_2uqkAo1bwllmzrgV2qtGv48DtGI\",\n \"invoiceId\": \"inv_12345678\",\n \"subscriptionId\": \"sub_12345678\",\n \"actionSuggestion\": \"ACTION_SUGGESTION_RETRY\",\n \"idealRetryTime\": \"2023-01-18T09:30:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.your-company.com/slicker-webhook/recovery_action")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requestId\": \"req_2uqkAo1bwllmzrgV2qtGv48DtGI\",\n \"invoiceId\": \"inv_12345678\",\n \"subscriptionId\": \"sub_12345678\",\n \"actionSuggestion\": \"ACTION_SUGGESTION_RETRY\",\n \"idealRetryTime\": \"2023-01-18T09:30:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.your-company.com/slicker-webhook/recovery_action")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"requestId\": \"req_2uqkAo1bwllmzrgV2qtGv48DtGI\",\n \"invoiceId\": \"inv_12345678\",\n \"subscriptionId\": \"sub_12345678\",\n \"actionSuggestion\": \"ACTION_SUGGESTION_RETRY\",\n \"idealRetryTime\": \"2023-01-18T09:30:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Retry scheduled"
}{
"success": false,
"error_code": "invalid_request",
"message": "Missing required field or invalid format"
}{
"success": false,
"error_code": "unauthorized",
"message": "Invalid or missing authentication credentials"
}{
"success": false,
"error_code": "rate_limit_exceeded",
"message": "Too many requests, please try again later"
}{
"success": false,
"error_code": "server_error",
"message": "An unexpected error occurred"
}Authorizations
bearerAuthbasicAuth
API key authentication using a Bearer token in the Authorization header.
Example: Authorization: Bearer YOUR_API_KEY
Body
application/json
Unique identifier for the request from Slicker
Example:
"req_2uqkAo1bwllmzrgV2qtGv48DtGI"
Identifier for the invoice that should be retried
Example:
"inv_12345678"
Suggested action to take for this recovery attempt
Available options:
ACTION_SUGGESTION_UNSPECIFIED, ACTION_SUGGESTION_RETRY, ACTION_SUGGESTION_CARD_CHANGE Example:
"ACTION_SUGGESTION_RETRY"
The optimal time to execute the retry according to Slicker's algorithms
Example:
"2023-01-18T09:30:00Z"
Identifier for the subscription associated with the invoice
Example:
"sub_12345678"
⌘I