Preview the invoice for adding an add-on to a subscription.
curl --request POST \
--url https://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"Uid": "string",
"_objectType": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Subscription": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Account": {},
"Plan": {},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"IsPlanUpgradeRequired": false,
"PlanUpgradeRequiredMessage": "string",
"SubscriptionAddOns": [],
"DiscountCouponSubscriptions": [],
"DiscountCode": "string",
"DiscountCouponExpirationDate": "string",
"LatestInvoice": {},
"Rate": 0
},
"AddOn": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"Name": "string",
"BillingAddOnType": 1,
"IsQuantityEditable": false,
"MinimumQuantity": 0,
"MonthlyRate": 0,
"AnnualRate": 0,
"SetupFee": 0,
"UnitOfMeasure": "string",
"IsTaxable": false,
"IsBilledDuringTrial": false,
"ExpiresAfterMonths": 0,
"ExpirationDate": "string",
"StripeTaxCodeId": "string",
"PlanAddOns": [],
"ContentGroups": [],
"IsPerUser": false,
"QuarterlyRate": 0,
"OneTimeRate": 0,
"SubscriptionCount": 0,
"Quantity": 0
},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"Rate": 0
}
'import requests
url = "https://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview"
payload = {
"Uid": "string",
"_objectType": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Subscription": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Account": {},
"Plan": {},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"IsPlanUpgradeRequired": False,
"PlanUpgradeRequiredMessage": "string",
"SubscriptionAddOns": [],
"DiscountCouponSubscriptions": [],
"DiscountCode": "string",
"DiscountCouponExpirationDate": "string",
"LatestInvoice": {},
"Rate": 0
},
"AddOn": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"Name": "string",
"BillingAddOnType": 1,
"IsQuantityEditable": False,
"MinimumQuantity": 0,
"MonthlyRate": 0,
"AnnualRate": 0,
"SetupFee": 0,
"UnitOfMeasure": "string",
"IsTaxable": False,
"IsBilledDuringTrial": False,
"ExpiresAfterMonths": 0,
"ExpirationDate": "string",
"StripeTaxCodeId": "string",
"PlanAddOns": [],
"ContentGroups": [],
"IsPerUser": False,
"QuarterlyRate": 0,
"OneTimeRate": 0,
"SubscriptionCount": 0,
"Quantity": 0
},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"Rate": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Uid: 'string',
_objectType: 'string',
ActivityEventData: {},
BillingRenewalTerm: 1,
Subscription: {
Uid: 'string',
_objectType: 'string',
Created: 'string',
Updated: 'string',
ActivityEventData: {},
BillingRenewalTerm: 1,
Account: {},
Plan: {},
Quantity: 0,
StartDate: 'string',
EndDate: 'string',
ExpirationDate: 'string',
RenewalDate: 'string',
NewRequiredQuantity: 0,
IsPlanUpgradeRequired: false,
PlanUpgradeRequiredMessage: 'string',
SubscriptionAddOns: [],
DiscountCouponSubscriptions: [],
DiscountCode: 'string',
DiscountCouponExpirationDate: 'string',
LatestInvoice: {},
Rate: 0
},
AddOn: {
Uid: 'string',
_objectType: 'string',
Created: 'string',
Updated: 'string',
ActivityEventData: {},
Name: 'string',
BillingAddOnType: 1,
IsQuantityEditable: false,
MinimumQuantity: 0,
MonthlyRate: 0,
AnnualRate: 0,
SetupFee: 0,
UnitOfMeasure: 'string',
IsTaxable: false,
IsBilledDuringTrial: false,
ExpiresAfterMonths: 0,
ExpirationDate: 'string',
StripeTaxCodeId: 'string',
PlanAddOns: [],
ContentGroups: [],
IsPerUser: false,
QuarterlyRate: 0,
OneTimeRate: 0,
SubscriptionCount: 0,
Quantity: 0
},
Quantity: 0,
StartDate: 'string',
EndDate: 'string',
ExpirationDate: 'string',
RenewalDate: 'string',
NewRequiredQuantity: 0,
Rate: 0
})
};
fetch('https://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview', 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://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview",
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([
'Uid' => 'string',
'_objectType' => 'string',
'ActivityEventData' => [
],
'BillingRenewalTerm' => 1,
'Subscription' => [
'Uid' => 'string',
'_objectType' => 'string',
'Created' => 'string',
'Updated' => 'string',
'ActivityEventData' => [
],
'BillingRenewalTerm' => 1,
'Account' => [
],
'Plan' => [
],
'Quantity' => 0,
'StartDate' => 'string',
'EndDate' => 'string',
'ExpirationDate' => 'string',
'RenewalDate' => 'string',
'NewRequiredQuantity' => 0,
'IsPlanUpgradeRequired' => false,
'PlanUpgradeRequiredMessage' => 'string',
'SubscriptionAddOns' => [
],
'DiscountCouponSubscriptions' => [
],
'DiscountCode' => 'string',
'DiscountCouponExpirationDate' => 'string',
'LatestInvoice' => [
],
'Rate' => 0
],
'AddOn' => [
'Uid' => 'string',
'_objectType' => 'string',
'Created' => 'string',
'Updated' => 'string',
'ActivityEventData' => [
],
'Name' => 'string',
'BillingAddOnType' => 1,
'IsQuantityEditable' => false,
'MinimumQuantity' => 0,
'MonthlyRate' => 0,
'AnnualRate' => 0,
'SetupFee' => 0,
'UnitOfMeasure' => 'string',
'IsTaxable' => false,
'IsBilledDuringTrial' => false,
'ExpiresAfterMonths' => 0,
'ExpirationDate' => 'string',
'StripeTaxCodeId' => 'string',
'PlanAddOns' => [
],
'ContentGroups' => [
],
'IsPerUser' => false,
'QuarterlyRate' => 0,
'OneTimeRate' => 0,
'SubscriptionCount' => 0,
'Quantity' => 0
],
'Quantity' => 0,
'StartDate' => 'string',
'EndDate' => 'string',
'ExpirationDate' => 'string',
'RenewalDate' => 'string',
'NewRequiredQuantity' => 0,
'Rate' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview"
payload := strings.NewReader("{\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Subscription\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Account\": {},\n \"Plan\": {},\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"IsPlanUpgradeRequired\": false,\n \"PlanUpgradeRequiredMessage\": \"string\",\n \"SubscriptionAddOns\": [],\n \"DiscountCouponSubscriptions\": [],\n \"DiscountCode\": \"string\",\n \"DiscountCouponExpirationDate\": \"string\",\n \"LatestInvoice\": {},\n \"Rate\": 0\n },\n \"AddOn\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"Name\": \"string\",\n \"BillingAddOnType\": 1,\n \"IsQuantityEditable\": false,\n \"MinimumQuantity\": 0,\n \"MonthlyRate\": 0,\n \"AnnualRate\": 0,\n \"SetupFee\": 0,\n \"UnitOfMeasure\": \"string\",\n \"IsTaxable\": false,\n \"IsBilledDuringTrial\": false,\n \"ExpiresAfterMonths\": 0,\n \"ExpirationDate\": \"string\",\n \"StripeTaxCodeId\": \"string\",\n \"PlanAddOns\": [],\n \"ContentGroups\": [],\n \"IsPerUser\": false,\n \"QuarterlyRate\": 0,\n \"OneTimeRate\": 0,\n \"SubscriptionCount\": 0,\n \"Quantity\": 0\n },\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"Rate\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Subscription\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Account\": {},\n \"Plan\": {},\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"IsPlanUpgradeRequired\": false,\n \"PlanUpgradeRequiredMessage\": \"string\",\n \"SubscriptionAddOns\": [],\n \"DiscountCouponSubscriptions\": [],\n \"DiscountCode\": \"string\",\n \"DiscountCouponExpirationDate\": \"string\",\n \"LatestInvoice\": {},\n \"Rate\": 0\n },\n \"AddOn\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"Name\": \"string\",\n \"BillingAddOnType\": 1,\n \"IsQuantityEditable\": false,\n \"MinimumQuantity\": 0,\n \"MonthlyRate\": 0,\n \"AnnualRate\": 0,\n \"SetupFee\": 0,\n \"UnitOfMeasure\": \"string\",\n \"IsTaxable\": false,\n \"IsBilledDuringTrial\": false,\n \"ExpiresAfterMonths\": 0,\n \"ExpirationDate\": \"string\",\n \"StripeTaxCodeId\": \"string\",\n \"PlanAddOns\": [],\n \"ContentGroups\": [],\n \"IsPerUser\": false,\n \"QuarterlyRate\": 0,\n \"OneTimeRate\": 0,\n \"SubscriptionCount\": 0,\n \"Quantity\": 0\n },\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"Rate\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Subscription\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Account\": {},\n \"Plan\": {},\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"IsPlanUpgradeRequired\": false,\n \"PlanUpgradeRequiredMessage\": \"string\",\n \"SubscriptionAddOns\": [],\n \"DiscountCouponSubscriptions\": [],\n \"DiscountCode\": \"string\",\n \"DiscountCouponExpirationDate\": \"string\",\n \"LatestInvoice\": {},\n \"Rate\": 0\n },\n \"AddOn\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"Name\": \"string\",\n \"BillingAddOnType\": 1,\n \"IsQuantityEditable\": false,\n \"MinimumQuantity\": 0,\n \"MonthlyRate\": 0,\n \"AnnualRate\": 0,\n \"SetupFee\": 0,\n \"UnitOfMeasure\": \"string\",\n \"IsTaxable\": false,\n \"IsBilledDuringTrial\": false,\n \"ExpiresAfterMonths\": 0,\n \"ExpirationDate\": \"string\",\n \"StripeTaxCodeId\": \"string\",\n \"PlanAddOns\": [],\n \"ContentGroups\": [],\n \"IsPerUser\": false,\n \"QuarterlyRate\": 0,\n \"OneTimeRate\": 0,\n \"SubscriptionCount\": 0,\n \"Quantity\": 0\n },\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"Rate\": 0\n}"
response = http.request(request)
puts response.read_body{
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"InvoiceDate": "string",
"PaymentReminderSentDate": "string",
"Number": 0,
"BillingInvoiceStatus": 1,
"Subscription": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Account": {},
"Plan": {},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"IsPlanUpgradeRequired": false,
"PlanUpgradeRequiredMessage": "string",
"SubscriptionAddOns": [],
"DiscountCouponSubscriptions": [],
"DiscountCode": "string",
"DiscountCouponExpirationDate": "string",
"LatestInvoice": {},
"Rate": 0
},
"Amount": 0,
"AmountOutstanding": 0,
"InvoiceLineItems": [
{
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"StartDate": "string",
"EndDate": "string",
"Description": "string",
"UnitOfMeasure": "string",
"Quantity": 0,
"Rate": 0,
"Amount": 0,
"Tax": 0,
"Invoice": {},
"LineItemType": 1,
"EntityId": 0,
"StripeTaxReference": "string",
"StripeTaxLineItemId": "string",
"EntityUid": "string"
}
],
"IsUserGenerated": false,
"StripeTaxCalculationId": "string",
"StripeTaxBehavior": "string",
"AmountCredit": 0,
"AmountDiscount": 0,
"AmountPaid": 0,
"AmountRefunded": 0,
"AmountSubtotal": 0,
"AmountTax": 0,
"AmountTaxRefunded": 0,
"IsTaxable": false,
"HasPaymentGatewayTransactions": false,
"StripePaymentTransactionIds": "string",
"StripeRefundTransactionIds": "string",
"StripeTaxRefundTransactionIds": "string"
}Subscriptions
Preview the invoice for adding an add-on to a subscription.
Returns an invoice object with information about the amount outstanding. This method does not commit the change.
POST
/
api
/
v1
/
billing
/
subscriptionaddons
/
addsubscriptionaddonpreview
Preview the invoice for adding an add-on to a subscription.
curl --request POST \
--url https://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"Uid": "string",
"_objectType": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Subscription": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Account": {},
"Plan": {},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"IsPlanUpgradeRequired": false,
"PlanUpgradeRequiredMessage": "string",
"SubscriptionAddOns": [],
"DiscountCouponSubscriptions": [],
"DiscountCode": "string",
"DiscountCouponExpirationDate": "string",
"LatestInvoice": {},
"Rate": 0
},
"AddOn": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"Name": "string",
"BillingAddOnType": 1,
"IsQuantityEditable": false,
"MinimumQuantity": 0,
"MonthlyRate": 0,
"AnnualRate": 0,
"SetupFee": 0,
"UnitOfMeasure": "string",
"IsTaxable": false,
"IsBilledDuringTrial": false,
"ExpiresAfterMonths": 0,
"ExpirationDate": "string",
"StripeTaxCodeId": "string",
"PlanAddOns": [],
"ContentGroups": [],
"IsPerUser": false,
"QuarterlyRate": 0,
"OneTimeRate": 0,
"SubscriptionCount": 0,
"Quantity": 0
},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"Rate": 0
}
'import requests
url = "https://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview"
payload = {
"Uid": "string",
"_objectType": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Subscription": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Account": {},
"Plan": {},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"IsPlanUpgradeRequired": False,
"PlanUpgradeRequiredMessage": "string",
"SubscriptionAddOns": [],
"DiscountCouponSubscriptions": [],
"DiscountCode": "string",
"DiscountCouponExpirationDate": "string",
"LatestInvoice": {},
"Rate": 0
},
"AddOn": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"Name": "string",
"BillingAddOnType": 1,
"IsQuantityEditable": False,
"MinimumQuantity": 0,
"MonthlyRate": 0,
"AnnualRate": 0,
"SetupFee": 0,
"UnitOfMeasure": "string",
"IsTaxable": False,
"IsBilledDuringTrial": False,
"ExpiresAfterMonths": 0,
"ExpirationDate": "string",
"StripeTaxCodeId": "string",
"PlanAddOns": [],
"ContentGroups": [],
"IsPerUser": False,
"QuarterlyRate": 0,
"OneTimeRate": 0,
"SubscriptionCount": 0,
"Quantity": 0
},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"Rate": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Uid: 'string',
_objectType: 'string',
ActivityEventData: {},
BillingRenewalTerm: 1,
Subscription: {
Uid: 'string',
_objectType: 'string',
Created: 'string',
Updated: 'string',
ActivityEventData: {},
BillingRenewalTerm: 1,
Account: {},
Plan: {},
Quantity: 0,
StartDate: 'string',
EndDate: 'string',
ExpirationDate: 'string',
RenewalDate: 'string',
NewRequiredQuantity: 0,
IsPlanUpgradeRequired: false,
PlanUpgradeRequiredMessage: 'string',
SubscriptionAddOns: [],
DiscountCouponSubscriptions: [],
DiscountCode: 'string',
DiscountCouponExpirationDate: 'string',
LatestInvoice: {},
Rate: 0
},
AddOn: {
Uid: 'string',
_objectType: 'string',
Created: 'string',
Updated: 'string',
ActivityEventData: {},
Name: 'string',
BillingAddOnType: 1,
IsQuantityEditable: false,
MinimumQuantity: 0,
MonthlyRate: 0,
AnnualRate: 0,
SetupFee: 0,
UnitOfMeasure: 'string',
IsTaxable: false,
IsBilledDuringTrial: false,
ExpiresAfterMonths: 0,
ExpirationDate: 'string',
StripeTaxCodeId: 'string',
PlanAddOns: [],
ContentGroups: [],
IsPerUser: false,
QuarterlyRate: 0,
OneTimeRate: 0,
SubscriptionCount: 0,
Quantity: 0
},
Quantity: 0,
StartDate: 'string',
EndDate: 'string',
ExpirationDate: 'string',
RenewalDate: 'string',
NewRequiredQuantity: 0,
Rate: 0
})
};
fetch('https://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview', 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://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview",
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([
'Uid' => 'string',
'_objectType' => 'string',
'ActivityEventData' => [
],
'BillingRenewalTerm' => 1,
'Subscription' => [
'Uid' => 'string',
'_objectType' => 'string',
'Created' => 'string',
'Updated' => 'string',
'ActivityEventData' => [
],
'BillingRenewalTerm' => 1,
'Account' => [
],
'Plan' => [
],
'Quantity' => 0,
'StartDate' => 'string',
'EndDate' => 'string',
'ExpirationDate' => 'string',
'RenewalDate' => 'string',
'NewRequiredQuantity' => 0,
'IsPlanUpgradeRequired' => false,
'PlanUpgradeRequiredMessage' => 'string',
'SubscriptionAddOns' => [
],
'DiscountCouponSubscriptions' => [
],
'DiscountCode' => 'string',
'DiscountCouponExpirationDate' => 'string',
'LatestInvoice' => [
],
'Rate' => 0
],
'AddOn' => [
'Uid' => 'string',
'_objectType' => 'string',
'Created' => 'string',
'Updated' => 'string',
'ActivityEventData' => [
],
'Name' => 'string',
'BillingAddOnType' => 1,
'IsQuantityEditable' => false,
'MinimumQuantity' => 0,
'MonthlyRate' => 0,
'AnnualRate' => 0,
'SetupFee' => 0,
'UnitOfMeasure' => 'string',
'IsTaxable' => false,
'IsBilledDuringTrial' => false,
'ExpiresAfterMonths' => 0,
'ExpirationDate' => 'string',
'StripeTaxCodeId' => 'string',
'PlanAddOns' => [
],
'ContentGroups' => [
],
'IsPerUser' => false,
'QuarterlyRate' => 0,
'OneTimeRate' => 0,
'SubscriptionCount' => 0,
'Quantity' => 0
],
'Quantity' => 0,
'StartDate' => 'string',
'EndDate' => 'string',
'ExpirationDate' => 'string',
'RenewalDate' => 'string',
'NewRequiredQuantity' => 0,
'Rate' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview"
payload := strings.NewReader("{\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Subscription\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Account\": {},\n \"Plan\": {},\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"IsPlanUpgradeRequired\": false,\n \"PlanUpgradeRequiredMessage\": \"string\",\n \"SubscriptionAddOns\": [],\n \"DiscountCouponSubscriptions\": [],\n \"DiscountCode\": \"string\",\n \"DiscountCouponExpirationDate\": \"string\",\n \"LatestInvoice\": {},\n \"Rate\": 0\n },\n \"AddOn\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"Name\": \"string\",\n \"BillingAddOnType\": 1,\n \"IsQuantityEditable\": false,\n \"MinimumQuantity\": 0,\n \"MonthlyRate\": 0,\n \"AnnualRate\": 0,\n \"SetupFee\": 0,\n \"UnitOfMeasure\": \"string\",\n \"IsTaxable\": false,\n \"IsBilledDuringTrial\": false,\n \"ExpiresAfterMonths\": 0,\n \"ExpirationDate\": \"string\",\n \"StripeTaxCodeId\": \"string\",\n \"PlanAddOns\": [],\n \"ContentGroups\": [],\n \"IsPerUser\": false,\n \"QuarterlyRate\": 0,\n \"OneTimeRate\": 0,\n \"SubscriptionCount\": 0,\n \"Quantity\": 0\n },\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"Rate\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Subscription\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Account\": {},\n \"Plan\": {},\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"IsPlanUpgradeRequired\": false,\n \"PlanUpgradeRequiredMessage\": \"string\",\n \"SubscriptionAddOns\": [],\n \"DiscountCouponSubscriptions\": [],\n \"DiscountCode\": \"string\",\n \"DiscountCouponExpirationDate\": \"string\",\n \"LatestInvoice\": {},\n \"Rate\": 0\n },\n \"AddOn\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"Name\": \"string\",\n \"BillingAddOnType\": 1,\n \"IsQuantityEditable\": false,\n \"MinimumQuantity\": 0,\n \"MonthlyRate\": 0,\n \"AnnualRate\": 0,\n \"SetupFee\": 0,\n \"UnitOfMeasure\": \"string\",\n \"IsTaxable\": false,\n \"IsBilledDuringTrial\": false,\n \"ExpiresAfterMonths\": 0,\n \"ExpirationDate\": \"string\",\n \"StripeTaxCodeId\": \"string\",\n \"PlanAddOns\": [],\n \"ContentGroups\": [],\n \"IsPerUser\": false,\n \"QuarterlyRate\": 0,\n \"OneTimeRate\": 0,\n \"SubscriptionCount\": 0,\n \"Quantity\": 0\n },\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"Rate\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.outseta.com/api/v1/billing/subscriptionaddons/addsubscriptionaddonpreview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Subscription\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"BillingRenewalTerm\": 1,\n \"Account\": {},\n \"Plan\": {},\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"IsPlanUpgradeRequired\": false,\n \"PlanUpgradeRequiredMessage\": \"string\",\n \"SubscriptionAddOns\": [],\n \"DiscountCouponSubscriptions\": [],\n \"DiscountCode\": \"string\",\n \"DiscountCouponExpirationDate\": \"string\",\n \"LatestInvoice\": {},\n \"Rate\": 0\n },\n \"AddOn\": {\n \"Uid\": \"string\",\n \"_objectType\": \"string\",\n \"Created\": \"string\",\n \"Updated\": \"string\",\n \"ActivityEventData\": {},\n \"Name\": \"string\",\n \"BillingAddOnType\": 1,\n \"IsQuantityEditable\": false,\n \"MinimumQuantity\": 0,\n \"MonthlyRate\": 0,\n \"AnnualRate\": 0,\n \"SetupFee\": 0,\n \"UnitOfMeasure\": \"string\",\n \"IsTaxable\": false,\n \"IsBilledDuringTrial\": false,\n \"ExpiresAfterMonths\": 0,\n \"ExpirationDate\": \"string\",\n \"StripeTaxCodeId\": \"string\",\n \"PlanAddOns\": [],\n \"ContentGroups\": [],\n \"IsPerUser\": false,\n \"QuarterlyRate\": 0,\n \"OneTimeRate\": 0,\n \"SubscriptionCount\": 0,\n \"Quantity\": 0\n },\n \"Quantity\": 0,\n \"StartDate\": \"string\",\n \"EndDate\": \"string\",\n \"ExpirationDate\": \"string\",\n \"RenewalDate\": \"string\",\n \"NewRequiredQuantity\": 0,\n \"Rate\": 0\n}"
response = http.request(request)
puts response.read_body{
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"InvoiceDate": "string",
"PaymentReminderSentDate": "string",
"Number": 0,
"BillingInvoiceStatus": 1,
"Subscription": {
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"BillingRenewalTerm": 1,
"Account": {},
"Plan": {},
"Quantity": 0,
"StartDate": "string",
"EndDate": "string",
"ExpirationDate": "string",
"RenewalDate": "string",
"NewRequiredQuantity": 0,
"IsPlanUpgradeRequired": false,
"PlanUpgradeRequiredMessage": "string",
"SubscriptionAddOns": [],
"DiscountCouponSubscriptions": [],
"DiscountCode": "string",
"DiscountCouponExpirationDate": "string",
"LatestInvoice": {},
"Rate": 0
},
"Amount": 0,
"AmountOutstanding": 0,
"InvoiceLineItems": [
{
"Uid": "string",
"_objectType": "string",
"Created": "string",
"Updated": "string",
"ActivityEventData": {},
"StartDate": "string",
"EndDate": "string",
"Description": "string",
"UnitOfMeasure": "string",
"Quantity": 0,
"Rate": 0,
"Amount": 0,
"Tax": 0,
"Invoice": {},
"LineItemType": 1,
"EntityId": 0,
"StripeTaxReference": "string",
"StripeTaxLineItemId": "string",
"EntityUid": "string"
}
],
"IsUserGenerated": false,
"StripeTaxCalculationId": "string",
"StripeTaxBehavior": "string",
"AmountCredit": 0,
"AmountDiscount": 0,
"AmountPaid": 0,
"AmountRefunded": 0,
"AmountSubtotal": 0,
"AmountTax": 0,
"AmountTaxRefunded": 0,
"IsTaxable": false,
"HasPaymentGatewayTransactions": false,
"StripePaymentTransactionIds": "string",
"StripeRefundTransactionIds": "string",
"StripeTaxRefundTransactionIds": "string"
}Authorizations
BearerApiKey
Enter your access token (OAuth / JWT).
Body
application/json
The subscription add-on to preview, including its Subscription reference
Maximum string length:
101 - Monthly, 2 - Yearly, 3 - Quarterly, 4 - One Time
Available options:
1, 2, 3, 4 Required range:
1 <= x <= 4Circular reference to Subscription (not expanded here).
Show child attributes
Show child attributes
Response
Minimum string length:
1Minimum string length:
1Maximum string length:
101 - Unpaid, 2 - Paid, 3 - Partial, 4 - Uncollected, 5 - Refunded, 6 - Uncollectible, 7 - Processing
Available options:
1, 2, 3, 4, 5, 6, 7 Circular reference to Subscription (not expanded here).
Show child attributes
Show child attributes
Maximum string length:
50Maximum string length:
10⌘I