Schedule subscription changes and do more through the API

Cancelling a subscription now keeps it active until the end of the current billing period. The customer keeps access and is not charged again. The subscription shows as cancelling until then. Click Resume to undo the cancellation. Your customers get the same choice in the customer portal.
Developers can create subscriptions directly through the API. Pass a start_date to start one later, and the first charge happens on that date. Checkout sessions can now apply a discount code before the shopper arrives. They also send the shopper to your success_url after payment and carry your metadata through to the payment and any subscriptions it creates.
You can also create and update products through the API, with the same fields as the dashboard. Both endpoints are in the API playground on the Developers page.
POST /v1/subscriptionswithcustomer_id,product_id, optionalstart_dateandmetadata. The customer needs a saved payment method.POST /v1/subscriptions/:id/cancelnow cancels at period end by default. Sendimmediate: trueorat_period_end: falseto end it now.POST /v1/subscriptions/:id/resumealso undoes a scheduled cancellation.POST /v1/checkout-sessionsacceptsdiscount_code.success_urlandmetadataare now saved and used.POST /v1/productscreates a product.PATCH /v1/products/:idupdates the fields you send, andarchivedarchives it.- Filter
GET /v1/subscriptionsandGET /v1/transactionsbymetadata[key]=value. Filter transactions bysubscription_id. - New webhook events:
subscription.created,subscription.scheduled,subscription.activatedandsubscription.cancel_scheduled. Payloads now includesandbox, andpayment.completedincludesmetadata,checkout_session_idandsubscription_ids.
- Customer portal links now include your workspace, so customers land in your portal directly.