Archive a subscription plan
curl --request PATCH \
--url https://app.dimepayments.com/api/subscription-plan/archive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"sid": 12345
}
}
'import requests
url = "https://app.dimepayments.com/api/subscription-plan/archive"
payload = { "data": { "sid": 12345 } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {sid: 12345}})
};
fetch('https://app.dimepayments.com/api/subscription-plan/archive', 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://app.dimepayments.com/api/subscription-plan/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'sid' => 12345
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.dimepayments.com/api/subscription-plan/archive"
payload := strings.NewReader("{\n \"data\": {\n \"sid\": 12345\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://app.dimepayments.com/api/subscription-plan/archive")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"sid\": 12345\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dimepayments.com/api/subscription-plan/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"sid\": 12345\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": null,
"name": "Monthly Membership 62492",
"description": "Iure odit et et modi ipsum nostrum omnis.",
"recurrence_schedule": "Monthly",
"status": "active",
"subtotal": 0,
"total": 0,
"token": "80K9RXSgQ8TLuUTPvL1tqHlPPe0ZmfPcHzzAV2qa",
"public_url": "http://app.dimepayments.com/subscribe/80K9RXSgQ8TLuUTPvL1tqHlPPe0ZmfPcHzzAV2qa",
"allow_public": true,
"created_at": null,
"items": []
}
}Subscription Plans management
Archive a subscription plan
Stops new subscriptions and hides it from the catalog. Existing subscribers keep their subscription.
PATCH
/
api
/
subscription-plan
/
archive
Archive a subscription plan
curl --request PATCH \
--url https://app.dimepayments.com/api/subscription-plan/archive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"sid": 12345
}
}
'import requests
url = "https://app.dimepayments.com/api/subscription-plan/archive"
payload = { "data": { "sid": 12345 } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {sid: 12345}})
};
fetch('https://app.dimepayments.com/api/subscription-plan/archive', 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://app.dimepayments.com/api/subscription-plan/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'sid' => 12345
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.dimepayments.com/api/subscription-plan/archive"
payload := strings.NewReader("{\n \"data\": {\n \"sid\": 12345\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://app.dimepayments.com/api/subscription-plan/archive")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"sid\": 12345\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dimepayments.com/api/subscription-plan/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"sid\": 12345\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": null,
"name": "Monthly Membership 62492",
"description": "Iure odit et et modi ipsum nostrum omnis.",
"recurrence_schedule": "Monthly",
"status": "active",
"subtotal": 0,
"total": 0,
"token": "80K9RXSgQ8TLuUTPvL1tqHlPPe0ZmfPcHzzAV2qa",
"public_url": "http://app.dimepayments.com/subscribe/80K9RXSgQ8TLuUTPvL1tqHlPPe0ZmfPcHzzAV2qa",
"allow_public": true,
"created_at": null,
"items": []
}
}Authorizations
You can retrieve your token by visiting your dashboard and clicking Generate API token under your profile in top right.
Body
application/json
Show child attributes
Show child attributes
Example:
{ "sid": 12345 }
Response
200 - application/json
Show child attributes
Show child attributes
⌘I

