Retry Payment
curl --request PATCH \
--url https://{defaultHost}/v1/periods/{id}/retry_payment \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/periods/{id}/retry_payment"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/periods/{id}/retry_payment', 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://{defaultHost}/v1/periods/{id}/retry_payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/periods/{id}/retry_payment"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/periods/{id}/retry_payment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/periods/{id}/retry_payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "d94aa528-b1b2-4b01-a96e-f314dc5880dd",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1798655954,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"proration_method": "unused_amount_paid",
"quantity": 1,
"renewal": true,
"renewal_reminder_sent_at": null,
"restoral": false,
"start_at": 1796063954,
"status": "payment_failed",
"checkout": "d5925e1b-a971-404e-bf65-89feb83bd040",
"price": "cb959b91-3e20-4412-b033-0422195dbfa5",
"subscription": "266dc498-0532-4fb3-921d-ff6e6901858c",
"variant": null,
"created_at": 1796063954,
"updated_at": 1796063954
}Periods
Retry Payment
Retries payment for a specific period.
PATCH
/
v1
/
periods
/
{id}
/
retry_payment
Retry Payment
curl --request PATCH \
--url https://{defaultHost}/v1/periods/{id}/retry_payment \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/periods/{id}/retry_payment"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/periods/{id}/retry_payment', 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://{defaultHost}/v1/periods/{id}/retry_payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/periods/{id}/retry_payment"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/periods/{id}/retry_payment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/periods/{id}/retry_payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "d94aa528-b1b2-4b01-a96e-f314dc5880dd",
"object": "period",
"ad_hoc_amount": null,
"end_at": 1798655954,
"next_payment_retry_at": null,
"payment_retry_count": 0,
"payoff": false,
"proration_method": "unused_amount_paid",
"quantity": 1,
"renewal": true,
"renewal_reminder_sent_at": null,
"restoral": false,
"start_at": 1796063954,
"status": "payment_failed",
"checkout": "d5925e1b-a971-404e-bf65-89feb83bd040",
"price": "cb959b91-3e20-4412-b033-0422195dbfa5",
"subscription": "266dc498-0532-4fb3-921d-ff6e6901858c",
"variant": null,
"created_at": 1796063954,
"updated_at": 1796063954
}Authorizations
Response
200 - application/json
Success
Expandable – The associated checkout ID.
Expandable – The associated price ID.
Expandable – The associated subscription ID.
Expandable – The associated variant ID.
Was this page helpful?