Base URL https://payments.clocknext.com/api/v1
Sets the customer's low-balance threshold, or clears it with null. The level is in USD by default, or pass unit: "percentage" to set it as a percentage (0 to 100) of the plan's Wallet amount per cycle: 10 on a plan that gives $100 a cycle fires at or below $10. A customer holds one level at a time, so saving one replaces the other. When a charge takes the Wallet to or below it, wallet.balance.drop is triggered. With no threshold, each endpoint's own threshold is used. A percentage applies to advance-billed Wallets only; with no active plan Wallet amount, a percentage level sends nothing.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
id*stringCustomer id.
application/json- body
threshold*|The low-balance threshold (0 or more, fractions allowed; at most 100 when unit is percentage), or null to clear it. Clearing removes a USD and a percentage level alike.
0 <= valueunit?WalletAlertUnitHow to read threshold: usd (the default when left out) or percentage of the plan's Wallet amount per cycle. A customer holds one level at a time: saving one clears the other.
"usd""usd""percentage"Threshold saved.
application/json- response
statusCode*integerThe HTTP status code of the response, repeated in the body.
statusDetail*The status of the request. status is SUCCESS, and message says what happened.
result*The customer's low-balance threshold, as saved.
curl -X PUT 'https://payments.clocknext.com/api/v1/customers/cus_abc123/wallet/alert' \ -H 'Content-Type: application/json' \ -d '{ "threshold": 25}'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Low balance alert set." }, "result": { "lowBalanceThresholdUsd": 25, "lowBalanceThresholdPercent": null }}Base URL https://payments.clocknext.com/api/v1
The same call, addressed by the customer's externalId. Same body and response.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
externalId*stringYour own id for the customer: 1–64 letters, numbers or "-". Case-sensitive.
^[A-Za-z0-9-]{1,64}$1 <= length <= 64application/json- body
threshold*|The low-balance threshold (0 or more, fractions allowed; at most 100 when unit is percentage), or null to clear it. Clearing removes a USD and a percentage level alike.
0 <= valueunit?WalletAlertUnitHow to read threshold: usd (the default when left out) or percentage of the plan's Wallet amount per cycle. A customer holds one level at a time: saving one clears the other.
"usd""usd""percentage"Threshold saved.
application/json- response
statusCode*integerThe HTTP status code of the response, repeated in the body.
statusDetail*The status of the request. status is SUCCESS, and message says what happened.
result*The customer's low-balance threshold, as saved.
curl -X PUT 'https://payments.clocknext.com/api/v1/customers/ext/string/wallet/alert' \ -H 'Content-Type: application/json' \ -d '{ "threshold": 250}'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Low balance alert set." }, "result": { "lowBalanceThresholdUsd": 250, "lowBalanceThresholdPercent": null }}Types
Every object type on this page, with its fields.
WalletAlertInput
| Field | Type | Required | Description |
|---|---|---|---|
threshold | number | null | yes | The low-balance threshold (0 or more, fractions allowed; at most 100 when unit is percentage), or null to clear it. Clearing removes a USD and a percentage level alike. |
unit | "usd" | "percentage" | no | How to read threshold: usd (the default when left out) or percentage of the plan's Wallet amount per cycle. A customer holds one level at a time: saving one clears the other. |
WalletAlert
The saved level. At most one of the two is a number; both are null once cleared.
| Field | Type | Required | Description |
|---|---|---|---|
lowBalanceThresholdUsd | number | null | yes | The saved low-balance threshold in USD. null when cleared or when the level is a percentage. |
lowBalanceThresholdPercent | number | null | yes | The saved low-balance threshold as a percentage (0 to 100) of the plan's Wallet amount per cycle. null when cleared or when the level is in USD. |