Detach All Spend Rules for Card Except Monthly Limit
The POST /api/spendRules/detachSpendRules endpoint removes all spending rules associated with a specific payment card, except for the monthly spending limit. Spending constraints such as per-transaction limits, merchant restrictions, and category rules are cleared while the monthly spending cap is preserved. This allows partners to grant cardholders broader spending flexibility while maintaining overall budget control.
Endpoint
POST /api/spendRules/detachSpendRules
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when you need to relax spending restrictions on a card without removing the monthly cap — for example, when a cardholder requires temporary access to a broader range of merchants or transaction sizes. It is also useful for resetting a card's spend rule configuration during onboarding or card re-issuance workflows. The monthly limit remains enforced to ensure continued financial oversight.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| paymentCardId | string | Yes | Unique identifier of the payment card from which spend rules will be detached. |
| spendRuleId | string | No | Optional identifier of a specific spend rule to detach. If omitted, all spend rules except the monthly limit are removed. |
{
"paymentCardId": "card_a1b2c3d4e5f6",
"spendRuleId": null
}Response
200 OK
A 200 response confirms that all applicable spend rules (excluding the monthly limit) have been successfully removed from the specified card. No response body is returned.
{}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields or validation error (e.g., paymentCardId not provided or empty) |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to modify spend rules for the specified card |
| 404 | Payment card not found for the given paymentCardId |
| 500 | Internal server error |
Common Mistakes
- Omitting
paymentCardId— this field is required and must be a non-empty string; the request will fail with a 400 error if missing. - Expecting the monthly spending limit to be removed — this endpoint intentionally preserves the monthly cap; use a dedicated spend rule removal endpoint if the monthly limit also needs to be detached.
- Providing an invalid or mismatched
spendRuleId— if a specific rule ID is supplied, ensure it is associated with the given card; mismatches may result in a no-op or a 404 error.
Related Endpoints
POST /api/spendRules/attachSpendRules— Attach one or more spend rules to a payment cardGET /api/spendRules— Retrieve available spend rulesGET /api/spendRules/{paymentCardId}— Get all spend rules currently attached to a specific card
Example
curl -X POST https://api.banking.netevia.dev/api/spendRules/detachSpendRules \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paymentCardId": "card_a1b2c3d4e5f6",
"spendRuleId": null
}' 200Success
