Update payment card
curl --request PATCH \
--url http://localhost:7701/api/v1/subscriptions/{uuid}/card \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"card_token": "card_tok_new_xyz"
}
'{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Basic Monthly",
"description": "<string>",
"amount": 2990,
"currency": "BRL",
"interval": "monthly",
"interval_count": 1,
"trial_period_days": 7,
"billing_day": 5,
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"customer": {},
"card": {
"last_4_digits": "4242",
"brand": "visa",
"expire_month": "12",
"expire_year": "2028"
},
"coupon": {},
"amount": 2990,
"original_amount": 2990,
"discount_amount": 500,
"currency": "BRL",
"interval": "monthly",
"interval_count": 1,
"billing_day": 5,
"trial": {
"period_days": 7,
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"current_period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"next_billing_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"paused_until": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"cancel_at": "2023-11-07T05:31:56Z",
"cancel_at_period_end": false,
"plan_change_at": "2023-11-07T05:31:56Z",
"new_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": [
{}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Subscriptions
Update payment card
Replaces the stored card used for future billing cycles on this subscription.
PATCH
/
api
/
v1
/
subscriptions
/
{uuid}
/
card
Update payment card
curl --request PATCH \
--url http://localhost:7701/api/v1/subscriptions/{uuid}/card \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"card_token": "card_tok_new_xyz"
}
'{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Basic Monthly",
"description": "<string>",
"amount": 2990,
"currency": "BRL",
"interval": "monthly",
"interval_count": 1,
"trial_period_days": 7,
"billing_day": 5,
"is_active": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"customer": {},
"card": {
"last_4_digits": "4242",
"brand": "visa",
"expire_month": "12",
"expire_year": "2028"
},
"coupon": {},
"amount": 2990,
"original_amount": 2990,
"discount_amount": 500,
"currency": "BRL",
"interval": "monthly",
"interval_count": 1,
"billing_day": 5,
"trial": {
"period_days": 7,
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"current_period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"next_billing_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"paused_until": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"cancel_at": "2023-11-07T05:31:56Z",
"cancel_at_period_end": false,
"plan_change_at": "2023-11-07T05:31:56Z",
"new_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": [
{}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Company API key. Send in the X-API-Key header.
Path Parameters
Body
application/json
Token of the new card to use for future charges.
Example:
"card_tok_new_xyz"
Response
Card updated
Show child attributes
Show child attributes
⌘I