Pause subscription
curl --request POST \
--url https://api.piriod.com/subscriptions/{id}/pause/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-simple-workspace: <x-simple-workspace>' \
--data '
{
"pause_until": "2023-12-25"
}
'import requests
url = "https://api.piriod.com/subscriptions/{id}/pause/"
payload = { "pause_until": "2023-12-25" }
headers = {
"x-simple-workspace": "<x-simple-workspace>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-simple-workspace': '<x-simple-workspace>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({pause_until: '2023-12-25'})
};
fetch('https://api.piriod.com/subscriptions/{id}/pause/', 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.piriod.com/subscriptions/{id}/pause/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pause_until' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-simple-workspace: <x-simple-workspace>"
],
]);
$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.piriod.com/subscriptions/{id}/pause/"
payload := strings.NewReader("{\n \"pause_until\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-simple-workspace", "<x-simple-workspace>")
req.Header.Add("Authorization", "<api-key>")
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.post("https://api.piriod.com/subscriptions/{id}/pause/")
.header("x-simple-workspace", "<x-simple-workspace>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pause_until\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.piriod.com/subscriptions/{id}/pause/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-simple-workspace"] = '<x-simple-workspace>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pause_until\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"customer": "<string>",
"document": 123,
"date_start": "2023-12-25",
"next_billing": "2023-12-25",
"lines": [
{
"plan": "<string>",
"quantity": 2,
"id": "<string>",
"coupon": "<string>",
"coupon_redemptions": 123,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}
],
"id": "<string>",
"previous_billing": "2023-12-25",
"billing_cycles": 123,
"next_billing_cycle": 1,
"expiration_days": 10,
"collection_scheme": "send_invoice",
"default_source": "<string>",
"custom_change": 2,
"coupon": "<string>",
"coupon_redemptions": 123,
"require_reference": false,
"note": "<string>",
"orgunit": 123,
"status": "active",
"status_description": "<string>",
"needs_attention": "2023-11-07T05:31:56Z",
"needs_attention_reason": "biller_issue",
"cancel_reason": "custom",
"cancelled": "2023-11-07T05:31:56Z",
"paused": "2023-11-07T05:31:56Z",
"paused_reason": "not_specified",
"pause_until": "2023-12-25",
"addons": [
{
"addon": "<string>",
"quantity": 2,
"addon_redemptions": 123,
"rates": [
{
"billing_cycle": 123,
"percentage": 123,
"description": "<string>"
}
]
}
],
"references": [
{
"date": "2023-12-25",
"document": "<string>",
"serial": "<string>",
"date_end": "2023-12-25",
"description": "<string>"
}
],
"test_mode": true,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}Subscriptions
Pause subscription
POST
/
subscriptions
/
{id}
/
pause
/
Pause subscription
curl --request POST \
--url https://api.piriod.com/subscriptions/{id}/pause/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-simple-workspace: <x-simple-workspace>' \
--data '
{
"pause_until": "2023-12-25"
}
'import requests
url = "https://api.piriod.com/subscriptions/{id}/pause/"
payload = { "pause_until": "2023-12-25" }
headers = {
"x-simple-workspace": "<x-simple-workspace>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-simple-workspace': '<x-simple-workspace>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({pause_until: '2023-12-25'})
};
fetch('https://api.piriod.com/subscriptions/{id}/pause/', 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.piriod.com/subscriptions/{id}/pause/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pause_until' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-simple-workspace: <x-simple-workspace>"
],
]);
$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.piriod.com/subscriptions/{id}/pause/"
payload := strings.NewReader("{\n \"pause_until\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-simple-workspace", "<x-simple-workspace>")
req.Header.Add("Authorization", "<api-key>")
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.post("https://api.piriod.com/subscriptions/{id}/pause/")
.header("x-simple-workspace", "<x-simple-workspace>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pause_until\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.piriod.com/subscriptions/{id}/pause/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-simple-workspace"] = '<x-simple-workspace>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pause_until\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"customer": "<string>",
"document": 123,
"date_start": "2023-12-25",
"next_billing": "2023-12-25",
"lines": [
{
"plan": "<string>",
"quantity": 2,
"id": "<string>",
"coupon": "<string>",
"coupon_redemptions": 123,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}
],
"id": "<string>",
"previous_billing": "2023-12-25",
"billing_cycles": 123,
"next_billing_cycle": 1,
"expiration_days": 10,
"collection_scheme": "send_invoice",
"default_source": "<string>",
"custom_change": 2,
"coupon": "<string>",
"coupon_redemptions": 123,
"require_reference": false,
"note": "<string>",
"orgunit": 123,
"status": "active",
"status_description": "<string>",
"needs_attention": "2023-11-07T05:31:56Z",
"needs_attention_reason": "biller_issue",
"cancel_reason": "custom",
"cancelled": "2023-11-07T05:31:56Z",
"paused": "2023-11-07T05:31:56Z",
"paused_reason": "not_specified",
"pause_until": "2023-12-25",
"addons": [
{
"addon": "<string>",
"quantity": 2,
"addon_redemptions": 123,
"rates": [
{
"billing_cycle": 123,
"percentage": 123,
"description": "<string>"
}
]
}
],
"references": [
{
"date": "2023-12-25",
"document": "<string>",
"serial": "<string>",
"date_end": "2023-12-25",
"description": "<string>"
}
],
"test_mode": true,
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}Authorizations
Headers
Body
application/json
Response
200 - application/json
Paused subscription.
