Complete
curl --request PATCH \
--url https://{defaultHost}/v1/subscriptions/{id}/complete \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/subscriptions/{id}/complete"
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}/complete', 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}/complete",
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}/complete"
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}/complete")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/subscriptions/{id}/complete")
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": "d71eda28-c7e5-4cfe-a379-275bb16a806c",
"object": "subscription",
"ad_hoc_amount": null,
"affiliation_expires_at": null,
"cancel_at_period_end": false,
"currency": "usd",
"current_period_end_at": 1798655999,
"current_period_start_at": 1796063999,
"ended_at": 1796063999,
"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/d71eda28-c7e5-4cfe-a379-275bb16a806c",
"quantity": 1,
"remaining_period_count": 5,
"restart_on_completed": false,
"restore_at": null,
"subtotal_amount": 2900,
"status": "completed",
"tax_enabled": false,
"trial_end_at": null,
"trial_start_at": null,
"variant_options": null,
"affiliation": null,
"current_cancellation_act": null,
"current_period": "69c1288d-fff3-461e-9961-499ed372dc3a",
"customer": "b8b4f5c9-c05b-411f-a506-1935f791f989",
"discount": null,
"manual_payment_method": null,
"payment_method": "28a0d134-4c1e-429a-a1e4-b401d875a8f6",
"price": "626a5dea-1e8a-437e-9523-3afb6bb6285f",
"purchase": "88a3abf4-e1bf-4f83-8c65-da990879c302",
"shipping_method": null,
"variant": null,
"created_at": 1796063999,
"updated_at": 1796063999
}Subscriptions
Complete
Completes a specific subscription.
PATCH
/
v1
/
subscriptions
/
{id}
/
complete
Complete
curl --request PATCH \
--url https://{defaultHost}/v1/subscriptions/{id}/complete \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/subscriptions/{id}/complete"
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}/complete', 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}/complete",
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}/complete"
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}/complete")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/subscriptions/{id}/complete")
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": "d71eda28-c7e5-4cfe-a379-275bb16a806c",
"object": "subscription",
"ad_hoc_amount": null,
"affiliation_expires_at": null,
"cancel_at_period_end": false,
"currency": "usd",
"current_period_end_at": 1798655999,
"current_period_start_at": 1796063999,
"ended_at": 1796063999,
"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/d71eda28-c7e5-4cfe-a379-275bb16a806c",
"quantity": 1,
"remaining_period_count": 5,
"restart_on_completed": false,
"restore_at": null,
"subtotal_amount": 2900,
"status": "completed",
"tax_enabled": false,
"trial_end_at": null,
"trial_start_at": null,
"variant_options": null,
"affiliation": null,
"current_cancellation_act": null,
"current_period": "69c1288d-fff3-461e-9961-499ed372dc3a",
"customer": "b8b4f5c9-c05b-411f-a506-1935f791f989",
"discount": null,
"manual_payment_method": null,
"payment_method": "28a0d134-4c1e-429a-a1e4-b401d875a8f6",
"price": "626a5dea-1e8a-437e-9523-3afb6bb6285f",
"purchase": "88a3abf4-e1bf-4f83-8c65-da990879c302",
"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?