Set user's card as default

A user can choose to automatically renew his subscription or not.
If he has activated automatic renewal, once he will run out of credits, the user will be automatically debited to renew his subscription.

This automatic renewal will be charged on the user's default card.

The user should be able to change his default card as will.

Note

The user should be logged in.

PATCH https://api.tradingpartners.ai/api/v1/users/cards/{id}

Patch users/cards/{id} request object

Path Parameters


id - string fmt:uuid
The id of the card.

Body Attributes


isDefault - boolean
true if the card should be set as default.

Setting this to true will automatically set the other cards to false.

Authorization header

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXN0IjoidG9rZW4iLCJmb3IiOiJ1c2VyIiwid2l0aCI6ImdyYWRlIiwiZnVsbCI6dHJ1ZX0.sWNz-Z0oGGWoSwaVlOGyzCQdYCWJQmKSSFvZIJzchZw

Patch users/cards request object

{
  "isDefault": true
}
---

Response

A valid update of the default card is answered with a 204 status code.

StatusCode: 204