Resume subscription
curl --request POST \
--url https://api.piriod.com/subscriptions/{id}/resume/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-simple-workspace: <x-simple-workspace>' \
--data '
{
"next_billing": "2023-12-25"
}
'import requests
url = "https://api.piriod.com/subscriptions/{id}/resume/"
payload = { "next_billing": "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({next_billing: '2023-12-25'})
};
fetch('https://api.piriod.com/subscriptions/{id}/resume/', 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}/resume/",
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([
'next_billing' => '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}/resume/"
payload := strings.NewReader("{\n \"next_billing\": \"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}/resume/")
.header("x-simple-workspace", "<x-simple-workspace>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"next_billing\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.piriod.com/subscriptions/{id}/resume/")
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 \"next_billing\": \"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
Resume subscription
POST
/
subscriptions
/
{id}
/
resume
/
Resume subscription
curl --request POST \
--url https://api.piriod.com/subscriptions/{id}/resume/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-simple-workspace: <x-simple-workspace>' \
--data '
{
"next_billing": "2023-12-25"
}
'import requests
url = "https://api.piriod.com/subscriptions/{id}/resume/"
payload = { "next_billing": "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({next_billing: '2023-12-25'})
};
fetch('https://api.piriod.com/subscriptions/{id}/resume/', 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}/resume/",
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([
'next_billing' => '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}/resume/"
payload := strings.NewReader("{\n \"next_billing\": \"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}/resume/")
.header("x-simple-workspace", "<x-simple-workspace>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"next_billing\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.piriod.com/subscriptions/{id}/resume/")
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 \"next_billing\": \"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
Use header Authorization: Token <api_token>.
API tokens are obtained from the Piriod dashboard.
Headers
Workspace (account) identifier. Required for every request.
Whether to operate against test-mode data. Defaults to false.
Path Parameters
Resource identifier.
Body
application/json
Body for POST /subscriptions/{id}/resume/.
Response
200 - application/json
Resumed subscription.
Customer ID.
Document type ID used to issue invoices.
Show child attributes
Show child attributes
Total cycles or null for indefinite.
Days until invoices generated by this subscription expire.
Available options:
send_invoice, charge_payment Default payment source ID. Required when collection_scheme=charge_payment.
Custom currency conversion factor for issued invoices.
Required range:
x >= 1Coupon ID applied at the subscription (invoice-level) scope.
Maximum string length:
100Available options:
active, paused, cancelled, finalized, needs_attention Maximum string length:
512Available options:
biller_issue, gateway_issue, reference_expired, without_usage_records, processing_issue, without_reference Available options:
custom, fraud_review_failed, insolvency, no_card, non_compliant_customer, not_paid, not_specified, shutdown_ops Available options:
not_specified, non_compliant_customer, custom Show child attributes
Show child attributes
Show child attributes
Show child attributes
