Subscriptions

Cancel Subscription

Schedule or complete cancellation and optionally cancel related invoices.

Behavior depends on subscription status:

  • ACTIVE: Cancellation is scheduled for the end of the current billing period (the subscription stays active until then; it is not moved to CANCELED immediately).
  • INACTIVE, TRIALING, TRIAL_PENDING: The subscription is canceled immediately (status becomes CANCELED).

Use cancel_related_invoices to also cancel ongoing invoices tied to this subscription.

post/api/v2/subscriptions/{subscription_id}/cancel

Path parameters

subscription_idstring uuid required

Unique identifier (UUID) of the subscription to cancel

Unique identifier (UUID) of the subscription to cancel

Request body

cancel_related_invoicesboolean

Whether or not to cancel all the related invoices to this subscription. If False, only the subscription will be canceled but the related invoices will remain untouched.

Response

Successful Response

created_atstring date-time

Creation timestamp of the object.

updated_atstring date-time nullable

Last modification timestamp of the object.

idstring uuid4

Unique identifier (UUID) of the subscription

descriptionstring nullable

Description of the subscription

amountstring

Total subscription amount after discounts

original_amountstring

Original subscription amount before discounts

item_level_discounted_amountstring

Total amount discounted at the item level

remaining_daysinteger

Number of days remaining in the current billing period

currency'SAR' | 'USD' | 'EUR' | 'GBP' | 'AED' | 'BHD' | 'KWD' | 'OMR' | 'QAR'

ISO 4217 currency codes supported by Moyasar.

Includes all currencies supported by Moyasar payment gateway.

home_currency_amountstring nullable

Amount in home currency (SAR) at creation

exchange_rate_at_creationstring nullable

Exchange rate used at subscription creation

recurring_interval'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR'
recurring_interval_countinteger

Number of intervals per billing cycle (e.g., 2 for bi-monthly)

status'INACTIVE' | 'ACTIVE' | 'EXPIRED' | 'CANCELED' | 'FROZEN' | 'TRIALING' | 'TRIAL_PENDING'
current_period_startstring date-time

Start date and time of the current billing period

current_period_endstring date-time

End date and time of the current billing period

current_cycle_numberinteger

Current cycle number of the subscription

cancel_at_period_endboolean

Whether the subscription will be canceled at the end of the current period

cancel_at_cycle_numberinteger nullable

Cycle number at which the subscription will be automatically canceled

started_atstring date-time nullable

Date and time when the subscription started

ended_atstring date-time nullable

Date and time when the subscription ended

user_idstring uuid4

Unique identifier (UUID) of the user who created the subscription

organization_consumer_idstring uuid4

Unique identifier (UUID) of the organization consumer

latest_invoice_idstring uuid4 nullable

Unique identifier (UUID) of the most recent invoice for this subscription

trial_period_daysinteger nullable

Number of days for the free trial period

trial_endstring date-time nullable

Date and time when the trial period ends

amount_in_smallest_unitinteger

Subscription amount in smallest currency unit (e.g. halala for SAR).

original_amount_in_smallest_unitinteger

Original subscription amount (before discounts) in smallest currency unit.

Changes