Subscriptions

Retrieve a subscription

get/subscriptions/{id}

Path parameters

idinteger required

The SamCart ID for the subscription

Query parameters

created_at_minstring date-time

Filter by created at date/time at or after given value. Accepts ISO 8601/RFC 3339 format with timezone (e.g., 2025-01-16T14:30:00Z) or date-only (e.g., 2025-01-16). Date-only values use 00:00:00 UTC.

created_at_maxstring date-time

Filter by created at date/time at or before given value. Accepts ISO 8601/RFC 3339 format with timezone (e.g., 2025-01-16T14:30:00Z) or date-only (e.g., 2025-01-16). Date-only values use 23:59:59 UTC.

rebilling_at_minstring date-time

Filter by rebilling date/time at or after given value. Accepts ISO 8601/RFC 3339 format with timezone (e.g., 2025-01-16T14:30:00Z) or date-only (e.g., 2025-01-16). Date-only values use 00:00:00 UTC.

rebilling_at_maxstring date-time

Filter by rebilling date/time at or before given value. Accepts ISO 8601/RFC 3339 format with timezone (e.g., 2025-01-16T14:30:00Z) or date-only (e.g., 2025-01-16). Date-only values use 23:59:59 UTC.

canceled_at_minstring date-time

Filter by canceled date/time at or after given value. Accepts ISO 8601/RFC 3339 format with timezone (e.g., 2025-01-16T14:30:00Z) or date-only (e.g., 2025-01-16). Date-only values use 00:00:00 UTC.

canceled_at_maxstring date-time

Filter by canceled date/time at or before given value. Accepts ISO 8601/RFC 3339 format with timezone (e.g., 2025-01-16T14:30:00Z) or date-only (e.g., 2025-01-16). Date-only values use 23:59:59 UTC.

test_modeboolean

Filter by test mode

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

Filter subscriptions by status

type'limited_subscription' | 'recurring_subscription'

Filter subscriptions by type

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