Collections
Pause Dunning
Pause or resume automated dunning on a single invoice.
POST
/
v1
/
collections
/
invoices
/
{id}
/
pause
Pause or resume automated dunning on an invoice
curl --request POST \
--url https://billing.example.com/v1/collections/invoices/{id}/pause \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"paused": true
}'import requests
url = "https://billing.example.com/v1/collections/invoices/{id}/pause"
payload = { "paused": True }
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({paused: true})
};
fetch('https://billing.example.com/v1/collections/invoices/{id}/pause', 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://billing.example.com/v1/collections/invoices/{id}/pause",
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([
'paused' => true
]),
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://billing.example.com/v1/collections/invoices/{id}/pause"
payload := strings.NewReader("{\n \"paused\": true\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://billing.example.com/v1/collections/invoices/{id}/pause")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paused\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/collections/invoices/{id}/pause")
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 \"paused\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"dunning_paused": true
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Sets the
Errors use the standard envelope — see Errors.
dunning_paused flag on an invoice. While paused, automated retries
and Retry Now are refused for that
invoice; send {"paused": false} to resume. Nothing else about the invoice
changes and no ledger legs are posted.
Only an invoice that is still in play — open, past_due or uncollectible —
can be paused or resumed; a paid or voided invoice returns 404. The current
flag is visible as dunning_paused on the
collections queue.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | The invoice’s id. |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
paused | boolean | Yes | true to pause automated dunning on the invoice, false to resume it. |
Example Request
curl -X POST "https://api.recurso.dev/v1/collections/invoices/06c151de-8d3a-4b21-9c77-2f0e5a9b4d12/pause" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"paused": true}'
Response
{
"data": {
"dunning_paused": true
}
}
Fields
| Field | Type | Description |
|---|---|---|
dunning_paused | boolean | The flag as now stored — echoes the paused value you sent |
Errors
| Status | Code | When | Fix |
|---|---|---|---|
400 | validation_failed | id in the path is not a UUID, or the body is not {"paused": <bool>} | Use the invoice’s UUID and send a JSON body with a boolean paused |
404 | not_found | Invoice doesn’t exist, belongs to another tenant (existence is never confirmed across tenants), or is not open, past_due or uncollectible | Check the ID and status from the collections queue |
⌘I
Pause or resume automated dunning on an invoice
curl --request POST \
--url https://billing.example.com/v1/collections/invoices/{id}/pause \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"paused": true
}'import requests
url = "https://billing.example.com/v1/collections/invoices/{id}/pause"
payload = { "paused": True }
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({paused: true})
};
fetch('https://billing.example.com/v1/collections/invoices/{id}/pause', 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://billing.example.com/v1/collections/invoices/{id}/pause",
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([
'paused' => true
]),
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://billing.example.com/v1/collections/invoices/{id}/pause"
payload := strings.NewReader("{\n \"paused\": true\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://billing.example.com/v1/collections/invoices/{id}/pause")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paused\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/collections/invoices/{id}/pause")
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 \"paused\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"dunning_paused": true
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}