Subscriptions

Add, edit, and delete anything related to subscriptions.

SubscriptionPlan

plan_id
integer

The internal ID this subscription plan, which is used to group subscription products.

plan_title
string

The title for this subscription plan.

can_downgrade
boolean

Allow your customers to downgrade their subscription within the plan on their own. Disabled only allows them to switch to a higher priced subscription.

{
  • "plan_id": 0,
  • "plan_title": "string",
  • "can_downgrade": true
}

Subscription

subscription_id
integer

The internal ID for this subscription.

title
string

The description for this subscription.

type
string

This can either be stripe or paypal as the standard implementation.

status
string

This can be Active, Suspended, or Canceled.

price
number

The recurring price for this subscription.

quantity
integer

Typically 1, but can be used in cases where a user can subscription to multiple of the same product.

payment_length
integer

This is the length to recur, for example 2 is for every 2 weeks/months. Typical value is 1.

payment_period
string

This is the period to recur and can be W = Weekly, M = Monthly, or Y = Yearly.

payment_duration
integer

Typically enter 0 to allow this to recur forever. Enter an integer to cancel the subscription automatically after some number of payments (e.g. cancel after 3 months, enter 3 here).

start_date
string

The timestamp for the subscription start date, default is the current timestamp.

user_id
integer

Connect this subscription to a user in the system.

user_email
string

The email address for this subscription.

user_first_name
string

The first name associated with this subscription.

user_last_name
string

The last name associated with this subscription.

user_country
string

The 2 character country code associated with this subscription.

product_id
integer

The product for this subscription.

product_model_number
string

The model number for the product associated with this subscription.

last_payment_date
string

The unix timestamp to indicate the last payment.

next_payment_date
string

The unix timestamp to indicate the next payment.

total_payments
integer

The total number of payments completed.

failed_payments
integer

The total number of failed payments.

stripe_subscription_id
string

The connecting subscription ID from Stripe.

{
  • "subscription_id": 0,
  • "title": "string",
  • "type": "string",
  • "status": "string",
  • "price": 0,
  • "quantity": 0,
  • "payment_length": 0,
  • "payment_period": "string",
  • "payment_duration": 0,
  • "start_date": "string",
  • "user_id": 0,
  • "user_email": "string",
  • "user_first_name": "string",
  • "user_last_name": "string",
  • "user_country": "string",
  • "product_id": 0,
  • "product_model_number": "string",
  • "last_payment_date": "string",
  • "next_payment_date": "string",
  • "total_payments": 0,
  • "failed_payments": 0,
  • "stripe_subscription_id": "string"
}

Gets a list of subscriptions

This allows you to get a list of subscriptions

SecuritybearerAuth or basicAuth
Request
query Parameters
page
integer <int64>

Page number starting at 1

perpage
integer <int64>

Number of items per page

sortby
string

Sort results by term

sortdir
string

Sort results ASC or DESC

search
string

Filter subscriptions by a search term

Responses
200

Successful operation

400

Unauthorized

get/subscriptions
Request samples
Response samples
application/json
[
  • {
    }
]

Add a subscription

This allows you to add a new subscription

SecuritybearerAuth
Request
Request Body schema: application/json
required

Submit any or all elements to add a new subscription.

title
string

The description for this subscription.

type
string

This can either be stripe or paypal as the standard implementation.

status
string

This can be Active, Suspended, or Canceled.

price
number

The recurring price for this subscription.

quantity
integer

Typically 1, but can be used in cases where a user can subscription to multiple of the same product.

payment_length
integer

This is the length to recur, for example 2 is for every 2 weeks/months. Typical value is 1.

payment_period
string

This is the period to recur and can be W = Weekly, M = Monthly, or Y = Yearly.

payment_duration
integer

Typically enter 0 to allow this to recur forever. Enter an integer to cancel the subscription automatically after some number of payments (e.g. cancel after 3 months, enter 3 here).

start_date
string

The timestamp for the subscription start date, default is the current timestamp.

user_id
integer

Connect this subscription to a user in the system.

user_email
string

The email address for this subscription.

user_first_name
string

The first name associated with this subscription.

user_last_name
string

The last name associated with this subscription.

user_country
string

The 2 character country code associated with this subscription.

product_id
integer

The product for this subscription.

product_model_number
string

The model number for the product associated with this subscription.

last_payment_date
string

The unix timestamp to indicate the last payment.

next_payment_date
string

The unix timestamp to indicate the next payment.

total_payments
integer

The total number of payments completed.

failed_payments
integer

The total number of failed payments.

stripe_subscription_id
string

The connecting subscription ID from Stripe.

Responses
200

Successful operation

400

Unauthorized

post/subscriptions
Request samples
application/json
{
  • "title": "string",
  • "type": "string",
  • "status": "string",
  • "price": 0,
  • "quantity": 0,
  • "payment_length": 0,
  • "payment_period": "string",
  • "payment_duration": 0,
  • "start_date": "string",
  • "user_id": 0,
  • "user_email": "string",
  • "user_first_name": "string",
  • "user_last_name": "string",
  • "user_country": "string",
  • "product_id": 0,
  • "product_model_number": "string",
  • "last_payment_date": "string",
  • "next_payment_date": "string",
  • "total_payments": 0,
  • "failed_payments": 0,
  • "stripe_subscription_id": "string"
}
Response samples
application/json
{
  • "subscription_id": 0,
  • "title": "string",
  • "type": "string",
  • "status": "string",
  • "price": 0,
  • "quantity": 0,
  • "payment_length": 0,
  • "payment_period": "string",
  • "payment_duration": 0,
  • "start_date": "string",
  • "user_id": 0,
  • "user_email": "string",
  • "user_first_name": "string",
  • "user_last_name": "string",
  • "user_country": "string",
  • "product_id": 0,
  • "product_model_number": "string",
  • "last_payment_date": "string",
  • "next_payment_date": "string",
  • "total_payments": 0,
  • "failed_payments": 0,
  • "stripe_subscription_id": "string"
}

Gets a subscription by ID

This allows you to get a subscription from your store by subscription ID

SecuritybearerAuth or basicAuth
Request
path Parameters
subscription_id
required
integer <int64>

Subscription ID

Responses
200

Successful operation

400

Unauthorized

get/subscriptions/{subscription_id}
Request samples
Response samples
application/json
{
  • "subscription_id": 0,
  • "title": "string",
  • "type": "string",
  • "status": "string",
  • "price": 0,
  • "quantity": 0,
  • "payment_length": 0,
  • "payment_period": "string",
  • "payment_duration": 0,
  • "start_date": "string",
  • "user_id": 0,
  • "user_email": "string",
  • "user_first_name": "string",
  • "user_last_name": "string",
  • "user_country": "string",
  • "product_id": 0,
  • "product_model_number": "string",
  • "last_payment_date": "string",
  • "next_payment_date": "string",
  • "total_payments": 0,
  • "failed_payments": 0,
  • "stripe_subscription_id": "string"
}

Updates a subscription by ID

This allows you to update a subscription

SecuritybearerAuth
Request
path Parameters
subscription_id
required
integer <int64>

Subscription ID

Request Body schema: application/json
required

Submit any or all elements to update the subscription.

title
string

The description for this subscription.

type
string

This can either be stripe or paypal as the standard implementation.

status
string

This can be Active, Suspended, or Canceled.

price
number

The recurring price for this subscription.

quantity
integer

Typically 1, but can be used in cases where a user can subscription to multiple of the same product.

payment_length
integer

This is the length to recur, for example 2 is for every 2 weeks/months. Typical value is 1.

payment_period
string

This is the period to recur and can be W = Weekly, M = Monthly, or Y = Yearly.

payment_duration
integer

Typically enter 0 to allow this to recur forever. Enter an integer to cancel the subscription automatically after some number of payments (e.g. cancel after 3 months, enter 3 here).

start_date
string

The timestamp for the subscription start date, default is the current timestamp.

user_id
integer

Connect this subscription to a user in the system.

user_email
string

The email address for this subscription.

user_first_name
string

The first name associated with this subscription.

user_last_name
string

The last name associated with this subscription.

user_country
string

The 2 character country code associated with this subscription.

product_id
integer

The product for this subscription.

product_model_number
string

The model number for the product associated with this subscription.

last_payment_date
string

The unix timestamp to indicate the last payment.

next_payment_date
string

The unix timestamp to indicate the next payment.

total_payments
integer

The total number of payments completed.

failed_payments
integer

The total number of failed payments.

stripe_subscription_id
string

The connecting subscription ID from Stripe.

Responses
200

Successful operation

400

Unauthorized

