# Update dunning settings

> Replaces the division's dunning (failed payment recovery) configuration; omitted fields are not merged with the previous settings. Divisions renewing by invoice (Bolt Cart) send `retry_schedule_days` and must not send `retry_schedule_hours` or `final_action`: the subscription always pauses after the last failed retry. `reminder_enabled` and `sms_enabled` are required. Divisions renewing by stored card send `retry_schedule_hours` and `final_action`, and must not send `retry_schedule_days`. `reminder_enabled` keeps its stored value when omitted.

Source: https://help.boltapp.com/api-reference/subscriptions/settings-v1/updatedunningsettings

`PUT /v1/subscriptions/dunning_settings`

## OpenAPI definition

This endpoint as it appears in the OpenAPI document, with every schema it references included.

```json
{
  "openapi": "3.2.0",
  "info": {
    "title": "Subscriptions API",
    "version": "v1",
    "description": "API for managing subscriptions and products."
  },
  "servers": [
    {
      "url": "https://api.boltapp.com",
      "description": "The Production URL (Live Data)."
    },
    {
      "url": "https://api-sandbox.boltapp.com",
      "description": "The Sandbox URL (Test Data)."
    },
    {
      "url": "https://api-staging.boltapp.com",
      "description": "The Staging URL (Staged Data)."
    }
  ],
  "security": [
    {
      "X-API-Key": []
    },
    {
      "X-Publishable-Key": []
    }
  ],
  "paths": {
    "/v1/subscriptions/dunning_settings": {
      "put": {
        "operationId": "updateDunningSettings",
        "summary": "Update dunning settings",
        "description": "Replaces the division's dunning (failed payment recovery) configuration; omitted fields are not merged with the previous settings.\n\nDivisions renewing by invoice (Bolt Cart) send `retry_schedule_days` and must not send `retry_schedule_hours` or `final_action`: the subscription always pauses after the last failed retry. `reminder_enabled` and `sms_enabled` are required.\n\nDivisions renewing by stored card send `retry_schedule_hours` and `final_action`, and must not send `retry_schedule_days`. `reminder_enabled` keeps its stored value when omitted.\n",
        "tags": [
          "Settings v1"
        ],
        "security": [
          {
            "X-API-Key": []
          },
          {
            "X-Publishable-Key": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Bolt-Connect-Seller-Id",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "For Bolt Connect marketplace integrations, the seller's external ID. When provided, the request acts on the seller's division rather than the caller's own division. Ignored if the `seller_id` query parameter is also set."
          },
          {
            "in": "query",
            "name": "seller_id",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "For Bolt Connect marketplace integrations, the seller's external ID. When provided, the request acts on the seller's division rather than the caller's own division. Takes precedence over the `X-Bolt-Connect-Seller-Id` header if both are set."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDunningSettingsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated dunning settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DunningSettings"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - a retry schedule that is not strictly increasing or exceeds its bounds, a schedule field that does not apply to the division's renewal engine, or more than 10 `reminder_lead_days` entries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "UpdateDunningSettingsInput": {
        "type": "object",
        "description": "The full dunning configuration to store; omitted fields are not merged with the previous settings. Which schedule field applies depends on the division's renewal engine - see the endpoint description.",
        "required": [
          "reminder_lead_days"
        ],
        "properties": {
          "retry_schedule_hours": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Required on card-renewal divisions, refused on invoice-renewal (Bolt Cart) divisions. 1 to 10 strictly increasing hour offsets, each at most 2160.",
            "examples": [
              [
                24,
                72,
                168,
                336
              ]
            ]
          },
          "retry_schedule_days": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Required on invoice-renewal (Bolt Cart) divisions, refused on card-renewal divisions. 1 to 10 strictly increasing day offsets, each at most 90.",
            "examples": [
              [
                3,
                7,
                14
              ]
            ]
          },
          "reminder_lead_days": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Days before a subscription's renewal at which Bolt reminds the shopper. 1 to 10 unique values between 1 and 90.",
            "examples": [
              [
                30,
                7,
                3
              ]
            ]
          },
          "reminder_enabled": {
            "type": "boolean",
            "description": "Required on invoice-renewal (Bolt Cart) divisions. On card-renewal divisions an omitted value keeps the stored one.",
            "examples": [
              true
            ]
          },
          "final_action": {
            "type": "string",
            "enum": [
              "cancel",
              "pause"
            ],
            "description": "Required on card-renewal divisions, refused on invoice-renewal (Bolt Cart) divisions, where the subscription always pauses.",
            "examples": [
              "cancel"
            ]
          },
          "sms_enabled": {
            "type": "boolean",
            "description": "Whether Bolt sends SMS reminders and payment-failure notifications, in addition to email. Required on invoice-renewal (Bolt Cart) divisions.",
            "examples": [
              false
            ]
          }
        }
      },
      "DunningSettings": {
        "type": "object",
        "description": "A division's dunning (failed payment recovery) configuration. `retry_schedule_days` appears on divisions renewing by invoice (Bolt Cart); `retry_schedule_hours` and `final_action` appear on divisions renewing by stored card.",
        "required": [
          "reminder_lead_days",
          "reminder_enabled",
          "sms_enabled"
        ],
        "properties": {
          "retry_schedule_hours": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Card-renewal divisions only. Hour offsets from the initial payment failure at which Bolt retries the payment. 1 to 10 strictly increasing values, each at most 2160 (90 days).",
            "examples": [
              [
                24,
                72,
                168,
                336
              ]
            ]
          },
          "retry_schedule_days": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Invoice-renewal (Bolt Cart) divisions only. Day offsets from the failed renewal at which the invoice payment is retried. 1 to 10 strictly increasing values, each at most 90.",
            "examples": [
              [
                3,
                7,
                14
              ]
            ]
          },
          "reminder_lead_days": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Days before a subscription's renewal at which Bolt reminds the shopper. 1 to 10 unique values between 1 and 90.",
            "examples": [
              [
                30,
                7,
                3
              ]
            ]
          },
          "reminder_enabled": {
            "type": "boolean",
            "description": "Whether upcoming-renewal reminders are sent at all.",
            "examples": [
              false
            ]
          },
          "final_action": {
            "type": "string",
            "enum": [
              "cancel",
              "pause"
            ],
            "description": "Card-renewal divisions only. The action Bolt takes on a subscription once the retry schedule is exhausted without a successful payment. Invoice-renewal divisions always pause, so the field is absent there.",
            "examples": [
              "cancel"
            ]
          },
          "sms_enabled": {
            "type": "boolean",
            "description": "Whether Bolt sends SMS reminders and payment-failure notifications to the shopper, in addition to email.",
            "examples": [
              false
            ]
          }
        }
      },
      "ApiErrorResponse": {
        "type": "object",
        "description": "Standard error envelope returned by every non-2xx response.",
        "required": [
          "result",
          "errors"
        ],
        "properties": {
          "result": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Always `false` on an error.",
                "examples": [
                  false
                ]
              }
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        },
        "examples": [
          {
            "result": {
              "success": false
            },
            "errors": [
              {
                "code": 15,
                "message": "A valid value must be provided.",
                "field": "frequency"
              }
            ]
          }
        ]
      },
      "ApiError": {
        "type": "object",
        "description": "One error of a failed request.",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "description": "Bolt error code.",
            "examples": [
              15
            ]
          },
          "message": {
            "type": "string",
            "description": "What went wrong.",
            "examples": [
              "A valid value must be provided."
            ]
          },
          "field": {
            "type": "string",
            "description": "Path of the request field the error is about, such as `product.taxable` or `plans[1].sku`. Absent when the error is not about one field.",
            "examples": [
              "frequency"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "X-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Admins and Developers can obtain their Bolt API key from the Bolt Merchant Dashboard. Send it together with `X-Publishable-Key`."
      },
      "X-Publishable-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Publishable-Key",
        "description": "The publicly viewable identifier used to identify a merchant division. This key is found in the Developer > API section of the Bolt Merchant Dashboard. Required. Send it together with `X-API-Key`."
      }
    }
  }
}
```
