curl --request DELETE \
--url https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses', 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/subscriptions/{provider_subscription_id}/pauses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/subscriptions/{provider_subscription_id}/pauses"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"config_id": "test_config_id",
"provider_account_id": "test_account_id",
"payment_provider": "stripe",
"subscription": {
"provider_customer_id": "test_customer_id",
"provider_subscription_id": "test_subscription_id",
"status": "active",
"description": null,
"items": [],
"cancellation_details": null,
"discounts": [],
"cancel_at_period_end": false,
"cancel_at": null,
"canceled_at": null,
"ended_at": null,
"paused": false,
"resumes_at": null,
"metadata": {},
"start_date": 1300,
"trial_start": null,
"trial_end": null,
"collection_method": "charge_automatically",
"created": 1300,
"last_invoice": {
"provider_invoice_id": "test_invoice_id",
"created": null
},
"provider_payment_method_id": "test_payment_method_id",
"billing_cycle_anchor": 1300
}
}
}Resume Subscription
Resumes a paused subscription by deleting its pause. The pause is modeled as a sub-resource (/pauses) on the subscription — POST to create it, DELETE to remove it (= resume; this endpoint). The response returns the resumed subscription in the same shape as GET /subscriptions/{provider_subscription_id} and DELETE /subscriptions/{provider_subscription_id}. Resumes a subscription paused via POST /subscriptions/{provider_subscription_id}/pauses — check paused in the response, not status, since pausing does not change status. Calling this on a subscription that is not currently paused returns a 400.
Resuming starts a new billing cycle at the moment of the call and charges it in full right away. If that charge is declined, the call returns 400 with error_code PROVIDER_ERROR and the subscription stays paused. The resume invoice may read billing_reason: "manual"; a declined charge voids it, so last_invoice can then point at a voided invoice. Retrying after a resume that charged the card but did not finish does not charge again.
curl --request DELETE \
--url https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses', 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/subscriptions/{provider_subscription_id}/pauses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/subscriptions/{provider_subscription_id}/pauses"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openloophealth.com/v0.1/subscriptions/{provider_subscription_id}/pauses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"config_id": "test_config_id",
"provider_account_id": "test_account_id",
"payment_provider": "stripe",
"subscription": {
"provider_customer_id": "test_customer_id",
"provider_subscription_id": "test_subscription_id",
"status": "active",
"description": null,
"items": [],
"cancellation_details": null,
"discounts": [],
"cancel_at_period_end": false,
"cancel_at": null,
"canceled_at": null,
"ended_at": null,
"paused": false,
"resumes_at": null,
"metadata": {},
"start_date": 1300,
"trial_start": null,
"trial_end": null,
"collection_method": "charge_automatically",
"created": 1300,
"last_invoice": {
"provider_invoice_id": "test_invoice_id",
"created": null
},
"provider_payment_method_id": "test_payment_method_id",
"billing_cycle_anchor": 1300
}
}
}
