---
title: "Set or update auto-recharge config for a customer"
method: PUT
path: "/v1/sdk/auto-recharge"
tags: ["Auto Recharge"]
---

# Set or update auto-recharge config for a customer

`PUT /v1/sdk/auto-recharge`

Persists the auto-recharge configuration for a customer. When no reusable card is on file, a Stripe SetupIntent client secret is returned so the caller can collect one.

## Request body

- PutAutoRechargeSdkDto
  - `currency` string, required
  - `customerEmail` string, email
  - `customerName` string
  - `customerRef` string, required
  - `deferSetupIntent` boolean
  - `enabled` boolean, required
  - `maxMonthlySpendMajor` number
  - `thresholdAmountMajor` number
  - `topupAmountMajor` number
  - `triggerType` 'balance', required

## Response `200`

Saved auto-recharge config and optional SetupIntent details.

- SaveAutoRechargeResponse
  - `config` AutoRechargeConfigDto, required
    - `enabled` boolean, required — Whether auto-recharge is enabled
    - `failureCount` number, required — Consecutive failure count
    - `fundingSourceType` 'saved_card' | 'tokenized_card', required — Funding source type
    - `inFlightPaymentIntentId` string — PaymentIntent ID of an in-flight recharge
    - `lastChargeAt` string — Timestamp of the last successful charge
    - `lockAcquiredAt` string — Timestamp the processing lock was acquired
    - `maxMonthlySpendMinor` number — Optional monthly spend cap in topup.currency minor units
    - `monthlySpendMinor` number, required — Successful auto-recharge spend in the current UTC month
    - `monthlySpendPeriod` string — UTC YYYY-MM period key for monthlySpendMinor
    - `paymentMethodId` string — Saved payment method ID backing the recharge
    - `status` 'active' | 'disabled' | 'failed' | 'pending_setup', required — Current config status
    - `topup` AutoRechargeTopupDto, required
      - `amountMinor` number, required — Top-up amount in currency minor units
      - `currency` string, required — ISO 4217 currency code
      - `mode` 'fixed', required — Top-up mode
    - `trigger` AutoRechargeTriggerDto, required
      - `thresholdAmountMinor` number, required — Display-currency minor units for the balance threshold
      - `type` 'balance', required — Trigger kind
    - `updatedAt` string, required — Last update timestamp
  - `display` AutoRechargeDisplayDto
    - `currency` string, required — Display currency code
    - `exchangeRate` number, required — Exchange rate used for display conversion
    - `formatted` AutoRechargeDisplayFormattedDto, required
      - `threshold` string, required — Formatted threshold amount
      - `topup` string, required — Formatted top-up amount
    - `rateSource` string, required — Source of the exchange rate
    - `thresholdAmountMajor` number, required — Threshold amount in display-currency major units
    - `topupAmountMajor` number, required — Top-up amount in display-currency major units
  - `publishableKey` string — Stripe publishable key for the resolved environment
  - `setupClientSecret` string — Stripe SetupIntent client secret for card collection
  - `stripeAccountId` string — Connected Stripe account ID

## Other responses

- `400` — customerRef is required, or customer email is required to configure auto-recharge

---

[API](https://skmtc.net/solvapay/apis/solvapay-rest-api.md) · [All operations](https://skmtc.net/solvapay/apis/solvapay-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/solvapay/solvapay-rest-api/revisions/bbc2ff2bc849/schema)
