curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/charges \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
"{ \"subscription\": \"Subscription_1668515158\", \"description\": \"Creates a new non-recurring pending charge on a given Subscription\", \"tax_classification\": \"TaxExempt\", \"amount\": 10 }"
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/charges"
payload = "{ \"subscription\": \"Subscription_1668515158\", \"description\": \"Creates a new non-recurring pending charge on a given Subscription\", \"tax_classification\": \"TaxExempt\", \"amount\": 10 }"
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('{ "subscription": "Subscription_1668515158", "description": "Creates a new non-recurring pending charge on a given Subscription", "tax_classification": "TaxExempt", "amount": 10 }')
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/charges', 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/charges",
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('{ "subscription": "Subscription_1668515158", "description": "Creates a new non-recurring pending charge on a given Subscription", "tax_classification": "TaxExempt", "amount": 10 }'),
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/charges"
payload := strings.NewReader("\"{ \\\"subscription\\\": \\\"Subscription_1668515158\\\", \\\"description\\\": \\\"Creates a new non-recurring pending charge on a given Subscription\\\", \\\"tax_classification\\\": \\\"TaxExempt\\\", \\\"amount\\\": 10 }\"")
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/charges")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("\"{ \\\"subscription\\\": \\\"Subscription_1668515158\\\", \\\"description\\\": \\\"Creates a new non-recurring pending charge on a given Subscription\\\", \\\"tax_classification\\\": \\\"TaxExempt\\\", \\\"amount\\\": 10 }\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/charges")
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 = "\"{ \\\"subscription\\\": \\\"Subscription_1668515158\\\", \\\"description\\\": \\\"Creates a new non-recurring pending charge on a given Subscription\\\", \\\"tax_classification\\\": \\\"TaxExempt\\\", \\\"amount\\\": 10 }\""
response = http.request(request)
puts response.read_body"{ \"object\": \"Charge\", \"vid\": \"e95d8a532703a23fdba8de65f7e9f51c96585229\", \"subscription\": { \"object\": \"Subscription\", \"id\": \"Subscription_1668515158\", \"vid\": \"1c4d821989b642819154b0a63e869e0a5a3d8c3a\" }, \"invoice\": { \"object\": \"Invoice\", \"id\": \"Subscription_1668515158-00000001\", \"vid\": \"3efab685abab6522b122f81c8b233e2b0d89cb29\", \"billing_service_period_start\": \"2022-11-21T00:00:00+00:00\", \"billing_service_period_end\": \"2022-12-20T16:00:00+00:00\", \"due_date\": \"2022-11-21T00:00:00+00:00\", \"invoice_date\": \"2022-11-21T00:00:00+00:00\", \"status\": \"Open\", \"invoice_currency\": \"USD\", \"credit_total\": 0, \"payments_received_total\": 0, \"invoice_line_items\": { \"object\": \"List\", \"data\": [ { \"object\": \"InvoiceItem\", \"index_number\": 0, \"type\": \"NonRecurringCharge\", \"sku\": null, \"description\": \"sample charges\", \"quantity\": 1, \"unit_amount\": 10, \"tax_classification\": \"TaxExempt\", \"item_added\": \"2022-11-15T12:28:51+00:00\", \"item_removed\": null, \"item_serviceperiod_start\": \"2022-11-15T12:28:51+00:00\", \"item_serviceperiod_end\": \"2022-12-20T16:00:00+00:00\" }, { \"object\": \"InvoiceItem\", \"index_number\": 1, \"type\": \"NonRecurringCharge\", \"sku\": null, \"description\": \"Creates a new non-recurring pending charge on a given Subscription\", \"quantity\": 1, \"unit_amount\": 10, \"tax_classification\": \"TaxExempt\", \"item_added\": \"2022-11-15T12:31:19+00:00\", \"item_removed\": null, \"item_serviceperiod_start\": \"2022-11-15T12:31:19+00:00\", \"item_serviceperiod_end\": \"2022-12-20T16:00:00+00:00\" } ], \"total_count\": 2 }, \"account\": { \"object\": \"Account\", \"id\": \"Account_1668515158\", \"vid\": \"1e6baf3641accde929c7a2526c05ed84680b0fae\" }, \"subscription\": { \"object\": \"Subscription\", \"id\": \"Subscription_1668515158\", \"vid\": \"1c4d821989b642819154b0a63e869e0a5a3d8c3a\" }, \"billing_sequence\": 1 }, \"description\": \"Creates a new non-recurring pending charge on a given Subscription\", \"tax_classification\": \"TaxExempt\", \"amount\": 10, \"currency\": \"USD\", \"quantity\": 1 }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Create a Pending Charge
Creates a new non-recurring pending charge on a given Subscription or Invoice.
Note: Do not change the established currency type.
curl --request POST \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/charges \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
"{ \"subscription\": \"Subscription_1668515158\", \"description\": \"Creates a new non-recurring pending charge on a given Subscription\", \"tax_classification\": \"TaxExempt\", \"amount\": 10 }"
'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/charges"
payload = "{ \"subscription\": \"Subscription_1668515158\", \"description\": \"Creates a new non-recurring pending charge on a given Subscription\", \"tax_classification\": \"TaxExempt\", \"amount\": 10 }"
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('{ "subscription": "Subscription_1668515158", "description": "Creates a new non-recurring pending charge on a given Subscription", "tax_classification": "TaxExempt", "amount": 10 }')
};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/charges', 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/charges",
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('{ "subscription": "Subscription_1668515158", "description": "Creates a new non-recurring pending charge on a given Subscription", "tax_classification": "TaxExempt", "amount": 10 }'),
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/charges"
payload := strings.NewReader("\"{ \\\"subscription\\\": \\\"Subscription_1668515158\\\", \\\"description\\\": \\\"Creates a new non-recurring pending charge on a given Subscription\\\", \\\"tax_classification\\\": \\\"TaxExempt\\\", \\\"amount\\\": 10 }\"")
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/charges")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("\"{ \\\"subscription\\\": \\\"Subscription_1668515158\\\", \\\"description\\\": \\\"Creates a new non-recurring pending charge on a given Subscription\\\", \\\"tax_classification\\\": \\\"TaxExempt\\\", \\\"amount\\\": 10 }\"")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/charges")
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 = "\"{ \\\"subscription\\\": \\\"Subscription_1668515158\\\", \\\"description\\\": \\\"Creates a new non-recurring pending charge on a given Subscription\\\", \\\"tax_classification\\\": \\\"TaxExempt\\\", \\\"amount\\\": 10 }\""
response = http.request(request)
puts response.read_body"{ \"object\": \"Charge\", \"vid\": \"e95d8a532703a23fdba8de65f7e9f51c96585229\", \"subscription\": { \"object\": \"Subscription\", \"id\": \"Subscription_1668515158\", \"vid\": \"1c4d821989b642819154b0a63e869e0a5a3d8c3a\" }, \"invoice\": { \"object\": \"Invoice\", \"id\": \"Subscription_1668515158-00000001\", \"vid\": \"3efab685abab6522b122f81c8b233e2b0d89cb29\", \"billing_service_period_start\": \"2022-11-21T00:00:00+00:00\", \"billing_service_period_end\": \"2022-12-20T16:00:00+00:00\", \"due_date\": \"2022-11-21T00:00:00+00:00\", \"invoice_date\": \"2022-11-21T00:00:00+00:00\", \"status\": \"Open\", \"invoice_currency\": \"USD\", \"credit_total\": 0, \"payments_received_total\": 0, \"invoice_line_items\": { \"object\": \"List\", \"data\": [ { \"object\": \"InvoiceItem\", \"index_number\": 0, \"type\": \"NonRecurringCharge\", \"sku\": null, \"description\": \"sample charges\", \"quantity\": 1, \"unit_amount\": 10, \"tax_classification\": \"TaxExempt\", \"item_added\": \"2022-11-15T12:28:51+00:00\", \"item_removed\": null, \"item_serviceperiod_start\": \"2022-11-15T12:28:51+00:00\", \"item_serviceperiod_end\": \"2022-12-20T16:00:00+00:00\" }, { \"object\": \"InvoiceItem\", \"index_number\": 1, \"type\": \"NonRecurringCharge\", \"sku\": null, \"description\": \"Creates a new non-recurring pending charge on a given Subscription\", \"quantity\": 1, \"unit_amount\": 10, \"tax_classification\": \"TaxExempt\", \"item_added\": \"2022-11-15T12:31:19+00:00\", \"item_removed\": null, \"item_serviceperiod_start\": \"2022-11-15T12:31:19+00:00\", \"item_serviceperiod_end\": \"2022-12-20T16:00:00+00:00\" } ], \"total_count\": 2 }, \"account\": { \"object\": \"Account\", \"id\": \"Account_1668515158\", \"vid\": \"1e6baf3641accde929c7a2526c05ed84680b0fae\" }, \"subscription\": { \"object\": \"Subscription\", \"id\": \"Subscription_1668515158\", \"vid\": \"1c4d821989b642819154b0a63e869e0a5a3d8c3a\" }, \"billing_sequence\": 1 }, \"description\": \"Creates a new non-recurring pending charge on a given Subscription\", \"tax_classification\": \"TaxExempt\", \"amount\": 10, \"currency\": \"USD\", \"quantity\": 1 }""{ \"object\": \"Error\", \"message\": \"JSON is invalid\" }"{
"code": "<string>",
"message": "<string>"
}"{ \"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.
Query Parameters
Boolean flag that, if set to true, will return the updated Subscription, without recording the result in the Subscribe database.
Optional Coupon or Promotion Code, used to obtain a discount on this charge.
Body
JSON A full Time Charge object.
Value is “Charge”
Charge A Globally Unique Identifier (GUID) for this object. This value is generated by Vindicia.
128The subscription to which this addition applies
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A description of the charge. This is a free-form string of 256 or fewer characters.
Product used to determine charge amount added to Subscription.
Show child attributes
Show child attributes
Tax classification for charge. This field is required UNLESS the price is to be based on the Product, (in which case the tax classification can be based on the associated Product tax classification.
Amount to charge. This field is required UNLESS the price is to be based on the Product.
ISO 4217 currency code for amount. Either token, OR currency must be specified.
Currency Token associated with amount (if this is a Token-based Subscription). Either token, OR currency must be specified.
Show child attributes
Show child attributes
Optional value to be included in charge. Defaults to 1, if not specified.
Calculated discount amount. Only supported for Stackable Discounts.
Calculated subtotal. This is considered to be the taxable amount. Only supported for Stackable Discounts.
Calculated tax total. Only supported for Stackable Discounts.
Calculated total amount which includes subtotal, tax and discounts. Only supported for Stackable Discounts.
Only supported for Stackable Discounts.
Show child attributes
Show child attributes
Input list of DiscountTickets to apply to this Charge.. Only supported for Stackable Discounts.
Show child attributes
Show child attributes
Response
JSON A full Charge object.
Value is “Charge”
Charge A Globally Unique Identifier (GUID) for this object. This value is generated by Vindicia.
128The subscription to which this addition applies
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A description of the charge. This is a free-form string of 256 or fewer characters.
Product used to determine charge amount added to Subscription.
Show child attributes
Show child attributes
Tax classification for charge. This field is required UNLESS the price is to be based on the Product, (in which case the tax classification can be based on the associated Product tax classification.
Amount to charge. This field is required UNLESS the price is to be based on the Product.
ISO 4217 currency code for amount. Either token, OR currency must be specified.
Currency Token associated with amount (if this is a Token-based Subscription). Either token, OR currency must be specified.
Show child attributes
Show child attributes
Optional value to be included in charge. Defaults to 1, if not specified.
Calculated discount amount. Only supported for Stackable Discounts.
Calculated subtotal. This is considered to be the taxable amount. Only supported for Stackable Discounts.
Calculated tax total. Only supported for Stackable Discounts.
Calculated total amount which includes subtotal, tax and discounts. Only supported for Stackable Discounts.
Only supported for Stackable Discounts.
Show child attributes
Show child attributes
Input list of DiscountTickets to apply to this Charge.. Only supported for Stackable Discounts.
Show child attributes
Show child attributes

