Commerce
Dunning retry schedule API
Builds a failed-payment dunning calendar from retry-day offsets, returning cumulative day offsets for each attempt and the final write-off day after a grace period. Answers 'When are the dunning retries?', 'When do I write off the invoice?'.
Price$0.02per request
MethodPOST
Route/v1/commerce/dunning-schedule
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
commercesubscriptiondunningretryfailed-paymentbillingrecoverysaas
API URL
Integration docshttps://x402.hexl.dev/v1/commerce/dunning-scheduleExample request
{
"invoiceAmount": 99,
"retryOffsetsDays": [
1,
3,
5
],
"graceDays": 7
}Example response
{
"invoiceAmount": 99,
"startDay": 0,
"attempts": [
{
"attempt": 1,
"offsetDays": 1,
"dayFromStart": 1
},
{
"attempt": 2,
"offsetDays": 3,
"dayFromStart": 4
},
{
"attempt": 3,
"offsetDays": 5,
"dayFromStart": 9
}
],
"retryCount": 3,
"graceDays": 7,
"finalRetryDay": 9,
"writeOffDay": 16,
"interpretation": "3 retries scheduled (last on day 9); write off $99 on day 16 if all fail."
}Input schema
{
"type": "object",
"required": [
"invoiceAmount",
"retryOffsetsDays"
],
"properties": {
"invoiceAmount": {
"type": "number",
"examples": [
99
]
},
"retryOffsetsDays": {
"type": "array",
"items": {
"type": "integer"
},
"examples": [
[
1,
3,
5
]
]
},
"graceDays": {
"type": "integer",
"examples": [
7
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}