ResourcesSubscriptions

Overview

On this page, we’ll dive into the subscription cancellation endpoint you can use to manage subscriptions programmatically.

Subscriptions represent recurring product purchases made through your store. The V2 subscriptions API currently exposes one cancellation route, which can either cancel immediately or schedule cancellation for the end of the current billing period depending on the request body you send.

Note

Both endpoint pages below document the same PATCH /v2/subscriptions/{subscription}/cancel route. They are split out to show the two main request-body patterns.

Endpoints

The subscription model

The subscription model contains the key billing and customer details associated with a recurring subscription.

Properties

Name
idinteger
Description

(read-only) The unique identifier for the subscription record.

Name
invoice_idinteger | null
Description

(read-only) The original invoice ID linked to this subscription, if available.

Name
providerstring
Description

(read-only) The billing provider handling the subscription, such as stripe or paypal.

Name
subscription_idstring
Description

(read-only) The provider subscription identifier.

Name
customer_idstring
Description

(read-only) The provider customer identifier.

Name
customer_emailstring
Description

(read-only) The customer email associated with the subscription.

Name
statusstring
Description

(read-only) The current subscription status, such as ACTIVE or CANCELED.

Name
current_period_starttimestamp | null
Description

(read-only) When the current billing period started.

Name
current_period_endtimestamp | null
Description

(read-only) When the current billing period ends or ended.

Name
cancel_at_period_endboolean
Description

(read-only) Whether the subscription is scheduled to cancel at the end of the current billing period.

Name
cancellation_in_progressboolean
Description

(read-only) Whether an immediate cancellation request has been accepted and is still waiting on provider webhook sync.

Name
store_idinteger
Description

(read-only) The ID of the store this subscription belongs to.

Name
product_variant_idinteger | null
Description

(read-only) The ID of the subscribed product variant.

Name
created_attimestamp
Description

(read-only) Time at which the subscription record was created.

Name
updated_attimestamp
Description

(read-only) Time at which the subscription record was last updated.


On this page