POST, GET | /api/C2BPostContract |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using AIM.WebService;
namespace AIM.WebService
{
[DataContract(Name="Accessory")]
public partial class Accessory
{
///<summary>
///The description to be used for the Accessory
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="The description to be used for the Accessory", IsRequired=true, Name="Desc", ParameterType="body")]
public virtual string Desc { get; set; }
///<summary>
///The price to be used for the Accessory
///</summary>
[DataMember]
[ApiMember(DataType="decimal", Description="The price to be used for the Accessory", Name="Price", ParameterType="body")]
public virtual decimal Price { get; set; }
///<summary>
///The type of Accessory. A is Accessory, D is Delivery Option, and M is Maintenance
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="The type of Accessory. A is Accessory, D is Delivery Option, and M is Maintenance", Name="Type", ParameterType="body")]
public virtual string Type { get; set; }
///<summary>
///The category # in AIM to be linked to this accessory.
///</summary>
[DataMember]
[ApiMember(DataType="int", Description="The category # in AIM to be linked to this accessory.", Name="CatNum", ParameterType="body")]
public virtual int CatNum { get; set; }
///<summary>
///A SKU or Package Deal package SKU can be sent here to link the accessory to that SKU or package.
///</summary>
[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")]
public virtual string Sku { get; set; }
///<summary>
///Internal Use Only
///</summary>
[DataMember]
[ApiMember(DataType="bool", Description="Internal Use Only", Name="Report", ParameterType="body")]
public virtual bool? Report { get; set; }
}
[DataContract]
public partial class BaseRequest
{
///<summary>
///This is your AIM API Key provided by Tri-Tech
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="Header")]
public virtual string ApiKey { get; set; }
///<summary>
///The OAuthToken token return by AeServices30
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="The OAuthToken token return by AeServices30", IsRequired=true, Name="OAuthToken", ParameterType="Header")]
public virtual string OAuthToken { get; set; }
///<summary>
///The Device ID of the Mobile Device. Not used for non-mobile devices.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="The Device ID of the Mobile Device. Not used for non-mobile devices.", Name="DeviceId", ParameterType="Header")]
public virtual string DeviceId { get; set; }
///<summary>
///An identifier for your integration
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="An identifier for your integration", IsRequired=true, Name="AppId", ParameterType="Header")]
public virtual string AppId { get; set; }
}
[DataContract]
public partial class BaseResponse
{
///<summary>
///
///</summary>
[DataMember]
[ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")]
public virtual BaseResponseResult Status { get; set; }
[DataContract]
public partial class BaseResponseResult
{
///<summary>
///
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")]
public virtual string StatusCode { get; set; }
///<summary>
///
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")]
public virtual string Login { get; set; }
///<summary>
///
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")]
public virtual string ErrorCode { get; set; }
///<summary>
///
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")]
public virtual string ErrorDisplayText { get; set; }
///<summary>
///
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")]
public virtual string ErrorMessage { get; set; }
///<summary>
///
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")]
public virtual string DomainName { get; set; }
///<summary>
///
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")]
public virtual string IpAddress { get; set; }
}
}
[DataContract]
public partial class BaseSecureRequest
: BaseRequest
{
///<summary>
///The Login Token return by the Security API. Required for secured calls.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="The Login Token return by the Security API. Required for secured calls.", Name="Token", ParameterType="Header")]
public virtual string Token { get; set; }
}
///<summary>
///C2BPostContractRequires active-e Contracts Service.
///</summary>
[DataContract]
public partial class C2BPostContractRequest
: BaseSecureRequest
{
public C2BPostContractRequest()
{
AccessoryIdList = new List<long>{};
AccessoryList = new List<Accessory>{};
FormInputList = new List<FormInput>{};
}
///<summary>
///ID of the teacher to associate the contract with.
///</summary>
[DataMember]
[ApiMember(DataType="integer", Description="ID of the teacher to associate the contract with.", Format="int64", Name="TeacherId", ParameterType="body")]
public virtual long? TeacherId { get; set; }
///<summary>
///Used to associate the contract with a school by school name.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Used to associate the contract with a school by school name.", Name="SchoolName", ParameterType="body")]
public virtual string SchoolName { get; set; }
///<summary>
///Used to associate the contract with a school by the AIM School ID
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Used to associate the contract with a school by the AIM School ID", Name="AIMSchoolId", ParameterType="body")]
public virtual long? AIMSchoolId { get; set; }
///<summary>
///Used to associate the contract with a location by location code.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Used to associate the contract with a location by location code.", Name="Stloc", ParameterType="body")]
public virtual string Stloc { get; set; }
///<summary>
///ID of the instrument to associate the contract with.
///</summary>
[DataMember]
[ApiMember(DataType="integer", Description="ID of the instrument to associate the contract with.", Format="int64", Name="InstrumentId", ParameterType="body")]
public virtual long? InstrumentId { get; set; }
///<summary>
///SKU to associate the contract with. Don't send if you send InstrumentId.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="SKU to associate the contract with. Don't send if you send InstrumentId.", Name="Sku", ParameterType="body")]
public virtual string Sku { get; set; }
///<summary>
///Description to associate the contract with if a SKU is sent. Don't send if you send InstrumentId.
///</summary>
[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")]
public virtual string Desc { get; set; }
///<summary>
///The ID from the C2BGradeGeneric object
///</summary>
[DataMember]
[ApiMember(DataType="integer", Description="The ID from the C2BGradeGeneric object", Format="int64", Name="RateId", ParameterType="body")]
public virtual long? RateId { get; set; }
///<summary>
///Rate object if you're not sending RateId. Don't send both.
///</summary>
[DataMember]
[ApiMember(DataType="object", Description="Rate object if you're not sending RateId. Don't send both.", Name="Rate", ParameterType="body")]
public virtual Rate Rate { get; set; }
///<summary>
///List of Accessory/Delivery/Maintenance IDs.
///</summary>
[DataMember]
[ApiMember(DataType="array", Description="List of Accessory/Delivery/Maintenance IDs.", Name="AccessoryIdList", ParameterType="body")]
public virtual List<long> AccessoryIdList { get; set; }
///<summary>
///List of Accessory/Delivery/Maintenance objects. This is for items not defined in AIM.
///</summary>
[DataMember]
[ApiMember(DataType="array", Description="List of Accessory/Delivery/Maintenance objects. This is for items not defined in AIM.", Name="AccessoryList", ParameterType="body")]
public virtual List<Accessory> AccessoryList { get; set; }
///<summary>
///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
///</summary>
[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")]
public virtual List<FormInput> FormInputList { get; set; }
///<summary>
///Credit Card Information
///</summary>
[DataMember]
[ApiMember(DataType="object", Description="Credit Card Information", Name="CcInfo", ParameterType="body")]
public virtual CcInfo CcInfo { get; set; }
///<summary>
///Customer Information if the a CusAcct is not being passed in.
///</summary>
[DataMember]
[ApiMember(DataType="object", Description="Customer Information if the a CusAcct is not being passed in.", Name="CustomerInfo", ParameterType="body")]
public virtual CustomerInfo CustomerInfo { get; set; }
///<summary>
///AIM Customer Acct# to be linked to this contract. Do not pass in CustomerInfo if using CusAcct.
///</summary>
[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")]
public virtual int? CusAcct { get; set; }
///<summary>
///Used to associate a contract with a Cat/Sub rather then a SKU. Don't send if you send InstrumentId or SKU.
///</summary>
[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")]
public virtual int? Cat { get; set; }
///<summary>
///Used to associate a contract with a Cat/Sub rather then a SKU. Don't send if you send InstrumentId or SKU.
///</summary>
[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")]
public virtual int? Sub { get; set; }
///<summary>
///If TRUE is sent, a Topic will be returned with information from AIM. Usually not used.
///</summary>
[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")]
public virtual bool? ReturnTopic { get; set; }
///<summary>
///If sent, the Contract will have the specified status in AIM upon creation. Use ContractStatusListing to get the desired Id. Usually not used.
///</summary>
[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")]
public virtual long? StatusId { get; set; }
///<summary>
///Internal Use Only. Do not use.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Internal Use Only. Do not use.", Name="CardTerminalId", ParameterType="body")]
public virtual string CardTerminalId { get; set; }
}
[DataContract]
public partial class C2BPostContractResponse
: BaseResponse
{
[DataMember]
public virtual bool PaymentRequired { get; set; }
[DataMember]
public virtual string Topic { get; set; }
[DataMember]
public virtual string WebRef { get; set; }
[DataMember]
public virtual string BaseUrl { get; set; }
}
[DataContract(Name="CCInfo")]
public partial class CcInfo
{
///<summary>
///Token returned from processor
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Token returned from processor", IsRequired=true, Name="TokenStr", ParameterType="body")]
public virtual string TokenStr { get; set; }
///<summary>
///Card Type (VISA, MCARD, AMEX, DSCVR)
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Card Type (VISA, MCARD, AMEX, DSCVR)", IsRequired=true, Name="CardType", ParameterType="body")]
public virtual string CardType { get; set; }
///<summary>
///Last four of the card
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Last four of the card", IsRequired=true, Name="LastFour", ParameterType="body")]
public virtual string LastFour { get; set; }
///<summary>
///Expiration Date of the Card. (MM/YY)
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Expiration Date of the Card. (MM/YY)", Name="Expiration", ParameterType="body")]
public virtual string Expiration { get; set; }
///<summary>
///Reason the card is on file.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Reason the card is on file.", Name="ReasonOnFile", ParameterType="body")]
public virtual string ReasonOnFile { get; set; }
///<summary>
///ID of the existing Token Record in AIM, if applicable
///</summary>
[DataMember]
[ApiMember(DataType="integer", Description="ID of the existing Token Record in AIM, if applicable", Format="int64", Name="TokenPk", ParameterType="body")]
public virtual long? TokenPk { get; set; }
///<summary>
///Is this the customer's primary card? Defaults to false.
///</summary>
[DataMember]
[ApiMember(DataType="boolean", Description="Is this the customer's primary card? Defaults to false.", Name="Primary", ParameterType="body")]
public virtual bool? Primary { get; set; }
}
[DataContract(Name="CustomerInfo")]
public partial class CustomerInfo
{
///<summary>
///The WebId of the customer. Optional.
///</summary>
[DataMember]
[ApiMember(DataType="integer", Description="The WebId of the customer. Optional.", Format="int32", Name="WebId", ParameterType="body")]
public virtual int? WebId { get; set; }
///<summary>
///Name of the customer.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Name of the customer.", IsRequired=true, Name="Name", ParameterType="body")]
public virtual string Name { get; set; }
///<summary>
///Address line 1 of the customer
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Address line 1 of the customer", Name="Addr1", ParameterType="body")]
public virtual string Addr1 { get; set; }
///<summary>
///Address line 2 of the customer
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Address line 2 of the customer", Name="Addr2", ParameterType="body")]
public virtual string Addr2 { get; set; }
///<summary>
///City of the customer
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="City of the customer", Name="City", ParameterType="body")]
public virtual string City { get; set; }
///<summary>
///State/Province of the customer
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="State/Province of the customer", Name="St", ParameterType="body")]
public virtual string St { get; set; }
///<summary>
///Zip code of the customer
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Zip code of the customer", Name="Zip", ParameterType="body")]
public virtual string Zip { get; set; }
///<summary>
///Country of the customer
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Country of the customer", Name="Country", ParameterType="body")]
public virtual string Country { get; set; }
///<summary>
///Phone number of the customer
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Phone number of the customer", Name="Phone", ParameterType="body")]
public virtual string Phone { get; set; }
///<summary>
///Email address of the customer. Required.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Email address of the customer. Required.", IsRequired=true, Name="Email", ParameterType="body")]
public virtual string Email { get; set; }
}
[DataContract(Name="FormInput")]
public partial class FormInput
{
///<summary>
///Field name of the Input Field. If linking to an Attribute, this should match the Tag value.
///</summary>
[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")]
public virtual string Key { get; set; }
///<summary>
///Value of the Input Field.
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Value of the Input Field.", IsRequired=true, Name="Value", ParameterType="body")]
public virtual string Value { get; set; }
///<summary>
///Whether or not the field is encryped with the C2B encryption key.
///</summary>
[DataMember]
[ApiMember(DataType="boolean", Description="Whether or not the field is encryped with the C2B encryption key.", Name="Encrypted", ParameterType="body")]
public virtual bool Encrypted { get; set; }
}
[DataContract(Name="Rate")]
public partial class Rate
{
///<summary>
///Plan Code to be used for the contract
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Plan Code to be used for the contract", Name="PlanCode", ParameterType="body")]
public virtual string PlanCode { get; set; }
///<summary>
///Level to be used for the contract
///</summary>
[DataMember]
[ApiMember(DataType="int", Description="Level to be used for the contract", Name="Level", ParameterType="body")]
public virtual int? Level { get; set; }
///<summary>
///Grade to be used for the contract
///</summary>
[DataMember]
[ApiMember(DataType="string", Description="Grade to be used for the contract", Name="Grade", ParameterType="body")]
public virtual string Grade { get; set; }
///<summary>
///Down Payment to be collected. Does not include maintenance or lease fees.
///</summary>
[DataMember]
[ApiMember(DataType="decimal", Description="Down Payment to be collected. Does not include maintenance or lease fees.", Name="DownPay", ParameterType="body")]
public virtual decimal? DownPay { get; set; }
///<summary>
///Monthly amount to be collected for the contract. Does not include maintenance or lease fees.
///</summary>
[DataMember]
[ApiMember(DataType="decimal", Description="Monthly amount to be collected for the contract. Does not include maintenance or lease fees.", Name="MoPay", ParameterType="body")]
public virtual decimal? MoPay { get; set; }
///<summary>
///Down Payment to be collected for maintenance.
///</summary>
[DataMember]
[ApiMember(DataType="decimal", Description="Down Payment to be collected for maintenance.", Name="DownMaint", ParameterType="body")]
public virtual decimal? DownMaint { get; set; }
///<summary>
///Monthly amount to be collected for the maintenance.
///</summary>
[DataMember]
[ApiMember(DataType="decimal", Description="Monthly amount to be collected for the maintenance.", Name="MoMaint", ParameterType="body")]
public virtual decimal? MoMaint { get; set; }
///<summary>
///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
///</summary>
[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")]
public virtual string RdfType { get; set; }
///<summary>
///The ID of the contract default to be used for this contract.
///</summary>
[DataMember]
[ApiMember(DataType="int64", Description="The ID of the contract default to be used for this contract.", Name="ContractDefaultId", ParameterType="body")]
public virtual long? ContractDefaultId { get; set; }
///<summary>
///The Number of Months covered by the downpayment
///</summary>
[DataMember]
[ApiMember(DataType="int", Description="The Number of Months covered by the downpayment", Name="Months", ParameterType="body")]
public virtual int? Months { get; set; }
///<summary>
///Down Payment to be collected for Lease Fees.
///</summary>
[DataMember]
[ApiMember(DataType="decimal", Description="Down Payment to be collected for Lease Fees.", Name="DownMaint", ParameterType="body")]
public virtual decimal? DownLease { get; set; }
///<summary>
///Monthly amount to be collected for lease fees.
///</summary>
[DataMember]
[ApiMember(DataType="decimal", Description="Monthly amount to be collected for lease fees.", Name="MoLease", ParameterType="body")]
public virtual decimal? MoLease { get; set; }
}
}
C# C2BPostContractRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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: text/jsonl
Content-Type: text/jsonl
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: text/jsonl 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"}}