Discount
Version: 1.33
Use the entity Discount to apply a discounted price to an order-able item, a Product during the Order, or to generate an Order.
Query Discount directly. Discount can also be queried and used within DiscountCode.
Gotransverse assigns all Discounts a unique entity ID (eid) number. The eid number is not seen or accessible in Gotransverse. All entities in Gotransverse have an eid number. If needed, refer to the following related API entities:
-
DiscountCategory is used with the Discount.
-
DiscountCategoryStatus defines the status of the DiscountCategory.
-
DiscountChargeCategory is one of the types of Charge Categories.
-
DiscountCode is the code for the Discount.
-
DiscountCodeStatus defines the status of the DiscountCode.
-
DiscountIdentifier is REQUIRED for any Discount. The DiscountIdentifier is used during the Order process through the API to receive a discount on the Order.
-
DiscountIdentifierStatus defines the status of the DiscountIdentifier.
-
DiscountStatus defines the status of the Discount.
-
DiscountType defines the type of the Discount.
-
AddDiscountIdentifierToService is the command to add a DiscountIdentifier to an existing Service on a Customer's BillingAccount.
You cannot create Discounts through the API, only query and use them.
Perform through Gotransverse
-
CREATE the Discounts.
-
View the list of Discounts.
-
Select and use the Discount.
Perform through the API
-
Query and view the list of Discounts.
-
Select and use the Discount.
Parameters
When you query a Discount, the following table provides information about the values returned from the query:
Element Name | Query Key | Element Type | Field Length | Description |
---|---|---|---|---|
queryScope |
QueryScope |
- - |
Whether default query results are overridden by QueryScope resulting in SHALLOW or DEEP query results. Refer to QueryScope for details. |
|
eid |
Y |
Long |
System Generated |
System generated unique identity number assigned to the Discount. |
name |
Y |
String |
255 |
The name of the Discount. |
status |
Y |
oi |
- - |
The status of the Discount. See DiscountStatus. |
description |
String |
255 |
Optional. The description of the Discount. |
|
type |
Y |
DiscountType |
- - |
The type of the Discount. See DiscountType. |
amount |
Decimal |
as needed |
The amount of the Discount. |
|
currecyType |
Y |
CurrencyType |
- - |
They type of Currency. See CurrencyType. |
percentage |
Decimal |
as needed |
The percentage of the Discount. |
|
duration |
Integer
|
as needed |
The number of service periods to which the Discount applies. |
|
oneTime |
Y |
Boolean |
Enter either: "true" (Yes) or "false" (No) |
Is this Discount ON the one-time charge or not? YES — This Discount is on the one-time charge. NO — This Discount is NOT on the one-time charge. |
recurring |
Y |
Boolean |
Enter either: "true" (Yes) or "false" (No) |
Is this Discount ON the recurring charge or not? YES — This Discount is on the recurring charge. NO — This Discount is NOT on the recurring charge. |
amountOverride |
Boolean |
Enter either: "true" (Yes) or "false" (No) |
Does this Discount override an amount or not? YES — This Discount overrides the amount. NO — Tthis Discount does NOT override the amount. |
|
durationOverride |
Boolean |
Enter either: |
Does this Discount have a duration or not? YES — This Discount has a duration. NO — This Discount does NOT have a duration. |
Entity Discounts
The entity Discounts enables you to see multiple pages of the entity Discount.
Element Name | Element Type | Field Length | Description | ||
---|---|---|---|---|---|
pageNumber |
Integer |
as needed |
Shows the current page number. |
||
pageSize |
Integer |
as needed |
Shows the page size. |
||
totalElements |
Long |
as needed |
Shows the total number of items found. |
||
elementCount |
Integer |
as needed |
Shows the current count of the item in the number of items that were found. |
||
totalPages |
Integer |
as needed |
Shows the total number of pages. |
||
discount |
Discount |
- - |
Shows the list of Discounts. |
Information for the related entity of Discounts:
-
Entity Discounts
Query a Discount
Query Key Information SOAP and REST
To query for all Discounts, use the SimpleDataQuery with no parameters.
Query to Use | Query for | Returns | |||
---|---|---|---|---|---|
SimpleDataQuery |
Discount |
Complete information for all of your Discounts. |
To query for more specific information, use the SimpleDataQuery with the parameter of one of the following Query Keys:
Query Key | Value | Definition | |||
---|---|---|---|---|---|
eid |
Long |
The unique eid number for the Discount. |
|||
name |
String |
The name of the Discount. |
|||
status |
The DiscountStatus of the Discount. |
||||
type |
The DiscountType of the Discount. |
||||
discountCategoryEid |
Long |
The DiscountCategory of the Discount. |
|||
oneTime |
Boolean |
Whether the Discount is on the OneTime price or not. |
|||
recurring |
Boolean |
Whether the Discount is on the recurring price or not. |
|||
currencyType |
Currency |
The type of currency. |
Unknown Query Key Information
If you do not know the Discount's eid, name, status, type, discountCategoryEid, or other parameters, or you want to see all Discounts (incrememts of 50):
Query to Use | Query for | Returns | |||
---|---|---|---|---|---|
SimpleDataQuery |
Discount |
List of all of your Discounts. |
SOAP Example Query and Response
The following SOAP example is a query of Discount:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:ser="http://www.tractbilling.com/billing/1_31/service"> <soapenv:Header/> <soapenv:Body> <ser:query> <ser:queryRequest> <dom:simpleDataQuery> <dom:type>Discount</dom:type> </dom:simpleDataQuery> </ser:queryRequest> </ser:query> </soapenv:Body> </soapenv:Envelope>
This was the response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:queryResponse xmlns="http://www.tractbilling.com/billing/1_31/domain" xmlns:ns2="http://www.tractbilling.com/billing/1_31/service"> <ns2:return successful="true"> <discounts pageNumber="1" pageSize="50" totalElements="1" elementCount="1" totalPages="1"> <discount name="January Discount" status="DRAFT" description="Early January discount. Usually between Jan 2 - Jan 15 (between New Year's and MLK Day)." type="PERCENTAGE" percentage="0.40000" duration="1" oneTime="false" recurring="true" eid="12" queryScope="SHALLOW"> <discountCategory eid="10" queryScope="EID"/> </discount> </discounts> </ns2:return> </ns2:queryResponse> </soap:Body> </soap:Envelope>
REST Mount Point and Paramters
Query
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts/<eid>
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts?eid=<eid>
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts?name=<name>
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts?status=<status>
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts?type=<type>
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts?discountCategoryEid=<discountCategoryEid>
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts?oneTime=<oneTime>
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts?recurring=<recurring>
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts?currencyType=<currencyType>
REST Example Query and Response
The following example is the REST query with no parameters defined:
-
GET https://my.tractbilling.com/t/s/r/1.33/discounts
This was the response (line breaks and formatting added for ease of reading):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <discounts xmlns:ns2="http://www.tractbilling.com/billing/1_31/domain" pageNumber="1" pageSize="50" totalElements="1" elementCount="1" totalPages="1"> <ns2:discount name="January Discount" status="DRAFT" description="Early January discount. Usually between Jan 2 - Jan 15 (between New Year's and MLK Day)." type="PERCENTAGE" percentage="0.40000" duration="1" oneTime="false" recurring="true" eid="12" queryScope="SHALLOW"> <ns2:discountCategory eid="10" queryScope="EID"/> </ns2:discount> </discounts>
Attributes
Refer to the following topics for more information: