DiscountCodeService

Version: 1.33

Using a Discount Code Service is optional in Gotransverse if you are using Discounts. Discount Codes enable you to organize the Discounts you create and use. Discount Categories are different than Discount Charge Categories.

Query the DiscountCategory directly for information. DiscountCategory is also used within Discount.

If needed, refer to the following related API entities:

  • AddDiscountIdentifierToService is the command to add a DiscountIdentifier to an existing Service on a Customer's BillingAccount.

  • Discount is a discounted price applied to an orderable item.

  • DiscountCategoryStatus defines the status of the DiscountCategory.

  • DiscountChargeCategory is one of the types of Charge Categories.

  • DiscountCode is the code used with 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.

You cannot create Discounts Categories through the API, only query and use them.

Perform Through Gotransverse

  • CREATE the Discount Categories in Gotransverse.

  • View the list of Discount Categories associated with the Product.

  • Select and use the Discount Category.

Perform Through the API

  • Query and view the list of Discount Categories.

  • Select and use the Discount Category.

Parameters

Each Discount Code Service shown from the Query shows information for a number of elements in the entity. The following table shows the elements, details of the elements, and brief descriptions.

Elements
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. See QueryScope for details.

eid

Y

Long

System Generated

System generated unique identity number assigned to all entities in Gotransverse.

discountCode

  DiscountCode

- -

 

discountIdentifier

 

DiscountIdentifier

- -

 

validFrom

 

 

DateTime

Refer to Data Types for dateTime formats.

The date from which the Discount Code Service is valid.

validTo

 

DateTime

Refer to Data Types for dateTime formats.

The date on which the Discount Code Service ends.

duration

 

Int

 

 

amount

 

Decimal

 

 

percentage

 

Decimal

 

 

service

 

Service

- -

 

Entity DiscountCodeServices

The entity DiscountCodeServices enables you to see multiple pages of the entity DiscountCodeService.

Elements
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.

discountCodeService

DiscountCodeService

- -

Shows the list of Discount Code Service.

Information for the related entity of DiscountCodeServices:

  • Entity DiscountCodeServices

Query a Discount Code Service

Query Key Information for SOAP and REST

To query for all Discount Code Services, use the SimpleDataQuery with no parameters:

Query
Query to Use Query for Returns

SimpleDataQuery

DiscountCategory

Complete list of all of your Discount Categories.

To query for more specific information, use the SimpleDataQuery with the parameter of one the following Query Keys:

Query Keys - DiscountCode
Query Key Value Definition

eid

Long

The eid number of the Discount Code.

name

String

The name of the Discount Category.

status

The status of the Discount Category. Refer to DiscountCategoryStatus.


Unknown Query Key Information

If you do not know the Discount Code's eid, name, or status, or want to see all of them:

Query
Query to Use Query for Returns

SimpleDataQuery

DiscountCategory

List of all of your Discount Categories.

SOAP Example Query and Response

The following SOAP example is a non-parameter query of DiscountCategory:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:ser="http://www.tractbilling.com/billing/1.32/service"xmlns:dom="http://www.tractbilling.com/billing/1.32/domain">
    <soapenv:Header/>
    <soapenv:Body>
        <ser:query>
            <ser:queryRequest>
                <dom:simpleDataQuery>
                    <dom:type>DiscountCategory</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.32/domain"xmlns:ns2="http://www.tractbilling.com/billing/1.32/service">
            <ns2:return successful="true">
                <discountCategories pageNumber="1" pageSize="50" totalElements="1" elementCount="1" totalPages="1">
                    <discountCategory name="1Q Discounts"description="Discounts in the 1st Quarter (Jan 1-Mar 31)" status="ACTIVE" eid="10" queryScope="SHALLOW"/>
                </discountCategories>
            </ns2:return>
        </ns2:queryResponse>
    </soap:Body>
</soap:Envelope>

REST Mount Point and Parameters

Query

  • GET https://my.tractbilling.com/t/s/r/1.33/discountCategories

  • GET https://my.tractbilling.com/t/s/r/1.33/discountCategories/<eid>

  • GET https://my.tractbilling.com/t/s/r/1.33/discountCategories?eid=<eid>

  • GET https://my.tractbilling.com/t/s/r/1.33/discountCategories?name=<name>

  • GET https://my.tractbilling.com/t/s/r/1.33/discountCategories?status=<status>

Update

PUT https://my.tractbilling.com/t/s/r/1.33/discountCodeServices/{eid: \d+}

Remove

  • POST https://my.tractbilling.com/t/s/r/1.33/services/{eid: \d+}/removeDiscountCodeService

REST Example Query and Response

The following example is a REST query:

  • GET https://my.tractbilling.com/t/s/r/1.33/discountCategories

This was the response (line breaks and formatting added for ease of reading):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<discountCategories xmlns="http://www.tractbilling.com/billing/1.32/domain/rest" xmlns:ns2="http://www.tractbilling.com/billing/1.32/domain" pageNumber="1" pageSize="50" totalElements="1" elementCount="1" totalPages="1">
    <ns2:discountCategory name="1Q Discounts" 
description="Discounts in the 1st Quarter (Jan 1-Mar 31)" 
status="ACTIVE" eid="10" queryScope="SHALLOW"/>
</discountCategories>