List Billing Customer Subscriptions
curl --request GET \
--url https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"subscriptions": [
{
"provider_customer_id": "test_customer_id",
"provider_subscription_id": "test_subscription_id",
"status": "active",
"description": null,
"items": [
{
"provider_item_id": "test_subscription_item_id",
"quantity": 1,
"metadata": null,
"price": {
"provider_price_id": "test_price_id",
"provider_product_id": "test_product_id",
"currency": "usd",
"amount_cents": 10000,
"active": true,
"billing_scheme": "per_unit",
"created": 1000,
"recurring": {
"interval": "month",
"interval_count": 1
}
},
"product": {
"name": "test_product_name",
"description": null,
"metadata": {}
},
"current_period_start": 1100,
"current_period_end": 1300,
"created": 1000,
"discounts": []
}
],
"discounts": [],
"cancellation_details": null,
"cancel_at_period_end": false,
"cancel_at": null,
"canceled_at": null,
"ended_at": null,
"paused": false,
"resumes_at": null,
"metadata": {},
"start_date": 1000,
"trial_start": null,
"trial_end": null,
"collection_method": "charge_automatically",
"created": 1000,
"last_invoice": {
"provider_invoice_id": "test_invoice_id",
"created": 1400
},
"provider_payment_method_id": "test_payment_method_id",
"billing_cycle_anchor": 1300
}
]
}
}Billing Customers
List Billing Customer Subscriptions
Lists the subscriptions belonging to one of your billing customers, with optional status filtering. Returns up to 100 subscriptions under a subscriptions key; pagination is not yet supported, so a customer holding more than 100 is truncated with no signal on the wire.
GET
/
billing-customers
/
{provider_customer_id}
/
subscriptions
List Billing Customer Subscriptions
curl --request GET \
--url https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openloophealth.com/v0.1/billing-customers/{provider_customer_id}/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"subscriptions": [
{
"provider_customer_id": "test_customer_id",
"provider_subscription_id": "test_subscription_id",
"status": "active",
"description": null,
"items": [
{
"provider_item_id": "test_subscription_item_id",
"quantity": 1,
"metadata": null,
"price": {
"provider_price_id": "test_price_id",
"provider_product_id": "test_product_id",
"currency": "usd",
"amount_cents": 10000,
"active": true,
"billing_scheme": "per_unit",
"created": 1000,
"recurring": {
"interval": "month",
"interval_count": 1
}
},
"product": {
"name": "test_product_name",
"description": null,
"metadata": {}
},
"current_period_start": 1100,
"current_period_end": 1300,
"created": 1000,
"discounts": []
}
],
"discounts": [],
"cancellation_details": null,
"cancel_at_period_end": false,
"cancel_at": null,
"canceled_at": null,
"ended_at": null,
"paused": false,
"resumes_at": null,
"metadata": {},
"start_date": 1000,
"trial_start": null,
"trial_end": null,
"collection_method": "charge_automatically",
"created": 1000,
"last_invoice": {
"provider_invoice_id": "test_invoice_id",
"created": 1400
},
"provider_payment_method_id": "test_payment_method_id",
"billing_cycle_anchor": 1300
}
]
}
}Authorizations
serviceTokenuserToken

