Skip to main content

Set a card as default

Make a stored card the authenticated user's default payment card, or remove its default status.

Domain
Cards and vault
Owning service
Payments
Intended for
Customer application · user to server
Supported authorization
Authenticated user Bearer token

Headers#

2
AuthorizationstringRequired
Accepted or forwarded by the API Gateway for this operation.
X-Merchant-IDstringOptional
Accepted or forwarded by the API Gateway for this operation.

Path parameters#

2
user_idstringRequired
Value substituted for `user_id` in the endpoint path.
card_idstringRequired
Value substituted for `card_id` in the endpoint path.

Request body#

1
is_defaultbooleanOptional
JSON payload accepted by the owning service. Use the request panel to edit and preview the body.
Example true

Response#

4
200The request was accepted or completed. Inspect the response payload for the business outcome.
401The supplied credentials or caller context are invalid.
403The supplied credentials or caller context are invalid.
404The requested resource or route was not found.

Default-card behavior#

Send {"is_default": true} to make the selected stored card the user's default. DEUNA removes the default status from any other card belonging to the same user, so the user has at most one default card.

The request body is optional. Omitting it has the same effect as sending {"is_default": true}. Send {"is_default": false} to remove the selected card's default status without changing any other card.

Before you call the endpoint#

  • Authenticate the customer and send their user access token in the Authorization header.
  • Set user_id to the authenticated user's UUID.
  • Use a card_id returned by List stored cards. The card must belong to the authenticated user.

Verify the result#

A successful request returns 200 OK with the updated card. Confirm that its is_default field matches the value you requested. You can also list the user's stored cards and verify that no other card is marked as the default.

The endpoint returns 404 Not Found when the selected card does not exist for the authenticated user. Correct invalid UUIDs or malformed JSON before retrying; repeated requests with the same is_default value leave the card in the same state.