Pay Off
curl --request PATCH \
--url https://{defaultHost}/v1/subscriptions/{id}/pay_off \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/subscriptions/{id}/pay_off"
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/subscriptions/{id}/pay_off', 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/subscriptions/{id}/pay_off",
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/subscriptions/{id}/pay_off"
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/subscriptions/{id}/pay_off")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/subscriptions/{id}/pay_off")
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": "0987d60b-8489-4345-9cb0-bcaa3fd0ea2e",
"object": "subscription",
"ad_hoc_amount": null,
"affiliation_expires_at": null,
"cancel_at_period_end": false,
"currency": "usd",
"current_period_end_at": 1796063999,
"current_period_start_at": 1796063999,
"ended_at": null,
"finite": true,
"last_renewal_reminder_sent_at": null,
"live_mode": true,
"manual_payment": false,
"metadata": {},
"pending_update": {},
"price_readonly": true,
"portal_url": "http://app.example.com/portal_redirect/subscriptions/0987d60b-8489-4345-9cb0-bcaa3fd0ea2e",
"quantity": 1,
"remaining_period_count": 5,
"restart_on_completed": false,
"restore_at": null,
"subtotal_amount": 2900,
"status": "past_due",
"tax_enabled": false,
"trial_end_at": null,
"trial_start_at": null,
"variant_options": null,
"affiliation": null,
"current_cancellation_act": null,
"current_period": "59d13679-bee1-4f9e-bbd0-a35715aa8a43",
"customer": "590e30d4-d830-4a0c-8199-17aa09f2d8a0",
"discount": null,
"manual_payment_method": null,
"payment_method": "f344751f-2252-4045-9d93-fcec9b584325",
"price": "4a53a32b-d717-48f8-8362-662d5a6e7107",
"purchase": "ae50b6c4-53e2-4b34-b921-3fbd9ceba634",
"shipping_method": null,
"variant": null,
"created_at": 1796063999,
"updated_at": 1796063999
}Subscriptions
Pay Off
Pays off all remaining periods for a specific subscription.
PATCH
/
v1
/
subscriptions
/
{id}
/
pay_off
Pay Off
curl --request PATCH \
--url https://{defaultHost}/v1/subscriptions/{id}/pay_off \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/subscriptions/{id}/pay_off"
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/subscriptions/{id}/pay_off', 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/subscriptions/{id}/pay_off",
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/subscriptions/{id}/pay_off"
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/subscriptions/{id}/pay_off")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/subscriptions/{id}/pay_off")
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": "0987d60b-8489-4345-9cb0-bcaa3fd0ea2e",
"object": "subscription",
"ad_hoc_amount": null,
"affiliation_expires_at": null,
"cancel_at_period_end": false,
"currency": "usd",
"current_period_end_at": 1796063999,
"current_period_start_at": 1796063999,
"ended_at": null,
"finite": true,
"last_renewal_reminder_sent_at": null,
"live_mode": true,
"manual_payment": false,
"metadata": {},
"pending_update": {},
"price_readonly": true,
"portal_url": "http://app.example.com/portal_redirect/subscriptions/0987d60b-8489-4345-9cb0-bcaa3fd0ea2e",
"quantity": 1,
"remaining_period_count": 5,
"restart_on_completed": false,
"restore_at": null,
"subtotal_amount": 2900,
"status": "past_due",
"tax_enabled": false,
"trial_end_at": null,
"trial_start_at": null,
"variant_options": null,
"affiliation": null,
"current_cancellation_act": null,
"current_period": "59d13679-bee1-4f9e-bbd0-a35715aa8a43",
"customer": "590e30d4-d830-4a0c-8199-17aa09f2d8a0",
"discount": null,
"manual_payment_method": null,
"payment_method": "f344751f-2252-4045-9d93-fcec9b584325",
"price": "4a53a32b-d717-48f8-8362-662d5a6e7107",
"purchase": "ae50b6c4-53e2-4b34-b921-3fbd9ceba634",
"shipping_method": null,
"variant": null,
"created_at": 1796063999,
"updated_at": 1796063999
}Authorizations
Response
200 - application/json
Success
Expandable – The associated cancellation act ID.
Expandable – The associated period ID.
Expandable – The associated customer ID.
Expandable – The associated discount ID.
Expandable – The associated manual payment method ID.
Expandable – The associated payment method ID.
Expandable – Property not returned unless expanded.
Expandable – The associated price ID.
Expandable – The associated purchase ID.
Expandable – The associated shipping method ID.
Expandable – The associated variant ID.
Was this page helpful?