UsageEvent

Version: 1.33

Parameters

Extends: TractObject

Elements
Element Type Required? Description

serviceResourceType

ServiceResourceType

Y

The type of service resource this usage applies to.

eventCharges

eventCharges

The charges for this event.

Attributes
Attribute Required? Datatype Description

totalCharge

decimal

The total charge for this event

description

string

Description for the event

startTime

Y

dateTime

Starting dateTime of the event

endTime

dateTime

Ending dateTime of the event

serviceResourceId

Y

string

The SRID this usage applies to.

usageUom

Y

UsageDurationUom

MILLISECOND

SECOND

MINUTE

HOUR

DAY

WEEK

EVENT

BYTE

KILOBYTE

MEGABYTE

GIGABYTE

TERABYTE

COUNT

BITS_PER_SECOND

KILOBITS_PER_SECOND

MEGABITS_PER_SECOND

GIGABITS_PER_SECOND

CURRENCY

usageAmount

Y

decimal

The quantity of the UOM.

referenceId

string

sequenceId

string

text01

string

text02

string

text03

string

text04

string

text05

string

number01

decimal

number02

decimal

number03

decimal

number04

decimal

number05

decimal

boolean01

boolean

boolean02

boolean

boolean03

boolean

boolean04

boolean

boolean05

boolean

date01

dateTime

date02

dateTime

date03

dateTime

date04

dateTime

date05

dateTime

Querying UsageEvent

For paged results, use the plural of the entity name (for example, billingAccounts, productCategories). For more information, refer to Understanding Queries.

Query Keys
Key Type

eid

Long

servicePeriodEid

Long

serviceResourceIdentifier

String

startTime

Timestamp

endTime

Timestamp

billingAccountEid

Long

accountNum

String

closed

Boolean

referenceId

String

sequenceId

String

*Required parameter pairings: billingAccountEid, closed accountNum, closed referenceId, sequenceIdbillingAccountEid, closed accountNum, closed referenceId, sequenceIdbillingAccountEid, closed accountNum, closed referenceId, sequenceId.

REST Endpoints

createUsageEvent

POST

https://my.tractbilling.com/t/s/r/1.33/usageEvents

getUsageEvents

GET

https://my.tractbilling.com/t/s/r/1.33/usageEvents

simulateUsageEvent

POST

https://my.tractbilling.com/t/s/r/1.33/usageEvents/simulate

authorize

POST

https://my.tractbilling.com/t/s/r/1.33/usageEvents/{eid}/authorize

voidUsageEvent

POST

https://my.tractbilling.com/t/s/r/1.33/usageEvents/voidEvent

getUsageEventByEid

GET

https://my.tractbilling.com/t/s/r/1.33/usageEvents/{eid}

createUsageEvents

POST

https://my.tractbilling.com/t/s/r/1.33/usageEvents/bulk

voidUsageEvents

DELETE

https://my.tractbilling.com/t/s/r/1.33/usageEvents/bulk

Sample Requests and Responses

SOAP

Simulate Usage Event

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	<soap:Body>
		<ns2:command xmlns="http://www.tractbilling.com/billing/1_31/domain" xmlns:ns2="http://www.tractbilling.com/billing/1_31/service" xmlns:ns3="http://www.tractbilling.com/billing/1_31/domain/rest">
			<ns2:commandRequest>
				<simulateUsageEvent>
					<usageEvent startTime="2015-04-01T23:55:00.0" serviceResourceId="simulate" usageUom="MEGABYTE" usageAmount="10" description="testing simulate">
						<serviceResourceType>GENERICSRVCRESOURCE</serviceResourceType>
					</usageEvent>
				</simulateUsageEvent>
			</ns2:commandRequest>
		</ns2:command>
	</soap:Body>
</soap:Envelope>

Create with ReferenceId and SequenceId

Create usage event with reference and sequence id:

<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:create>
            <ser:createRequest>
                <dom:usage referenceId="1" sequenceId="2" startTime="2013-08-09T22:30:00.0" serviceResourceId="C-03" usageUom="MILLISECOND" usageAmount="1" >
                    <dom:serviceResourceType>GENERICSRVCRESOURCE</dom:serviceResourceType>
                </dom:usage>
            </ser:createRequest>
        </ser:create>
    </soapenv:Body>
</soapenv:Envelope>

REST

Simulate Usage Event

POST https://my.tractbilling.com/t/s/r/1.33/usageEvents/simulate

<simulateUsageEvent xmlns="http://www.tractbilling.com/billing/1_31/domain">
	<usageEvent startTime="2015-04-01T23:55:00.0" serviceResourceId="simulate" usageUom="MEGABYTE" usageAmount="12" description="testing simulate">
		<serviceResourceType>GENERICSRVCRESOURCE</serviceResourceType>
	</usageEvent>
</simulateUsageEvent>

Create Usage Event

POST https://my.tractbilling.com/t/s/r/1.33/usageEvents

<usageEvent startTime="2015-08-18T00:00:00.0" serviceResourceId="Remax" usageUom="EVENT" usageAmount="2000" number01="250000" xmlns="http://www.tractbilling.com/billing/1_31/domain">
    <serviceResourceType>GENERICSRVCRESOURCE</serviceResourceType>
</usageEvent>

Create Bulk Usage Events

POST https://my.tractbilling.com/t/s/r/1.33/usageEvents/bulk

<bulkUsageEvents ">
    <dom:usageEvent startTime="2012-12-01T16:00:00.0"serviceResourceId="UsageResource0000" usageUom="GIGABYTE"usageAmount="1" description="Bulk Usage Event 0">
        <dom:serviceResourceType>GENERICSRVCRESOURCE</dom:serviceResourceType>
    </dom:usageEvent>
    <dom:usageEvent startTime="2012-12-01T16:00:00.0"serviceResourceId="UsageResource0000" usageUom="GIGABYTE"usageAmount="1" description="Bulk Usage Event 1">
        <dom:serviceResourceType>GENERICSRVCRESOURCE</dom:serviceResourceType>
    </dom:usageEvent>...
</bulkUsageEvents>

Void Bulk Usage Events (Delete Bulk Usage Events)

DELETE https://my.tractbilling.com/t/s/r/1.33/usageEvents/bulk

<bulkUsageEvents ">
    <dom:usageEvent eid="903"/>
    <dom:usageEvent eid="904"/>...
</bulkUsageEvents>