Subscriptions

Schedule an individual subscription to be canceled. Only subscriptions with an active status may be scheduled.

post/subscriptions/{id}/scheduleCancel

Path parameters

idinteger required

The SamCart ID for the subscription

Request body

cancel_whenstring

Either custom or end. When selecting end, the Subscription will be canceled at the end of the current billing period. When selecting custom, the Subscription will be canceled on the date specified with the schedule_date parameter

schedule_datestring

The date at which the Subscription should cancel. If cancel_when is set to custom, this parameter is required.

Example request

{
  "cancel_when": "custom",
  "schedule_date": "2022-04-08"
}

Response

Successful operation

idinteger

The SamCart ID for the subscription

customer_idinteger

The SamCart ID for the customer that created the charge

affiliate_idinteger nullable

The SamCart ID of the affiliate credited for the order.

order_idinteger

The SamCart ID for the order. For subscriptions, this will be the order ID of the original purchase.

product_idinteger

The SamCart ID for a product in the cart

skustring nullable

The optional product SKU for the subscription

status'active' | 'canceled' | 'delinquent' | 'completed' | 'paused' | 'invalid_processor' | 'sca_required' | 'deleted'

The status of the subscription

type'limited_subscription' | 'recurring_subscription'

Indicates the format of the subscription

product_namestring

The name of the product for the subscription

internal_product_namestring nullable

An optional product name displayed on the marketplace dashboard for the subscription

processor_name'Stripe' | 'Braintree' | 'Authorize.net' | 'PayPal'

The name of the processor for the order

test_modeboolean

Indicates whether the transaction was done while the product was in test mode.

card_usednumber nullable

The last 4 digits of the card that was used. PayPal charges will have a null value.

created_atstring date-time

The UTC date and time the subscription was created. This is also when the original order was created.

start_datestring date-time

The UTC date and time the first rebill occurred. For subscriptions with trials, this will be the first rebill after the trial.

end_datestring date-time nullable

The UTC date and time that a limited subscription will end. Recurring subscriptions will not have a value.

next_rebilling_datestring date-time

The UTC date and time of the next rebill for the subscription

total_failed_chargesinteger

The number of unsuccessful charges for this subscription

subscription_interval'days' | 'weekly' | 'monthly' | 'quarterly' | 'yearly'

The billing interval for the subscription

stripe_plan_idstring nullable

The Stripe plan ID associated with this subscription

Example response

{
  "id": 1337,
  "customer_id": 1234,
  "affiliate_id": 1001,
  "order_id": 1001,
  "product_id": 1001,
  "sku": "sku123",
  "status": "active",
  "type": "recurring_subscription",
  "product_name": "Cool Product",
  "internal_product_name": "Cool Product",
  "initial_price": {
    "subtotal": 10000,
    "taxes": 500,
    "shipping": 300,
    "total": 9800
  },
  "recurring_price": {
    "subtotal": 10000,
    "taxes": 500,
    "shipping": 300,
    "total": 10800
  },
  "coupon": {
    "charge_instance": "one_time",
    "code": "summersale",
    "type": "flat_rate",
    "discount_percentage": 10
  },
  "cancel_schedule": {
    "status": "scheduled",
    "cancel_date": "2021-03-08 00:18:35"
  },
  "processor_name": "Stripe",
  "test_mode": true,
  "created_at": "2021-03-08 00:18:35",
  "start_date": "2021-03-08 00:18:35",
  "end_date": "2021-03-08 00:18:35",
  "next_rebilling_date": "2021-04-08 00:18:35",
  "total_failed_charges": 1,
  "subscription_interval": "monthly",
  "stripe_plan_id": "plan_abc123"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.