End
End a customer plan
v1.customers.plans.end(PlanEndParams**kwargs) -> PlanEndResponse
post/v1/customers/{customer_id}/plans/{customer_plan_id}/end
Change the end date of a customer's plan.
Parameters
customer_idstr
formatuuid
customer_plan_idstr
formatuuid
ending_beforeunion
optional
Union[str, datetime]
RFC 3339 timestamp for when the plan ends (exclusive) for this customer. Must be at 0:00 UTC (midnight). If not provided, the plan end date will be cleared.
formatdate-time
If true, plan end date can be before the last finalized invoice date. Any invoices generated after the plan end date will be voided.
Only applicable when void_invoices is set to true. If true, for every invoice that is voided we will also attempt to void/delete the stripe invoice (if any). Stripe invoices will be voided if finalized or deleted if still in draft state.
Returns
PlanEndResponseclass
from datetime import datetime
from metronome import Metronome
client = Metronome(
bearer_token="My Bearer Token",
)
response = client.v1.customers.plans.end(
customer_id="d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
customer_plan_id="7aa11640-0703-4600-8eb9-293f535a6b74",
ending_before=datetime.fromisoformat("2021-02-01T00:00:00"),
)
print(response)
200 Example
{}