Cancel Subscription
curl --request POST \
--url https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel \
--header 'X-API-Key: <api-key>' \
--header 'X-Publishable-Key: <x-publishable-key>'import requests
url = "https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel"
headers = {
"X-Publishable-Key": "<x-publishable-key>",
"X-API-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Publishable-Key': '<x-publishable-key>', 'X-API-Key': '<api-key>'}
};
fetch('https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel', 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.boltapp.com/v1/subscriptions/{subscription_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>",
"X-Publishable-Key: <x-publishable-key>"
],
]);
$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.boltapp.com/v1/subscriptions/{subscription_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Publishable-Key", "<x-publishable-key>")
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel")
.header("X-Publishable-Key", "<x-publishable-key>")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Publishable-Key"] = '<x-publishable-key>'
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"errors": [
{
"code": 2001005,
"message": "The input is missing a required parameter."
}
],
"result": {
"success": false
}
}{
"errors": [
{
"code": 2001005,
"message": "The input is missing a required parameter."
}
],
"result": {
"success": false
}
}{
"errors": [
{
"code": 2001005,
"message": "The input is missing a required parameter."
}
],
"result": {
"success": false
}
}Subscriptions
Cancel Subscription
Cancel a subscription. This cancels any of the subscription’s orders that are currently scheduled, paused, or payment_failed; no further orders will be placed.
POST
/
v1
/
subscriptions
/
{subscription_id}
/
cancel
Cancel Subscription
curl --request POST \
--url https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel \
--header 'X-API-Key: <api-key>' \
--header 'X-Publishable-Key: <x-publishable-key>'import requests
url = "https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel"
headers = {
"X-Publishable-Key": "<x-publishable-key>",
"X-API-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Publishable-Key': '<x-publishable-key>', 'X-API-Key': '<api-key>'}
};
fetch('https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel', 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.boltapp.com/v1/subscriptions/{subscription_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>",
"X-Publishable-Key: <x-publishable-key>"
],
]);
$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.boltapp.com/v1/subscriptions/{subscription_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Publishable-Key", "<x-publishable-key>")
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel")
.header("X-Publishable-Key", "<x-publishable-key>")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.boltapp.com/v1/subscriptions/{subscription_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Publishable-Key"] = '<x-publishable-key>'
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"errors": [
{
"code": 2001005,
"message": "The input is missing a required parameter."
}
],
"result": {
"success": false
}
}{
"errors": [
{
"code": 2001005,
"message": "The input is missing a required parameter."
}
],
"result": {
"success": false
}
}{
"errors": [
{
"code": 2001005,
"message": "The input is missing a required parameter."
}
],
"result": {
"success": false
}
}Authorizations
Admins and Developers can obtain their Bolt API key from the Bolt Merchant Dashboard.
Headers
The publicly viewable identifier used to identify a merchant division. This key is found in the Developer > API section of the Bolt Merchant Dashboard.
Path Parameters
The unique ID for the subscription. The unique ID for a Bolt subscription.
Example:
"sub_1a2b3c4d5e"
Response
Success
A generic confirmation response.
Example:
true