Get active subscription details

Requires authentication

HTTP Request

GET connector/api/active-subscription

Example request:

curl -X GET \
-G "http://erp.dstadvertising.com/connector/api/active-subscription" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"

Example response (200):

{
"data": {
"id": 1,
"business_id": 1,
"package_id": 3,
"start_date": "2020-09-05 00:00:00",
"trial_end_date": "2020-09-15",
"end_date": "2020-10-05 00:00:00",
"package_price": "599.9900",
"package_details": {
"location_count": 0,
"user_count": 0,
"product_count": 0,
"invoice_count": 0,
"name": "Unlimited",
"woocommerce_module": 1,
"essentials_module": 1
},
"created_id": 1,
"paid_via": "stripe",
"payment_transaction_id": "ch_1CuLdQAhokBpT93LVZNg2At6",
"status": "approved",
"deleted_at": null,
"created_at": "2018-08-01 07:49:09",
"updated_at": "2018-08-01 07:49:09",
"locations_created": 1,
"users_created": 6,
"products_created": 2,
"invoices_created": 1
}
}

javascript

const url = new URL(
"http://erp.dstadvertising.com/connector/api/active-subscription"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));