patch/subscriptions/{subscription_id}
Request samples
application/json
{
  • "title": "string",
  • "type": "string",
  • "status": "string",
  • "price": 0,
  • "quantity": 0,
  • "payment_length": 0,
  • "payment_period": "string",
  • "payment_duration": 0,
  • "start_date": "string",
  • "user_id": 0,
  • "user_email": "string",
  • "user_first_name": "string",
  • "user_last_name": "string",
  • "user_country": "string",
  • "product_id": 0,
  • "product_model_number": "string",
  • "last_payment_date": "string",
  • "next_payment_date": "string",
  • "total_payments": 0,
  • "failed_payments": 0,
  • "stripe_subscription_id": "string"
}
Response samples
application/json
{
  • "subscription_id": 0,
  • "title": "string",
  • "type": "string",
  • "status": "string",
  • "price": 0,
  • "quantity": 0,
  • "payment_length": 0,
  • "payment_period": "string",
  • "payment_duration": 0,
  • "start_date": "string",
  • "user_id": 0,
  • "user_email": "string",
  • "user_first_name": "string",
  • "user_last_name": "string",
  • "user_country": "string",
  • "product_id": 0,
  • "product_model_number": "string",
  • "last_payment_date": "string",
  • "next_payment_date": "string",
  • "total_payments": 0,
  • "failed_payments": 0,
  • "stripe_subscription_id": "string"
}

Deletes a subscription by ID

This allows you to delete a subscription from your store

SecuritybearerAuth
Request
path Parameters
subscription_id
required
integer <int64>

Subscription ID

Responses
200

Successful operation

400

Unauthorized

delete/subscriptions/{subscription_id}
Request samples
Response samples
application/json
{
  • "subscription_id": 0,
  • "title": "string",
  • "type": "string",
  • "status": "string",
  • "price": 0,
  • "quantity": 0,
  • "payment_length": 0,
  • "payment_period": "string",
  • "payment_duration": 0,
  • "start_date": "string",
  • "user_id": 0,
  • "user_email": "string",
  • "user_first_name": "string",
  • "user_last_name": "string",
  • "user_country": "string",
  • "product_id": 0,
  • "product_model_number": "string",
  • "last_payment_date": "string",
  • "next_payment_date": "string",
  • "total_payments": 0,
  • "failed_payments": 0,
  • "stripe_subscription_id": "string"
}

Gets a list of subscription plans

This allows you to get a list of subscription plans

SecuritybearerAuth or basicAuth
Request
query Parameters
page
integer <int64>

Page number starting at 1

perpage
integer <int64>

Number of items per page

sortby
string

Sort results by term

sortdir
string

Sort results ASC or DESC

search
string

Filter subscription plans by a search term

Responses
200

Successful operation

400

Unauthorized

get/subscriptions/plans
Request samples
Response samples
application/json
[
  • {
    }
]

Add a subscription plan

This allows you to add a new subscription plan

SecuritybearerAuth
Request
Request Body schema: application/json
required

Submit any or all elements to add a new subscription.

plan_title
required
string

The title for this subscription plan.

can_downgrade
boolean

Allow your customers to downgrade their subscription within the plan on their own. Disabled only allows them to switch to a higher priced subscription.

Responses
200

Successful operation

400

Unauthorized

post/subscriptions/plans
Request samples
application/json
{
  • "plan_title": "string",
  • "can_downgrade": true
}
Response samples
application/json
{
  • "plan_id": 0,
  • "plan_title": "string",
  • "can_downgrade": true
}

Gets a subscription plan by ID

This allows you to get a subscription plan from your store by subscription plan ID

SecuritybearerAuth or basicAuth
Request
path Parameters
plan_id
required
integer <int64>

Subscription Plan ID

Responses
200

Successful operation

400

Unauthorized

get/subscriptions/plans/{plan_id}
Request samples
Response samples
application/json
{
  • "plan_id": 0,
  • "plan_title": "string",
  • "can_downgrade": true
}

Updates a subscription plan by ID

This allows you to update a subscription plan

SecuritybearerAuth
Request
path Parameters
plan_id
required
integer <int64>

Subscription Plan ID

Request Body schema: application/json
required

Submit any or all elements to update the subscription plan.

plan_title
string

The title for this subscription plan.

can_downgrade
boolean

Allow your customers to downgrade their subscription within the plan on their own. Disabled only allows them to switch to a higher priced subscription.

Responses
200

Successful operation

400

Unauthorized

patch/subscriptions/plans/{plan_id}
Request samples
application/json
{
  • "plan_title": "string",
  • "can_downgrade": true
}
Response samples
application/json
{
  • "plan_id": 0,
  • "plan_title": "string",
  • "can_downgrade": true
}

Deletes a subscription plan by ID

This allows you to delete a subscription plan from your store

SecuritybearerAuth
Request
path Parameters
plan_id
required
integer <int64>

Subscription Plan ID

Responses
200

Successful operation

400

Unauthorized

delete/subscriptions/plans/{plan_id}
Request samples
Response samples
application/json
{
  • "plan_id": 0,
  • "plan_title": "string",
  • "can_downgrade": true
}