curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
"{ \"object\": \"DiscountTicket\", \"id\": \"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\", \"campaign_code\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\" }"
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket"
payload = "{ \"object\": \"DiscountTicket\", \"id\": \"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\", \"campaign_code\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\" }"
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify('{ "object": "DiscountTicket", "id": "stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0", "campaign_code": "sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16" }')
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket', 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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket",
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('{ "object": "DiscountTicket", "id": "stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0", "campaign_code": "sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16" }'),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket"
payload := strings.NewReader("\"{ \\\"object\\\": \\\"DiscountTicket\\\", \\\"id\\\": \\\"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\\\", \\\"campaign_code\\\": \\\"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\\\" }\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("\"{ \\\"object\\\": \\\"DiscountTicket\\\", \\\"id\\\": \\\"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\\\", \\\"campaign_code\\\": \\\"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\\\" }\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "\"{ \\\"object\\\": \\\"DiscountTicket\\\", \\\"id\\\": \\\"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\\\", \\\"campaign_code\\\": \\\"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\\\" }\""
response = http.request(request)
puts response.read_body"{ \"object\": \"Subscription\", \"id\": \"sub_add_distrib_discos_U1jwG8GK0d3HIb0H8eZJTnTWk8Y\", \"vid\": \"b733b4680bcdfab038564e0796af54f64c9a38c1\", \"created\": \"2021-08-16T10:29:20-07:00\", \"account\": { \"object\": \"Account\", \"id\": \"bh_Qz1PNk14H9BAqul6GkmkZpVk\", \"vid\": \"4a2064f9b75ccb68a80afa95c3418de1a0f7ce94\", \"created\": \"2021-08-16T10:28:53-07:00\", \"email\": \"null@vindicia.com\", \"email_type\": \"html\", \"company\": \"Lorem Ipsum Inc\", \"name\": \"Forest Chump\", \"shipping_address\": { \"object\": \"Address\", \"vid\": \"2d867e434e1ba8f6f5929e98db52eaf3d045f14e\", \"name\": \"Test\", \"line1\": \"11235 Fibonacci St.\", \"city\": \"San Mateo\", \"district\": \"CA\", \"postal_code\": \"94403\", \"country\": \"US\", \"phone\": \"(650) 555-1212x42\" }, \"payment_methods\": { \"object\": \"List\", \"data\": [ { \"object\": \"PaymentMethod\", \"id\": \"pm1_vi_ENAWsUK4ANy0uk6D_24O2FN05Rw\", \"vid\": \"64828ef347915a61ae9ac14dc617c78281182344\", \"created\": \"2021-08-16T10:28:54-07:00\", \"type\": \"CreditCard\", \"credit_card\": { \"object\": \"CreditCard\", \"vid\": \"f375f20ad78940e103035d6d6cb60155996ad807\", \"account\": \"422232XXXXXX8611\", \"bin\": \"422232\", \"last_digits\": \"8611\", \"account_length\": 16, \"expiration_date\": \"202308\", \"last_au_request_date\": null, \"last_update_date\": null }, \"account_holder\": \"pm1_Forest Chump\", \"billing_address\": { \"object\": \"Address\", \"vid\": \"271e21b79ca08a5e4ed597f9e6d5d51433dbcd20\", \"name\": \"Test\", \"line1\": \"11235 Fibonacci St.\", \"city\": \"San Mateo\", \"district\": \"CA\", \"postal_code\": \"94403\", \"country\": \"US\", \"phone\": \"(650) 555-1212x42\" }, \"customer_specified_type\": \"pm1_VI\", \"primary\": true, \"active\": true } ], \"total_count\": 1 } }, \"billing_plan\": { \"object\": \"BillingPlan\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"vid\": \"bd7f8cab7882adec05b9bbc1edd2e962ac1c0bbc\", \"created\": \"2021-08-16T10:28:56-07:00\", \"description\": \"product default plan _trwGb7zhZ8wO7h4Vm9\", \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"periods\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPeriod\", \"type\": \"Day\", \"quantity\": 20, \"cycles\": 0, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 }, \"do_not_notify_first_bill\": false } ], \"total_count\": 1 }, \"skip_initial_billing_notification\": false, \"metadata\": { \"plan name\": \"implicit billing plan\" }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"description\": \"Description for ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\" } ], \"total_count\": 1 }, \"times_to_run\": \"1\", \"used_on_subscriptions\": true }, \"payment_method\": { \"object\": \"PaymentMethod\", \"id\": \"pm1_vi_ENAWsUK4ANy0uk6D_24O2FN05Rw\", \"vid\": \"64828ef347915a61ae9ac14dc617c78281182344\", \"created\": \"2021-08-16T10:28:54-07:00\", \"type\": \"CreditCard\", \"credit_card\": { \"object\": \"CreditCard\", \"vid\": \"f375f20ad78940e103035d6d6cb60155996ad807\", \"account\": \"422232XXXXXX8611\", \"bin\": \"422232\", \"last_digits\": \"8611\", \"account_length\": 16, \"expiration_date\": \"202308\", \"last_au_request_date\": null, \"last_update_date\": null }, \"account_holder\": \"pm1_Forest Chump\", \"billing_address\": { \"object\": \"Address\", \"vid\": \"271e21b79ca08a5e4ed597f9e6d5d51433dbcd20\", \"name\": \"Test\", \"line1\": \"11235 Fibonacci St.\", \"city\": \"San Mateo\", \"district\": \"CA\", \"postal_code\": \"94403\", \"country\": \"US\", \"phone\": \"(650) 555-1212x42\" }, \"customer_specified_type\": \"pm1_VI\", \"primary\": true, \"active\": true }, \"currency\": \"USD\", \"description\": \"sub_add_distrib_discos_U1jwG8GK0d3HIb0H8eZJTnTWk8Y\", \"status\": \"Active\", \"billing_state\": \"Good Standing\", \"starts\": \"2021-08-06T00:00:00-07:00\", \"ends\": \"2021-08-26T00:00:00-07:00\", \"entitled_through\": \"2021-08-26T00:00:00-07:00\", \"items\": { \"object\": \"List\", \"data\": [ { \"object\": \"SubscriptionItem\", \"id\": \"sub_item_Gl_SNy3wb_-Vt9DTQv75lROg96g\", \"vid\": \"3666976cf9dc5d259fd8c68f0801e2f4946d82ac\", \"index\": 0, \"product\": { \"object\": \"Product\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p1\", \"vid\": \"cf40687620af816dc5c0415e79ed247e436a45cc\", \"created\": \"2021-08-16T10:29:01-07:00\", \"descriptions\": { \"object\": \"List\", \"data\": [ { \"object\": \"ProductDescription\", \"language\": \"EN\", \"description\": \"Test Product Description\" } ], \"total_count\": 1 }, \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"default_billing_plan\": { \"object\": \"BillingPlan\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"vid\": \"bd7f8cab7882adec05b9bbc1edd2e962ac1c0bbc\", \"created\": \"2021-08-16T10:28:56-07:00\", \"description\": \"product default plan _trwGb7zhZ8wO7h4Vm9\", \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"periods\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPeriod\", \"type\": \"Day\", \"quantity\": 20, \"cycles\": 0, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 }, \"do_not_notify_first_bill\": false } ], \"total_count\": 1 }, \"skip_initial_billing_notification\": false, \"metadata\": { \"plan name\": \"implicit billing plan\" }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"description\": \"Description for ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\" } ], \"total_count\": 1 }, \"times_to_run\": \"1\", \"used_on_subscriptions\": true }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for prod.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p1\", \"description\": \"Description for ent for prod.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p1\" } ], \"total_count\": 1 }, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"ProductPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 } }, \"quantity\": 1, \"created\": \"2021-08-06T00:00:00-07:00\", \"starts\": \"2021-08-06T00:00:00-07:00\", \"discount_tickets\": { \"object\": \"List\", \"data\": [ { \"object\": \"DiscountTicket\", \"id\": \"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\", \"vid\": \"f0dadeb1aaa15e29785fe980e8e72f8c2554e858\", \"state\": \"Redeemed\", \"added_date\": \"2021-08-16T10:30:39-07:00\", \"start_billing_sequence\": 1, \"campaign_id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_campaign\" } ], \"total_count\": 1 } }, { \"object\": \"SubscriptionItem\", \"id\": \"sub_item_yuvELCKQVo4aL9G6b4ErfD-iuDE\", \"vid\": \"c3752bde85bb81586fe295c5b846e1af7e26564d\", \"index\": 1, \"product\": { \"object\": \"Product\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p3\", \"vid\": \"ca0e9e7483c83930101db84811255ee9f0ad75bc\", \"created\": \"2021-08-16T10:29:06-07:00\", \"descriptions\": { \"object\": \"List\", \"data\": [ { \"object\": \"ProductDescription\", \"language\": \"EN\", \"description\": \"Test Product Description\" } ], \"total_count\": 1 }, \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"default_billing_plan\": { \"object\": \"BillingPlan\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"vid\": \"bd7f8cab7882adec05b9bbc1edd2e962ac1c0bbc\", \"created\": \"2021-08-16T10:28:56-07:00\", \"description\": \"product default plan _trwGb7zhZ8wO7h4Vm9\", \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"periods\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPeriod\", \"type\": \"Day\", \"quantity\": 20, \"cycles\": 0, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 }, \"do_not_notify_first_bill\": false } ], \"total_count\": 1 }, \"skip_initial_billing_notification\": false, \"metadata\": { \"plan name\": \"implicit billing plan\" }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"description\": \"Description for ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\" } ], \"total_count\": 1 }, \"times_to_run\": \"1\", \"used_on_subscriptions\": true }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for prod.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p3\", \"description\": \"Description for ent for prod.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p3\" } ], \"total_count\": 1 }, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"ProductPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 } }, \"quantity\": 1, \"created\": \"2021-08-06T00:00:00-07:00\", \"starts\": \"2021-08-06T00:00:00-07:00\", \"discount_tickets\": { \"object\": \"List\", \"data\": [], \"total_count\": 0 } } ], \"total_count\": 2 }, \"billing_day\": 26, \"minimum_commitment\": 3, \"notify_on_transition\": false, \"next_billing\": { \"object\": \"Transaction\", \"created\": \"2021-08-26T00:00:00-07:00\", \"amount\": 56, \"currency\": \"USD\", \"items\": { \"object\": \"List\", \"data\": [ { \"object\": \"TransactionItem\", \"sku\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p1\", \"item_type\": \"Purchase\", \"name\": \"Test Product Description\", \"price\": 56, \"quantity\": 1, \"tax_classification\": \"TaxExempt\", \"tax_type\": \"Exclusive Sales\", \"item_refunds\": { \"object\": \"List\", \"data\": [], \"total_count\": 0 }, \"subtotal\": 56, \"total\": 56 } ], \"total_count\": 1 }, \"subscription_sequence\": 2 }, \"balance\": 0, \"billing_plan_discount_tickets\": { \"object\": \"List\", \"data\": [ { \"object\": \"DiscountTicket\", \"id\": \"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\", \"vid\": \"a653fa3a1ba153ae5a57a865d2a09a0f9f124d84\", \"state\": \"Redeemed\", \"added_date\": \"2021-08-16T10:30:39-07:00\", \"start_billing_sequence\": 1, \"campaign_id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_campaign\" } ], \"total_count\": 1 } }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"Route is not available for Merchant Configuration\" }""{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Add DiscountTicket to a Subscription
Add DiscountTicket to a Subscription. Only supported for Stackable Discounts.
curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
"{ \"object\": \"DiscountTicket\", \"id\": \"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\", \"campaign_code\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\" }"
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket"
payload = "{ \"object\": \"DiscountTicket\", \"id\": \"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\", \"campaign_code\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\" }"
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify('{ "object": "DiscountTicket", "id": "stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0", "campaign_code": "sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16" }')
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket', 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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket",
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('{ "object": "DiscountTicket", "id": "stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0", "campaign_code": "sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16" }'),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket"
payload := strings.NewReader("\"{ \\\"object\\\": \\\"DiscountTicket\\\", \\\"id\\\": \\\"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\\\", \\\"campaign_code\\\": \\\"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\\\" }\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("\"{ \\\"object\\\": \\\"DiscountTicket\\\", \\\"id\\\": \\\"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\\\", \\\"campaign_code\\\": \\\"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\\\" }\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/subscriptions/{ID}/actions/add_discount_ticket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "\"{ \\\"object\\\": \\\"DiscountTicket\\\", \\\"id\\\": \\\"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\\\", \\\"campaign_code\\\": \\\"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_modify_campaign_2021-08-16\\\" }\""
response = http.request(request)
puts response.read_body"{ \"object\": \"Subscription\", \"id\": \"sub_add_distrib_discos_U1jwG8GK0d3HIb0H8eZJTnTWk8Y\", \"vid\": \"b733b4680bcdfab038564e0796af54f64c9a38c1\", \"created\": \"2021-08-16T10:29:20-07:00\", \"account\": { \"object\": \"Account\", \"id\": \"bh_Qz1PNk14H9BAqul6GkmkZpVk\", \"vid\": \"4a2064f9b75ccb68a80afa95c3418de1a0f7ce94\", \"created\": \"2021-08-16T10:28:53-07:00\", \"email\": \"null@vindicia.com\", \"email_type\": \"html\", \"company\": \"Lorem Ipsum Inc\", \"name\": \"Forest Chump\", \"shipping_address\": { \"object\": \"Address\", \"vid\": \"2d867e434e1ba8f6f5929e98db52eaf3d045f14e\", \"name\": \"Test\", \"line1\": \"11235 Fibonacci St.\", \"city\": \"San Mateo\", \"district\": \"CA\", \"postal_code\": \"94403\", \"country\": \"US\", \"phone\": \"(650) 555-1212x42\" }, \"payment_methods\": { \"object\": \"List\", \"data\": [ { \"object\": \"PaymentMethod\", \"id\": \"pm1_vi_ENAWsUK4ANy0uk6D_24O2FN05Rw\", \"vid\": \"64828ef347915a61ae9ac14dc617c78281182344\", \"created\": \"2021-08-16T10:28:54-07:00\", \"type\": \"CreditCard\", \"credit_card\": { \"object\": \"CreditCard\", \"vid\": \"f375f20ad78940e103035d6d6cb60155996ad807\", \"account\": \"422232XXXXXX8611\", \"bin\": \"422232\", \"last_digits\": \"8611\", \"account_length\": 16, \"expiration_date\": \"202308\", \"last_au_request_date\": null, \"last_update_date\": null }, \"account_holder\": \"pm1_Forest Chump\", \"billing_address\": { \"object\": \"Address\", \"vid\": \"271e21b79ca08a5e4ed597f9e6d5d51433dbcd20\", \"name\": \"Test\", \"line1\": \"11235 Fibonacci St.\", \"city\": \"San Mateo\", \"district\": \"CA\", \"postal_code\": \"94403\", \"country\": \"US\", \"phone\": \"(650) 555-1212x42\" }, \"customer_specified_type\": \"pm1_VI\", \"primary\": true, \"active\": true } ], \"total_count\": 1 } }, \"billing_plan\": { \"object\": \"BillingPlan\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"vid\": \"bd7f8cab7882adec05b9bbc1edd2e962ac1c0bbc\", \"created\": \"2021-08-16T10:28:56-07:00\", \"description\": \"product default plan _trwGb7zhZ8wO7h4Vm9\", \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"periods\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPeriod\", \"type\": \"Day\", \"quantity\": 20, \"cycles\": 0, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 }, \"do_not_notify_first_bill\": false } ], \"total_count\": 1 }, \"skip_initial_billing_notification\": false, \"metadata\": { \"plan name\": \"implicit billing plan\" }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"description\": \"Description for ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\" } ], \"total_count\": 1 }, \"times_to_run\": \"1\", \"used_on_subscriptions\": true }, \"payment_method\": { \"object\": \"PaymentMethod\", \"id\": \"pm1_vi_ENAWsUK4ANy0uk6D_24O2FN05Rw\", \"vid\": \"64828ef347915a61ae9ac14dc617c78281182344\", \"created\": \"2021-08-16T10:28:54-07:00\", \"type\": \"CreditCard\", \"credit_card\": { \"object\": \"CreditCard\", \"vid\": \"f375f20ad78940e103035d6d6cb60155996ad807\", \"account\": \"422232XXXXXX8611\", \"bin\": \"422232\", \"last_digits\": \"8611\", \"account_length\": 16, \"expiration_date\": \"202308\", \"last_au_request_date\": null, \"last_update_date\": null }, \"account_holder\": \"pm1_Forest Chump\", \"billing_address\": { \"object\": \"Address\", \"vid\": \"271e21b79ca08a5e4ed597f9e6d5d51433dbcd20\", \"name\": \"Test\", \"line1\": \"11235 Fibonacci St.\", \"city\": \"San Mateo\", \"district\": \"CA\", \"postal_code\": \"94403\", \"country\": \"US\", \"phone\": \"(650) 555-1212x42\" }, \"customer_specified_type\": \"pm1_VI\", \"primary\": true, \"active\": true }, \"currency\": \"USD\", \"description\": \"sub_add_distrib_discos_U1jwG8GK0d3HIb0H8eZJTnTWk8Y\", \"status\": \"Active\", \"billing_state\": \"Good Standing\", \"starts\": \"2021-08-06T00:00:00-07:00\", \"ends\": \"2021-08-26T00:00:00-07:00\", \"entitled_through\": \"2021-08-26T00:00:00-07:00\", \"items\": { \"object\": \"List\", \"data\": [ { \"object\": \"SubscriptionItem\", \"id\": \"sub_item_Gl_SNy3wb_-Vt9DTQv75lROg96g\", \"vid\": \"3666976cf9dc5d259fd8c68f0801e2f4946d82ac\", \"index\": 0, \"product\": { \"object\": \"Product\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p1\", \"vid\": \"cf40687620af816dc5c0415e79ed247e436a45cc\", \"created\": \"2021-08-16T10:29:01-07:00\", \"descriptions\": { \"object\": \"List\", \"data\": [ { \"object\": \"ProductDescription\", \"language\": \"EN\", \"description\": \"Test Product Description\" } ], \"total_count\": 1 }, \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"default_billing_plan\": { \"object\": \"BillingPlan\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"vid\": \"bd7f8cab7882adec05b9bbc1edd2e962ac1c0bbc\", \"created\": \"2021-08-16T10:28:56-07:00\", \"description\": \"product default plan _trwGb7zhZ8wO7h4Vm9\", \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"periods\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPeriod\", \"type\": \"Day\", \"quantity\": 20, \"cycles\": 0, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 }, \"do_not_notify_first_bill\": false } ], \"total_count\": 1 }, \"skip_initial_billing_notification\": false, \"metadata\": { \"plan name\": \"implicit billing plan\" }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"description\": \"Description for ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\" } ], \"total_count\": 1 }, \"times_to_run\": \"1\", \"used_on_subscriptions\": true }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for prod.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p1\", \"description\": \"Description for ent for prod.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p1\" } ], \"total_count\": 1 }, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"ProductPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 } }, \"quantity\": 1, \"created\": \"2021-08-06T00:00:00-07:00\", \"starts\": \"2021-08-06T00:00:00-07:00\", \"discount_tickets\": { \"object\": \"List\", \"data\": [ { \"object\": \"DiscountTicket\", \"id\": \"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\", \"vid\": \"f0dadeb1aaa15e29785fe980e8e72f8c2554e858\", \"state\": \"Redeemed\", \"added_date\": \"2021-08-16T10:30:39-07:00\", \"start_billing_sequence\": 1, \"campaign_id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_campaign\" } ], \"total_count\": 1 } }, { \"object\": \"SubscriptionItem\", \"id\": \"sub_item_yuvELCKQVo4aL9G6b4ErfD-iuDE\", \"vid\": \"c3752bde85bb81586fe295c5b846e1af7e26564d\", \"index\": 1, \"product\": { \"object\": \"Product\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p3\", \"vid\": \"ca0e9e7483c83930101db84811255ee9f0ad75bc\", \"created\": \"2021-08-16T10:29:06-07:00\", \"descriptions\": { \"object\": \"List\", \"data\": [ { \"object\": \"ProductDescription\", \"language\": \"EN\", \"description\": \"Test Product Description\" } ], \"total_count\": 1 }, \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"default_billing_plan\": { \"object\": \"BillingPlan\", \"id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"vid\": \"bd7f8cab7882adec05b9bbc1edd2e962ac1c0bbc\", \"created\": \"2021-08-16T10:28:56-07:00\", \"description\": \"product default plan _trwGb7zhZ8wO7h4Vm9\", \"status\": \"Active\", \"tax_classification\": \"TaxExempt\", \"br_tax_category\": \"Services\", \"periods\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPeriod\", \"type\": \"Day\", \"quantity\": 20, \"cycles\": 0, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"BillingPlanPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 }, \"do_not_notify_first_bill\": false } ], \"total_count\": 1 }, \"skip_initial_billing_notification\": false, \"metadata\": { \"plan name\": \"implicit billing plan\" }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\", \"description\": \"Description for ent for bp.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_day20\" } ], \"total_count\": 1 }, \"times_to_run\": \"1\", \"used_on_subscriptions\": true }, \"entitlements\": { \"object\": \"List\", \"data\": [ { \"object\": \"Entitlement\", \"id\": \"ent for prod.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p3\", \"description\": \"Description for ent for prod.id=sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p3\" } ], \"total_count\": 1 }, \"prices\": { \"object\": \"List\", \"data\": [ { \"object\": \"ProductPrice\", \"amount\": 20, \"currency\": \"USD\" } ], \"total_count\": 1 } }, \"quantity\": 1, \"created\": \"2021-08-06T00:00:00-07:00\", \"starts\": \"2021-08-06T00:00:00-07:00\", \"discount_tickets\": { \"object\": \"List\", \"data\": [], \"total_count\": 0 } } ], \"total_count\": 2 }, \"billing_day\": 26, \"minimum_commitment\": 3, \"notify_on_transition\": false, \"next_billing\": { \"object\": \"Transaction\", \"created\": \"2021-08-26T00:00:00-07:00\", \"amount\": 56, \"currency\": \"USD\", \"items\": { \"object\": \"List\", \"data\": [ { \"object\": \"TransactionItem\", \"sku\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_p1\", \"item_type\": \"Purchase\", \"name\": \"Test Product Description\", \"price\": 56, \"quantity\": 1, \"tax_classification\": \"TaxExempt\", \"tax_type\": \"Exclusive Sales\", \"item_refunds\": { \"object\": \"List\", \"data\": [], \"total_count\": 0 }, \"subtotal\": 56, \"total\": 56 } ], \"total_count\": 1 }, \"subscription_sequence\": 2 }, \"balance\": 0, \"billing_plan_discount_tickets\": { \"object\": \"List\", \"data\": [ { \"object\": \"DiscountTicket\", \"id\": \"stab1_HOLc_uPe-xfJI7G3YAOzNJYidy0\", \"vid\": \"a653fa3a1ba153ae5a57a865d2a09a0f9f124d84\", \"state\": \"Redeemed\", \"added_date\": \"2021-08-16T10:30:39-07:00\", \"start_billing_sequence\": 1, \"campaign_id\": \"sadtdst_d2_RXX1h6g9ImLi6SKKRE4VkeaI46A_campaign\" } ], \"total_count\": 1 } }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"Route is not available for Merchant Configuration\" }""{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The id, or the vid of the Account A unique identifier. Optionally, this object can also be identified by its vid. Using a unique custom identifier is strongly encouraged.
128Query Parameters
The Product id or vid to filter Events by. A unique identifier. Optionally, this object can also be identified by its vid. Using a unique custom identifier is strongly encouraged.
128ID or VID of SubscriptionItem that DiscountTicket should be applied to. A unique identifier. Optionally, this object can also be identified by its vid. Using a unique custom identifier is strongly encouraged.
128Indicates whether to commit changes or return results without execution
SubscriptionItem, BillingPlan, Distributed Replace, Insert, Add Body
JSON A full discountTicket object.
Value is "DiscountTicket"
Redemption string (CampaignCode.id) which will be redeemed to create DiscountTicket. Only supported for Stackable Discounts.
Optional Merchant-supplied identifier for this a DiscountTicket. Only supported for Stackable Discounts.
A Globally Unique Identifier (GUID) for this object. Assigned by CashBox. Only supported for Stackable Discounts.
128Read-only field indicating DiscountTicket state. Only supported for Stackable Discounts.
PreDisco2, Unredeemed, RedemptionFailed, Redeemed, Active, Inactive Read-only field indicating date that DiscountTicket was added. Only supported for Stackable Discounts.
Read-only field indicating date that DiscountTicket was removed. Only supported for Stackable Discounts.
Read-only field indicating date that DiscountTicket Inactive date. Only supported for Stackable Discounts.
Subscription sequence when DiscountTicket is to start. Only supported for Stackable Discounts.
Read-only attribute indicating Subscription sequence when DiscountTicket will cease to be active. Only supported for Stackable Discounts.
Id of the DiscountTicket that this DiscountTicket will follow. Only supported for Stackable Discounts.
VID of the DiscountTicket that this DiscountTicket will follow. Only supported for Stackable Discounts.
Read-only field containing the unique identifier for the Campaign associated with this DiscountTicket. Only supported for Stackable Discounts.
Only supported for Stackable Discounts.
Response
JSON A full Subscription object.
Value is "Subscription".
Subscription A unique identifier. Optionally, this object can also be identified by its vid. Using a unique custom identifier is strongly encouraged.
128The Account represents a merchant’s customer. As such it can contain as much or as little information as you collect about the customers (people or organizations) to which you offer billing and subscriptions. Subscriptions and Transactions must belong to an Account - as such, Accounts will be required in CashBox for billing. Read More in our User Guide
An Account can have any number of children accounts and may have up to one parent account. Read more in our User Guide.
An Account owns the “on file” payment methods to be used by it in billing.
Show child attributes
Show child attributes
The status of the subscription from a service and entitlement perspective.
Pending Activation, Active, Pending Cancel, Cancelled, Expired, Processing, Deleted, Dryrun, Unknown, Upgraded, Legacy Suspended, Bogus AutoBill Status The product-based line items for the subscription.
Show child attributes
Show child attributes
A Globally Unique Identifier (GUID) for this object. This value is generated by Vindicia.
128The date/time at which the subscription was requested.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The financial state of the subscription.
Free/Trial, Billing Completed, Failed To Collect, Free Period, Bogus BillingState The date/time the subscription starts service.
The date/time the subscription ends service.
The date/time to which the subscription will entitle service if no further payments are made – a “paid thru” date based on billing schedule and grace period.
Optional source IP Address at sign-up.
Optional “soft descriptor” to send to the payment processor for transactions from this subscription.
The day of the month on which the subscription is (typically) billed. Often called an “anniversary date.”
Number of billing cycles customer is obligated to maintain the subscription. Cancelling before this time requires CSP to “force” cancellation.
Affiliate or channel identifier, if any, under which the subscription was submitted.
A more granular or subordinate affiliate identifier.
Indicates whether to send an expiration or trial-end email notification using the days-in-advance configuration in the Billing Plan.
The Transaction object provides a way to charge a customer. You can create one-time transactions, retrieve individual transactions, fetch individual transactions, and list all Transactions for a given account or subscription. Posting with a new Transaction creates a new one-time Transaction object. If “to_be_captured” is false, the request will trigger an authorization attempt (based on the provided payment method’s authorization process). If successfully authorized, a subsequent post to the transaction’s actions/capture endpoint will capture the authorized transaction. If you post a new transaction with “to_be_captured” true, it will authorize and immediately capture the transaction if successful. To refund transactions, use the refunds endpoint.
Show child attributes
Show child attributes
A list of any refunds associated with the Transaction in most_recent_billing.
Show child attributes
Show child attributes
The Transaction object provides a way to charge a customer. You can create one-time transactions, retrieve individual transactions, fetch individual transactions, and list all Transactions for a given account or subscription. Posting with a new Transaction creates a new one-time Transaction object. If “to_be_captured” is false, the request will trigger an authorization attempt (based on the provided payment method’s authorization process). If successfully authorized, a subsequent post to the transaction’s actions/capture endpoint will capture the authorized transaction. If you post a new transaction with “to_be_captured” true, it will authorize and immediately capture the transaction if successful. To refund transactions, use the refunds endpoint.
Show child attributes
Show child attributes
A set of key/value pairs that you can attach to an object. Useful for storing additional information. Subscription metadata will be inherited by resulting transactions.
The Credit object represents a service credit granted to an account or subscription, taking the form of either currency, token, or time amounts.
Show child attributes
Show child attributes
Instructions for if/how to include the invoice statement for this subscription. Values can be Attachment, DoNotSend,Inline
Attachment, DoNotSend, Inline Net Terms (in days); after this many days from a billing, the invoice will be considered delinquent.
Days before scheduled billing to deliver the statement.
Template to use for statement generation.
The Campaign code redeemed on this AutoBill against the price of the Billing Plan. To apply a Campaign, use this field to pass in a valid Coupon or Promotion code. Note This data member will not be returned. Only supported for Single Discount.
The unique identifier for a Campaign applied to this AutoBill’s BillingPlan. This is a read-only field returned by Vindicia for informational purposes. Values sent in with a SOAP call will be ignored. Read only. Only supported for Single Discount.
Used to create a Subscription Pending Activation.
The mandates object represents the end-custom approval for a one-time or recurring billing using their provided bank account details. A common requirement for UK and SEPA direct debit payment methods.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The policy object governing Subscription behavior.
Show child attributes
Show child attributes
Only supported for Stackable Discounts.
Show child attributes
Show child attributes

