Introduction
This documentation aims to provide all the information you need to work with our API.
Base URL
https://app.subscriptionplus.net
Authenticating requests
This API is authenticated by sending an Authorization
header with the value "Bearer {YOUR_API_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Generate API token.
Endpoints
Get Customer details
requires authentication
Example request:
curl --request GET \
--get "https://app.subscriptionplus.net/api/v1/customer/4662104293529?include=orders_count%2Ctotal_spent%2Csubscriptions.line_items" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/customer/4662104293529"
);
const params = {
"include": "orders_count,total_spent,subscriptions.line_items",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 4662104293529,
"name": "Sabrina G. McGraw",
"email": "[email protected]",
"note": "VIP Customer",
"avatar": null,
"status": 1,
"member_since": "2021-05-10T06:51:58.000000Z",
"subscriptions": [
{
"id": 1200619673,
"interval": "MONTH",
"note": null,
"customer_id": 4662104293529,
"last_payment_status": null,
"tags": [],
"discount_code": null,
"order_frequency": 1,
"billing_frequency": 1,
"next_billing_date": "2021-07-08T19:37:01.595686Z",
"last_billing_attempt": "2021-06-29 14:49:42",
"min_cycles": null,
"max_cycles": null,
"executed_cycles": 1,
"currency_code": "USD",
"type": "subscription",
"status": "active",
"currency_format": "$0.00",
"line_items": [
{
"id": 60,
"product_id": 6137966461081,
"line_item_id": "c4538325-70e6-429a-8335-685d2b4649ba",
"variant_id": 38027906547865,
"subscription_id": 1200619673,
"title": "Folding Hex Wrench Set 3-10mm",
"selling_plan_name": "Delivery every month",
"variant_title": "AWS-11",
"image": "https://cdn.shopify.com/s/files/1/0531/8538/0505/products/park-tool-aws-12.jpg?v=1612770280",
"price": 11.69,
"quantity": 1,
"is_onetime": false,
"requires_shipping": 1,
"created_at": "2021-06-29T09:19:43.000000Z",
"updated_at": "2021-06-29T09:19:43.000000Z"
}
]
},
{
"id": 1200586905,
"interval": "MONTH",
"note": null,
"customer_id": 4662104293529,
"last_payment_status": null,
"tags": [],
"discount_code": null,
"order_frequency": 1,
"billing_frequency": 1,
"next_billing_date": "2021-07-08T19:37:01.621831Z",
"last_billing_attempt": "2021-06-29 14:49:39",
"min_cycles": null,
"max_cycles": null,
"executed_cycles": 1,
"currency_code": "USD",
"type": "subscription",
"status": "active",
"currency_format": "$0.00",
"line_items": [
{
"id": 59,
"product_id": 6137965805721,
"line_item_id": "ea9c9b31-6df0-4c70-aa27-9152811aad39",
"variant_id": 38027905433753,
"subscription_id": 1200586905,
"title": "Fixie Stem",
"selling_plan_name": "Delivery every month",
"variant_title": "Black",
"image": "https://cdn.shopify.com/s/files/1/0531/8538/0505/products/Stem_Black_3RD_WEB.jpg?v=1612770273",
"price": 18,
"quantity": 1,
"is_onetime": false,
"requires_shipping": 1,
"created_at": "2021-06-29T09:19:40.000000Z",
"updated_at": "2021-06-29T09:19:40.000000Z"
}
]
}
],
"orders_count": 24,
"total_spent": {
"amount": 6298.97,
"presentment_money": 0
}
}
}
Received response:
Request failed with error:
App Settings
requires authentication
Example request:
curl --request GET \
--get "https://app.subscriptionplus.net/api/v1/settings" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/settings"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
GET api/v1/cancellation-reasons
requires authentication
Example request:
curl --request GET \
--get "https://app.subscriptionplus.net/api/v1/cancellation-reasons" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/cancellation-reasons"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
GET api/v1/get-selling-plan
requires authentication
Example request:
curl --request GET \
--get "https://app.subscriptionplus.net/api/v1/get-selling-plan" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/get-selling-plan"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Get subscription details
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/1200619673?include=line_items.product.variants%2Cline_items.available_products.variants%2Corders.line_items%2C+order%2Ccard%2Caddress%2Cupcoming_order%2Ccustomer.cards%2Cavailable_frequencies%2Cavailable_products.variants%2Ctotal" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/1200619673"
);
const params = {
"include": "line_items.product.variants,line_items.available_products.variants,orders.line_items, order,card,address,upcoming_order,customer.cards,available_frequencies,available_products.variants,total",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Get subscription details
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/1200619673/available-products?include=qui" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/1200619673/available-products"
);
const params = {
"include": "qui",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
POST api/v1/subscription/{id}/all-available-products
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/20/all-available-products" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/20/all-available-products"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
GET api/v1/subscription/{id}/upsell-products
requires authentication
Example request:
curl --request GET \
--get "https://app.subscriptionplus.net/api/v1/subscription/10/upsell-products" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/10/upsell-products"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Update status
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/20/status" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"status\": \"active\"
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/20/status"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"status": "active"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Update order frequency
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/18/update_frequency" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"interval\": \"year\",
\"order_frequency\": 13,
\"billing_frequency\": 10
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/18/update_frequency"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"interval": "year",
"order_frequency": 13,
"billing_frequency": 10
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Update product variant/quantity
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/8/update_variant" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"line_item_ids\": [
20
],
\"quantity\": [
17
],
\"product_ids\": [
7
],
\"variant_ids\": [
10
]
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/8/update_variant"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"line_item_ids": [
20
],
"quantity": [
17
],
"product_ids": [
7
],
"variant_ids": [
10
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Apply/Remove Discount
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/1/apply_discount" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"optio\"
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/1/apply_discount"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"code": "optio"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Add products to subscription
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/4/add_product" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"product_ids\": [
1
],
\"variant_ids\": [
1
],
\"quantity\": [
0
]
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/4/add_product"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"product_ids": [
1
],
"variant_ids": [
1
],
"quantity": [
0
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Swap Product
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/13/swap_product" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"line_item_id\": 3,
\"product_id\": 5,
\"variant_id\": 4
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/13/swap_product"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"line_item_id": 3,
"product_id": 5,
"variant_id": 4
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Add one-time product to subscription
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/5/add_onetime_product" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"product_ids\": [
1
],
\"variant_ids\": [
1
],
\"quantity\": [
0
]
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/5/add_onetime_product"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"product_ids": [
1
],
"variant_ids": [
1
],
"quantity": [
0
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Update shipping address
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/4/update_address" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"address1\": \"voluptates\",
\"city\": \"eveniet\",
\"country\": \"reiciendis\",
\"zip\": \"modi\",
\"phone\": \"et\",
\"first_name\": \"error\",
\"last_name\": \"velit\",
\"address2\": \"voluptatibus\",
\"company\": \"cum\"
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/4/update_address"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"address1": "voluptates",
"city": "eveniet",
"country": "reiciendis",
"zip": "modi",
"phone": "et",
"first_name": "error",
"last_name": "velit",
"address2": "voluptatibus",
"company": "cum"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Update billing date
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/17/update_billing_date" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"date\": \"et\"
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/17/update_billing_date"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"date": "et"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Remove subscription item
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/4/remove_line_item/9" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/4/remove_line_item/9"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Swap subscription payment method
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/19/payment-method/laborum/update" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/19/payment-method/laborum/update"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Ship now
requires authentication
Note: Not applicable for prepaid subscription
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/13/ship_now" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"update_shipping_date\": false
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/13/ship_now"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"update_shipping_date": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
POST api/v1/subscription/{id}/upsell-products/buy
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/subscription/11/upsell-products/buy" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"data\": [
{
\"product_id\": \"soluta\",
\"variant_id\": \"velit\",
\"subscribe\": true
}
]
}"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/subscription/11/upsell-products/buy"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"data": [
{
"product_id": "soluta",
"variant_id": "velit",
"subscribe": true
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Add new payment method
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/customer/4662104293529/add-payment" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/customer/4662104293529/add-payment"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Update payment method
requires authentication
Example request:
curl --request POST \
"https://app.subscriptionplus.net/api/v1/payment-method/ut/update" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://app.subscriptionplus.net/api/v1/payment-method/ut/update"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Received response:
Request failed with error: