AIM Web Services

<back to all web services

C2BPostContractRequest

C2BPostContract
Requires active-e Contracts Service.

The following routes are available for this service:
POST, GET/api/C2BPostContract
import java.math.*
import java.util.*
import net.servicestack.client.*


/**
* C2BPostContractRequires active-e Contracts Service.
*/
@DataContract
open class C2BPostContractRequest : BaseSecureRequest()
{
    /**
    * ID of the teacher to associate the contract with.
    */
    @DataMember
    @ApiMember(DataType="integer", Description="ID of the teacher to associate the contract with.", Format="int64", Name="TeacherId", ParameterType="body")
    var TeacherId:Long? = null

    /**
    * Used to associate the contract with a school by school name.
    */
    @DataMember
    @ApiMember(DataType="string", Description="Used to associate the contract with a school by school name.", Name="SchoolName", ParameterType="body")
    var SchoolName:String? = null

    /**
    * Used to associate the contract with a school by the AIM School ID
    */
    @DataMember
    @ApiMember(DataType="string", Description="Used to associate the contract with a school by the AIM School ID", Name="AIMSchoolId", ParameterType="body")
    var AIMSchoolId:Long? = null

    /**
    * Used to associate the contract with a location by location code.
    */
    @DataMember
    @ApiMember(DataType="string", Description="Used to associate the contract with a location by location code.", Name="Stloc", ParameterType="body")
    var Stloc:String? = null

    /**
    * ID of the instrument to associate the contract with.
    */
    @DataMember
    @ApiMember(DataType="integer", Description="ID of the instrument to associate the contract with.", Format="int64", Name="InstrumentId", ParameterType="body")
    var InstrumentId:Long? = null

    /**
    * SKU to associate the contract with. Don't send if you send InstrumentId.
    */
    @DataMember
    @ApiMember(DataType="string", Description="SKU to associate the contract with. Don't send if you send InstrumentId.", Name="Sku", ParameterType="body")
    var Sku:String? = null

    /**
    * Description to associate the contract with if a SKU is sent. Don't send if you send InstrumentId.
    */
    @DataMember
    @ApiMember(DataType="string", Description="Description to associate the contract with if a SKU is sent. Don't send if you send InstrumentId.", Name="Desc", ParameterType="body")
    var Desc:String? = null

    /**
    * The ID from the C2BGradeGeneric object
    */
    @DataMember
    @ApiMember(DataType="integer", Description="The ID from the C2BGradeGeneric object", Format="int64", Name="RateId", ParameterType="body")
    var RateId:Long? = null

    /**
    * Rate object if you're not sending RateId. Don't send both.
    */
    @DataMember
    @ApiMember(DataType="object", Description="Rate object if you're not sending RateId. Don't send both.", Name="Rate", ParameterType="body")
    var Rate:Rate? = null

    /**
    * List of Accessory/Delivery/Maintenance IDs.
    */
    @DataMember
    @ApiMember(DataType="array", Description="List of Accessory/Delivery/Maintenance IDs.", Name="AccessoryIdList", ParameterType="body")
    var AccessoryIdList:ArrayList<Long> = ArrayList<Long>()

    /**
    * List of Accessory/Delivery/Maintenance objects. This is for items not defined in AIM.
    */
    @DataMember
    @ApiMember(DataType="array", Description="List of Accessory/Delivery/Maintenance objects. This is for items not defined in AIM.", Name="AccessoryList", ParameterType="body")
    var AccessoryList:ArrayList<Accessory> = ArrayList<Accessory>()

    /**
    * List of Key/Value pairs containing additional information about the customer. If the Key matches an attribute tag within AIM it will populate that attribute. The following Keys are also handled specially: RENTALNOTES, ONLINESIGNATURE, ATTENTION, EMPLOYER, SOCIALSECURITY, WORKPHONE, EXTENSION, EXTENSION2, CELLPHONE, FAX, BANKROUTINGNUMBER, BANKACCOUNTNUMBER, BANKTRANSACTIONTYPE, DRIVERSLICENSENUMBER, DRIVERSLICENSESTATE, BIRTHDAY, SIGCAPTURE, WORKPHONE_EXT, CELLPHONE_EXT, FAX_EXT, CREDITCHECKNAMEOVERRIDE, DELIVERYDATE
    */
    @DataMember
    @ApiMember(DataType="array", Description="List of Key/Value pairs containing additional information about the customer. If the Key matches an attribute tag within AIM it will populate that attribute. The following Keys are also handled specially: RENTALNOTES, ONLINESIGNATURE, ATTENTION, EMPLOYER, SOCIALSECURITY, WORKPHONE, EXTENSION, EXTENSION2, CELLPHONE, FAX, BANKROUTINGNUMBER, BANKACCOUNTNUMBER, BANKTRANSACTIONTYPE, DRIVERSLICENSENUMBER, DRIVERSLICENSESTATE, BIRTHDAY, SIGCAPTURE, WORKPHONE_EXT, CELLPHONE_EXT, FAX_EXT, CREDITCHECKNAMEOVERRIDE, DELIVERYDATE", Name="FormInputList", ParameterType="body")
    var FormInputList:ArrayList<FormInput> = ArrayList<FormInput>()

    /**
    * Credit Card Information
    */
    @DataMember
    @ApiMember(DataType="object", Description="Credit Card Information", Name="CcInfo", ParameterType="body")
    var CcInfo:CcInfo? = null

    /**
    * Customer Information if the a CusAcct is not being passed in.
    */
    @DataMember
    @ApiMember(DataType="object", Description="Customer Information if the a CusAcct is not being passed in.", Name="CustomerInfo", ParameterType="body")
    var CustomerInfo:CustomerInfo? = null

    /**
    * AIM Customer Acct# to be linked to this contract. Do not pass in CustomerInfo if using CusAcct.
    */
    @DataMember
    @ApiMember(DataType="integer", Description="AIM Customer Acct# to be linked to this contract. Do not pass in CustomerInfo if using CusAcct.", Format="int32", Name="CusAcct", ParameterType="body")
    var CusAcct:Int? = null

    /**
    * Used to associate a contract with a Cat/Sub rather then a SKU. Don't send if you send InstrumentId or SKU.
    */
    @DataMember
    @ApiMember(DataType="int", Description="Used to associate a contract with a Cat/Sub rather then a SKU. Don't send if you send InstrumentId or SKU.", Name="Cat", ParameterType="body")
    var Cat:Int? = null

    /**
    * Used to associate a contract with a Cat/Sub rather then a SKU. Don't send if you send InstrumentId or SKU.
    */
    @DataMember
    @ApiMember(DataType="int", Description="Used to associate a contract with a Cat/Sub rather then a SKU. Don't send if you send InstrumentId or SKU.", Name="Sub", ParameterType="body")
    var Sub:Int? = null

    /**
    * If TRUE is sent, a Topic will be returned with information from AIM. Usually not used.
    */
    @DataMember
    @ApiMember(DataType="bool", Description="If TRUE is sent, a Topic will be returned with information from AIM. Usually not used.", Name="ReturnTopic", ParameterType="body")
    var ReturnTopic:Boolean? = null

    /**
    * If sent, the Contract will have the specified status in AIM upon creation. Use ContractStatusListing to get the desired Id. Usually not used.
    */
    @DataMember
    @ApiMember(DataType="int", Description="If sent, the Contract will have the specified status in AIM upon creation. Use ContractStatusListing to get the desired Id. Usually not used.", Name="StatusId", ParameterType="body")
    var StatusId:Long? = null

    /**
    * Internal Use Only. Do not use.
    */
    @DataMember
    @ApiMember(DataType="string", Description="Internal Use Only. Do not use.", Name="CardTerminalId", ParameterType="body")
    var CardTerminalId:String? = null
}

@DataContract
open class BaseSecureRequest : BaseRequest()
{
    /**
    * The Login Token return by the Security API. Required for secured calls.
    */
    @DataMember
    @ApiMember(DataType="string", Description="The Login Token return by the Security API. Required for secured calls.", Name="Token", ParameterType="Header")
    var Token:String? = null
}

@DataContract
open class BaseRequest
{
    /**
    * This is your AIM API Key provided by Tri-Tech
    */
    @DataMember
    @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="Header")
    var ApiKey:String? = null

    /**
    * The OAuthToken token return by AeServices30
    */
    @DataMember
    @ApiMember(DataType="string", Description="The OAuthToken token return by AeServices30", IsRequired=true, Name="OAuthToken", ParameterType="Header")
    var OAuthToken:String? = null

    /**
    * The Device ID of the Mobile Device. Not used for non-mobile devices.
    */
    @DataMember
    @ApiMember(DataType="string", Description="The Device ID of the Mobile Device. Not used for non-mobile devices.", Name="DeviceId", ParameterType="Header")
    var DeviceId:String? = null

    /**
    * An identifier for your integration
    */
    @DataMember
    @ApiMember(DataType="string", Description="An identifier for your integration", IsRequired=true, Name="AppId", ParameterType="Header")
    var AppId:String? = null
}

@DataContract(Name="Rate")
open class Rate
{
    /**
    * Plan Code to be used for the contract
    */
    @DataMember
    @ApiMember(DataType="string", Description="Plan Code to be used for the contract", Name="PlanCode", ParameterType="body")
    var PlanCode:String? = null

    /**
    * Level to be used for the contract
    */
    @DataMember
    @ApiMember(DataType="int", Description="Level to be used for the contract", Name="Level", ParameterType="body")
    var Level:Int? = null

    /**
    * Grade to be used for the contract
    */
    @DataMember
    @ApiMember(DataType="string", Description="Grade to be used for the contract", Name="Grade", ParameterType="body")
    var Grade:String? = null

    /**
    * Down Payment to be collected. Does not include maintenance or lease fees.
    */
    @DataMember
    @ApiMember(DataType="decimal", Description="Down Payment to be collected. Does not include maintenance or lease fees.", Name="DownPay", ParameterType="body")
    var DownPay:BigDecimal? = null

    /**
    * Monthly amount to be collected for the contract. Does not include maintenance or lease fees.
    */
    @DataMember
    @ApiMember(DataType="decimal", Description="Monthly amount to be collected for the contract. Does not include maintenance or lease fees.", Name="MoPay", ParameterType="body")
    var MoPay:BigDecimal? = null

    /**
    * Down Payment to be collected for maintenance.
    */
    @DataMember
    @ApiMember(DataType="decimal", Description="Down Payment to be collected for maintenance.", Name="DownMaint", ParameterType="body")
    var DownMaint:BigDecimal? = null

    /**
    * Monthly amount to be collected for the maintenance.
    */
    @DataMember
    @ApiMember(DataType="decimal", Description="Monthly amount to be collected for the maintenance.", Name="MoMaint", ParameterType="body")
    var MoMaint:BigDecimal? = null

    /**
    * If sent, the first Contract Default with this rental type will be used. Not used if ContractDefaultId is sent. Valid values are EW: Extended Warranty, RO: Rent to Rent, RF: Rent to Own, SF: Sales Contract, RV: Simple Intrst: Rent, SV: Simple Intrst: Sales
    */
    @DataMember
    @ApiMember(DataType="int64", Description="If sent, the first Contract Default with this rental type will be used. Not used if ContractDefaultId is sent. Valid values are EW: Extended Warranty, RO: Rent to Rent, RF: Rent to Own, SF: Sales Contract, RV: Simple Intrst: Rent, SV: Simple Intrst: Sales", Name="RdfType", ParameterType="body")
    var RdfType:String? = null

    /**
    * The ID of the contract default to be used for this contract.
    */
    @DataMember
    @ApiMember(DataType="int64", Description="The ID of the contract default to be used for this contract.", Name="ContractDefaultId", ParameterType="body")
    var ContractDefaultId:Long? = null

    /**
    * The Number of Months covered by the downpayment
    */
    @DataMember
    @ApiMember(DataType="int", Description="The Number of Months covered by the downpayment", Name="Months", ParameterType="body")
    var Months:Int? = null

    /**
    * Down Payment to be collected for Lease Fees.
    */
    @DataMember
    @ApiMember(DataType="decimal", Description="Down Payment to be collected for Lease Fees.", Name="DownMaint", ParameterType="body")
    var DownLease:BigDecimal? = null

    /**
    * Monthly amount to be collected for lease fees.
    */
    @DataMember
    @ApiMember(DataType="decimal", Description="Monthly amount to be collected for lease fees.", Name="MoLease", ParameterType="body")
    var MoLease:BigDecimal? = null
}

@DataContract(Name="Accessory")
open class Accessory
{
    /**
    * The description to be used for the Accessory
    */
    @DataMember
    @ApiMember(DataType="string", Description="The description to be used for the Accessory", IsRequired=true, Name="Desc", ParameterType="body")
    var Desc:String? = null

    /**
    * The price to be used for the Accessory
    */
    @DataMember
    @ApiMember(DataType="decimal", Description="The price to be used for the Accessory", Name="Price", ParameterType="body")
    var Price:BigDecimal? = null

    /**
    * The type of Accessory. A is Accessory, D is Delivery Option, and M is Maintenance
    */
    @DataMember
    @ApiMember(DataType="string", Description="The type of Accessory. A is Accessory, D is Delivery Option, and M is Maintenance", Name="Type", ParameterType="body")
    var Type:String? = null

    /**
    * The category # in AIM to be linked to this accessory.
    */
    @DataMember
    @ApiMember(DataType="int", Description="The category # in AIM to be linked to this accessory.", Name="CatNum", ParameterType="body")
    var CatNum:Int? = null

    /**
    * A SKU or Package Deal package SKU can be sent here to link the accessory to that SKU or package.
    */
    @DataMember
    @ApiMember(DataType="string", Description="A SKU or Package Deal package SKU can be sent here to link the accessory to that SKU or package.", Name="Sku", ParameterType="body")
    var Sku:String? = null

    /**
    * Internal Use Only
    */
    @DataMember
    @ApiMember(DataType="bool", Description="Internal Use Only", Name="Report", ParameterType="body")
    var Report:Boolean? = null
}

@DataContract(Name="FormInput")
open class FormInput
{
    /**
    * Field name of the Input Field. If linking to an Attribute, this should match the Tag value.
    */
    @DataMember
    @ApiMember(DataType="string", Description="Field name of the Input Field. If linking to an Attribute, this should match the Tag value.", IsRequired=true, Name="Key", ParameterType="body")
    var Key:String? = null

    /**
    * Value of the Input Field.
    */
    @DataMember
    @ApiMember(DataType="string", Description="Value of the Input Field.", IsRequired=true, Name="Value", ParameterType="body")
    var Value:String? = null

    /**
    * Whether or not the field is encryped with the C2B encryption key.
    */
    @DataMember
    @ApiMember(DataType="boolean", Description="Whether or not the field is encryped with the C2B encryption key.", Name="Encrypted", ParameterType="body")
    var Encrypted:Boolean? = null
}

@DataContract(Name="CCInfo")
open class CcInfo
{
    /**
    * Token returned from processor
    */
    @DataMember
    @ApiMember(DataType="string", Description="Token returned from processor", IsRequired=true, Name="TokenStr", ParameterType="body")
    var TokenStr:String? = null

    /**
    * Card Type (VISA, MCARD, AMEX, DSCVR)
    */
    @DataMember
    @ApiMember(DataType="string", Description="Card Type (VISA, MCARD, AMEX, DSCVR)", IsRequired=true, Name="CardType", ParameterType="body")
    var CardType:String? = null

    /**
    * Last four of the card
    */
    @DataMember
    @ApiMember(DataType="string", Description="Last four of the card", IsRequired=true, Name="LastFour", ParameterType="body")
    var LastFour:String? = null

    /**
    * Expiration Date of the Card. (MM/YY)
    */
    @DataMember
    @ApiMember(DataType="string", Description="Expiration Date of the Card. (MM/YY)", Name="Expiration", ParameterType="body")
    var Expiration:String? = null

    /**
    * Reason the card is on file.
    */
    @DataMember
    @ApiMember(DataType="string", Description="Reason the card is on file.", Name="ReasonOnFile", ParameterType="body")
    var ReasonOnFile:String? = null

    /**
    * ID of the existing Token Record in AIM, if applicable
    */
    @DataMember
    @ApiMember(DataType="integer", Description="ID of the existing Token Record in AIM, if applicable", Format="int64", Name="TokenPk", ParameterType="body")
    var TokenPk:Long? = null

    /**
    * Is this the customer's primary card? Defaults to false.
    */
    @DataMember
    @ApiMember(DataType="boolean", Description="Is this the customer's primary card? Defaults to false.", Name="Primary", ParameterType="body")
    var Primary:Boolean? = null
}

@DataContract(Name="CustomerInfo")
open class CustomerInfo
{
    /**
    * The WebId of the customer. Optional.
    */
    @DataMember
    @ApiMember(DataType="integer", Description="The WebId of the customer. Optional.", Format="int32", Name="WebId", ParameterType="body")
    var WebId:Int? = null

    /**
    * Name of the customer.
    */
    @DataMember
    @ApiMember(DataType="string", Description="Name of the customer.", IsRequired=true, Name="Name", ParameterType="body")
    var Name:String? = null

    /**
    * Address line 1 of the customer
    */
    @DataMember
    @ApiMember(DataType="string", Description="Address line 1 of the customer", Name="Addr1", ParameterType="body")
    var Addr1:String? = null

    /**
    * Address line 2 of the customer
    */
    @DataMember
    @ApiMember(DataType="string", Description="Address line 2 of the customer", Name="Addr2", ParameterType="body")
    var Addr2:String? = null

    /**
    * City of the customer
    */
    @DataMember
    @ApiMember(DataType="string", Description="City of the customer", Name="City", ParameterType="body")
    var City:String? = null

    /**
    * State/Province of the customer
    */
    @DataMember
    @ApiMember(DataType="string", Description="State/Province of the customer", Name="St", ParameterType="body")
    var St:String? = null

    /**
    * Zip code of the customer
    */
    @DataMember
    @ApiMember(DataType="string", Description="Zip code of the customer", Name="Zip", ParameterType="body")
    var Zip:String? = null

    /**
    * Country of the customer
    */
    @DataMember
    @ApiMember(DataType="string", Description="Country of the customer", Name="Country", ParameterType="body")
    var Country:String? = null

    /**
    * Phone number of the customer
    */
    @DataMember
    @ApiMember(DataType="string", Description="Phone number of the customer", Name="Phone", ParameterType="body")
    var Phone:String? = null

    /**
    * Email address of the customer. Required.
    */
    @DataMember
    @ApiMember(DataType="string", Description="Email address of the customer. Required.", IsRequired=true, Name="Email", ParameterType="body")
    var Email:String? = null
}

@DataContract
open class C2BPostContractResponse : BaseResponse()
{
    @DataMember
    var PaymentRequired:Boolean? = null

    @DataMember
    var Topic:String? = null

    @DataMember
    var WebRef:String? = null

    @DataMember
    var BaseUrl:String? = null
}

@DataContract
open class BaseResponse
{
    /**
    * 
    */
    @DataMember
    @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
    var Status:BaseResponseResult? = null
}

@DataContract
open class BaseResponseResult
{
    /**
    * 
    */
    @DataMember
    @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
    var StatusCode:String? = null

    /**
    * 
    */
    @DataMember
    @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
    var Login:String? = null

    /**
    * 
    */
    @DataMember
    @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
    var ErrorCode:String? = null

    /**
    * 
    */
    @DataMember
    @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
    var ErrorDisplayText:String? = null

    /**
    * 
    */
    @DataMember
    @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
    var ErrorMessage:String? = null

    /**
    * 
    */
    @DataMember
    @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
    var DomainName:String? = null

    /**
    * 
    */
    @DataMember
    @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
    var IpAddress:String? = null
}

Kotlin C2BPostContractRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/C2BPostContract HTTP/1.1 
Host: active-ewebservice.biz 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"TeacherId":0,"SchoolName":"String","AIMSchoolId":0,"Stloc":"String","InstrumentId":0,"Sku":"String","Desc":"String","RateId":0,"Rate":{"PlanCode":"String","Level":0,"Grade":"String","DownPay":0,"MoPay":0,"DownMaint":0,"MoMaint":0,"RdfType":"String","ContractDefaultId":0,"Months":0,"DownLease":0,"MoLease":0},"AccessoryIdList":[0],"AccessoryList":[{"Desc":"String","Price":0,"Type":"String","CatNum":0,"Sku":"String","Report":false}],"FormInputList":[{"Key":"String","Value":"String","Encrypted":false}],"CcInfo":{"TokenStr":"String","CardType":"String","LastFour":"String","Expiration":"String","ReasonOnFile":"String","TokenPk":0,"Primary":false},"CustomerInfo":{"WebId":0,"Name":"String","Addr1":"String","Addr2":"String","City":"String","St":"String","Zip":"String","Country":"String","Phone":"String","Email":"String"},"CusAcct":0,"Cat":0,"Sub":0,"ReturnTopic":false,"StatusId":0,"CardTerminalId":"String","Token":"String","ApiKey":"String","OAuthToken":"String","DeviceId":"String","AppId":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"PaymentRequired":false,"Topic":"String","WebRef":"String","BaseUrl":"String","Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}