Detach all spend rules for card

Detach All Spend Rules for Card

The POST /api/spendRules/detachAll endpoint removes all spending rules associated with a specific payment card. This action disables any configured transaction limits, merchant restrictions, or regional rules, reverting the card to its default unrestricted state. It is designed for users or administrators who need to clear all constraints on a card's usage in a single operation.

Endpoint

POST /api/spendRules/detachAll

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 reset a payment card's spending policies entirely, removing all previously attached rules at once rather than detaching them one by one. This is useful when a cardholder's role or account configuration changes and all existing restrictions should be cleared. It is also applicable when an administrator needs to quickly unblock a card from restrictive spend controls.

Query Parameters

ParameterTypeRequiredDescription
PaymentCardIdstringYesThe unique identifier of the payment card from which all spend rules will be removed.
SpendRuleIdstringNoOptional identifier of a specific spend rule. When provided, only that rule is detached rather than all rules.

Response

200 OK

A successful response confirms that all spending rules associated with the specified card have been removed. No response body fields are returned beyond the success status.

{}

Error Codes

CodeWhen it happens
400Missing required fields or validation error (e.g., PaymentCardId not provided or malformed)
401Token missing, expired, or invalid
403Insufficient permissions to modify spend rules for the specified card
404Payment card not found for the given PaymentCardId
500Internal server error

Common Mistakes

  • Omitting the required PaymentCardId query parameter, which will result in a 400 error.
  • Providing an invalid or non-existent PaymentCardId value, which returns a 404 error.
  • Assuming the endpoint returns a structured body — a 200 response indicates success with no additional payload.
  • Confusing this endpoint with a single-rule detach; if SpendRuleId is not provided, ALL rules are removed from the card.

Related Endpoints

  • POST /api/spendRules/attach — Attach a specific spend rule to a payment card.
  • POST /api/spendRules/detach — Detach a single spend rule from a payment card.
  • GET /api/spendRules — Retrieve all spend rules available in the system.
  • GET /api/spendRules/card — Retrieve all spend rules currently attached to a specific payment card.

Example

curl -X POST "https://api.banking.netevia.dev/api/spendRules/detachAll?PaymentCardId=pc_abc123xyz" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
Query Params
string
required
string
Response
200

Success

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here!