Update Subscription
curl --request PUT \
--url https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"productId": "<string>",
"startDate": 123,
"taxSettings": {
"enabled": true,
"country": "US",
"postalCode": "94102"
},
"cancelAtPeriodEnd": true
}
}
'import requests
url = "https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}"
payload = { "data": {
"productId": "<string>",
"startDate": 123,
"taxSettings": {
"enabled": True,
"country": "US",
"postalCode": "94102"
},
"cancelAtPeriodEnd": True
} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
productId: '<string>',
startDate: 123,
taxSettings: {enabled: true, country: 'US', postalCode: '94102'},
cancelAtPeriodEnd: true
}
})
};
fetch('https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}', 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.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'productId' => '<string>',
'startDate' => 123,
'taxSettings' => [
'enabled' => true,
'country' => 'US',
'postalCode' => '94102'
],
'cancelAtPeriodEnd' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}"
payload := strings.NewReader("{\n \"data\": {\n \"productId\": \"<string>\",\n \"startDate\": 123,\n \"taxSettings\": {\n \"enabled\": true,\n \"country\": \"US\",\n \"postalCode\": \"94102\"\n },\n \"cancelAtPeriodEnd\": true\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"productId\": \"<string>\",\n \"startDate\": 123,\n \"taxSettings\": {\n \"enabled\": true,\n \"country\": \"US\",\n \"postalCode\": \"94102\"\n },\n \"cancelAtPeriodEnd\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"productId\": \"<string>\",\n \"startDate\": 123,\n \"taxSettings\": {\n \"enabled\": true,\n \"country\": \"US\",\n \"postalCode\": \"94102\"\n },\n \"cancelAtPeriodEnd\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "sub_1ABC123DEF456GHI",
"type": "subscription",
"status": "active",
"cancelAtPeriodEndDisplay": null,
"customer": {
"id": "cus_ABC123XYZ",
"email": "customer@example.com"
},
"current_period_start": 1700000000,
"current_period_end": 1702600000,
"created": 1700000000,
"collection_method": "charge_automatically",
"cancel_at_period_end": false,
"canceled_at": null,
"product": {
"id": "prod_ABC123XYZ",
"name": "Pro Plan"
},
"automatic_tax": false,
"coupon": "",
"agents": "Agent 1, Agent 2",
"priceIds": [
"price_ABC123",
"price_DEF456"
],
"startDate": 1700000000
}{
"error": "An unexpected error occurred"
}Subscriptions
Update Subscription
Update a subscription for a connected account.
PUT
/
stripe
/
connect
/
accounts
/
{accountId}
/
subscriptions
/
{subscriptionId}
Update Subscription
curl --request PUT \
--url https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"productId": "<string>",
"startDate": 123,
"taxSettings": {
"enabled": true,
"country": "US",
"postalCode": "94102"
},
"cancelAtPeriodEnd": true
}
}
'import requests
url = "https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}"
payload = { "data": {
"productId": "<string>",
"startDate": 123,
"taxSettings": {
"enabled": True,
"country": "US",
"postalCode": "94102"
},
"cancelAtPeriodEnd": True
} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
productId: '<string>',
startDate: 123,
taxSettings: {enabled: true, country: 'US', postalCode: '94102'},
cancelAtPeriodEnd: true
}
})
};
fetch('https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}', 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.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'productId' => '<string>',
'startDate' => 123,
'taxSettings' => [
'enabled' => true,
'country' => 'US',
'postalCode' => '94102'
],
'cancelAtPeriodEnd' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}"
payload := strings.NewReader("{\n \"data\": {\n \"productId\": \"<string>\",\n \"startDate\": 123,\n \"taxSettings\": {\n \"enabled\": true,\n \"country\": \"US\",\n \"postalCode\": \"94102\"\n },\n \"cancelAtPeriodEnd\": true\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"productId\": \"<string>\",\n \"startDate\": 123,\n \"taxSettings\": {\n \"enabled\": true,\n \"country\": \"US\",\n \"postalCode\": \"94102\"\n },\n \"cancelAtPeriodEnd\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chat-dash.com/v1/public/stripe/connect/accounts/{accountId}/subscriptions/{subscriptionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"productId\": \"<string>\",\n \"startDate\": 123,\n \"taxSettings\": {\n \"enabled\": true,\n \"country\": \"US\",\n \"postalCode\": \"94102\"\n },\n \"cancelAtPeriodEnd\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "sub_1ABC123DEF456GHI",
"type": "subscription",
"status": "active",
"cancelAtPeriodEndDisplay": null,
"customer": {
"id": "cus_ABC123XYZ",
"email": "customer@example.com"
},
"current_period_start": 1700000000,
"current_period_end": 1702600000,
"created": 1700000000,
"collection_method": "charge_automatically",
"cancel_at_period_end": false,
"canceled_at": null,
"product": {
"id": "prod_ABC123XYZ",
"name": "Pro Plan"
},
"automatic_tax": false,
"coupon": "",
"agents": "Agent 1, Agent 2",
"priceIds": [
"price_ABC123",
"price_DEF456"
],
"startDate": 1700000000
}{
"error": "An unexpected error occurred"
}Headers
All requests to the ChatDash API must be validated with the agency API Key found on your agency profile
Path Parameters
The Stripe connected account ID
The Stripe subscription ID
Body
application/json
Show child attributes
Show child attributes
Response
OK
Example:
"sub_1ABC123DEF456GHI"
Example:
"subscription"
Example:
"active"
Example:
null
Example:
{
"id": "cus_ABC123XYZ",
"email": "customer@example.com"
}
Example:
1700000000
Example:
1702600000
Example:
1700000000
Example:
"charge_automatically"
Example:
false
Example:
null
Show child attributes
Show child attributes
Example:
false
Example:
""
Example:
"Agent 1, Agent 2"
Example:
["price_ABC123", "price_DEF456"]
Example:
1700000000
⌘I
