POST | /api/SubmitPOSTransaction |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
/**
* In development, not yet for public use.
*/
@DataContract
public static class SubmitPOSTransactionRequest extends BaseSecureRequest
{
@DataMember
public Integer Acct = null;
@DataMember
public Long LocId = null;
@DataMember
public Long TaxId = null;
@DataMember
public ArrayList<PosLineItem> Items = null;
/**
* Can be CARD, CARD_DEVICE, CASH, CHARGE, SUSPEND, ONFILE, or OTHER
*/
@DataMember
@ApiMember(DataType="string", Description="Can be CARD, CARD_DEVICE, CASH, CHARGE, SUSPEND, ONFILE, or OTHER", Name="TenderType", ParameterType="query")
public String TenderType = null;
/**
* Only applicable for Tender Type of OTHER. Send the Payment Category #
*/
@DataMember
@ApiMember(DataType="string", Description="Only applicable for Tender Type of OTHER. Send the Payment Category #", Name="OtherTenderCategory", ParameterType="query")
public Integer OtherTenderCategory = null;
@DataMember
public String CardToken = null;
@DataMember
public String CardExpiration = null;
@DataMember
public Long TokenPk = null;
@DataMember
public Boolean SaveCard = null;
@DataMember
public String PONumber = null;
/**
* Can be INVOICE, PROPOSAL, APPROVAL, ORDER, or LOANER. Defaults to INVOICE is not sent.
*/
@DataMember
@ApiMember(DataType="string", Description="Can be INVOICE, PROPOSAL, APPROVAL, ORDER, or LOANER. Defaults to INVOICE is not sent.", Name="TransactionMode", ParameterType="query")
public String TransactionMode = null;
/**
* Only valid for Approvals and Orders.
*/
@DataMember
@ApiMember(DataType="decimal", Description="Only valid for Approvals and Orders.", Name="Deposit", ParameterType="query")
public BigDecimal Deposit = null;
@DataMember
public String Notes = null;
/**
* Do Not Send This Parameter
*/
@DataMember
@ApiMember(Description="Do Not Send This Parameter", Name="OnlineContractRef", ParameterType="query")
public String OnlineContractRef = null;
@DataMember
public Long ShipId = null;
@DataMember
public String CardTerminalId = null;
public Integer getAcct() { return Acct; }
public SubmitPOSTransactionRequest setAcct(Integer value) { this.Acct = value; return this; }
public Long getLocId() { return LocId; }
public SubmitPOSTransactionRequest setLocId(Long value) { this.LocId = value; return this; }
public Long getTaxId() { return TaxId; }
public SubmitPOSTransactionRequest setTaxId(Long value) { this.TaxId = value; return this; }
public ArrayList<PosLineItem> getItems() { return Items; }
public SubmitPOSTransactionRequest setItems(ArrayList<PosLineItem> value) { this.Items = value; return this; }
public String getTenderType() { return TenderType; }
public SubmitPOSTransactionRequest setTenderType(String value) { this.TenderType = value; return this; }
public Integer getOtherTenderCategory() { return OtherTenderCategory; }
public SubmitPOSTransactionRequest setOtherTenderCategory(Integer value) { this.OtherTenderCategory = value; return this; }
public String getCardToken() { return CardToken; }
public SubmitPOSTransactionRequest setCardToken(String value) { this.CardToken = value; return this; }
public String getCardExpiration() { return CardExpiration; }
public SubmitPOSTransactionRequest setCardExpiration(String value) { this.CardExpiration = value; return this; }
public Long getTokenPk() { return TokenPk; }
public SubmitPOSTransactionRequest setTokenPk(Long value) { this.TokenPk = value; return this; }
public Boolean isSaveCard() { return SaveCard; }
public SubmitPOSTransactionRequest setSaveCard(Boolean value) { this.SaveCard = value; return this; }
public String getPoNumber() { return PONumber; }
public SubmitPOSTransactionRequest setPoNumber(String value) { this.PONumber = value; return this; }
public String getTransactionMode() { return TransactionMode; }
public SubmitPOSTransactionRequest setTransactionMode(String value) { this.TransactionMode = value; return this; }
public BigDecimal getDeposit() { return Deposit; }
public SubmitPOSTransactionRequest setDeposit(BigDecimal value) { this.Deposit = value; return this; }
public String getNotes() { return Notes; }
public SubmitPOSTransactionRequest setNotes(String value) { this.Notes = value; return this; }
public String getOnlineContractRef() { return OnlineContractRef; }
public SubmitPOSTransactionRequest setOnlineContractRef(String value) { this.OnlineContractRef = value; return this; }
public Long getShipId() { return ShipId; }
public SubmitPOSTransactionRequest setShipId(Long value) { this.ShipId = value; return this; }
public String getCardTerminalId() { return CardTerminalId; }
public SubmitPOSTransactionRequest setCardTerminalId(String value) { this.CardTerminalId = value; return this; }
}
@DataContract
public static class BaseSecureRequest extends BaseRequest
{
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header")
public String Token = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header")
public String DeviceId = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header")
public String AppId = null;
public String getToken() { return Token; }
public BaseSecureRequest setToken(String value) { this.Token = value; return this; }
public String getDeviceId() { return DeviceId; }
public BaseSecureRequest setDeviceId(String value) { this.DeviceId = value; return this; }
public String getAppId() { return AppId; }
public BaseSecureRequest setAppId(String value) { this.AppId = value; return this; }
}
@DataContract
public static 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")
public String ApiKey = null;
@DataMember
@ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
public String OAuthToken = null;
public String getApiKey() { return ApiKey; }
public BaseRequest setApiKey(String value) { this.ApiKey = value; return this; }
public String getOAuthToken() { return OAuthToken; }
public BaseRequest setOAuthToken(String value) { this.OAuthToken = value; return this; }
}
@DataContract
public static class PosLineItem implements IScanItem
{
@DataMember
public Long SkuPk = null;
@DataMember
public Long SasPk = null;
@DataMember
public String Sku = null;
@DataMember
public String Serial = null;
@DataMember
public BigDecimal Quantity = null;
@DataMember
public ExceptionInfo ExceptionInfo = null;
@DataMember
public BigDecimal Discount = null;
@DataMember
public Integer NicsCat = null;
@DataMember
public Integer NicsSub = null;
@DataMember
public BigDecimal PriceOverride = null;
@DataMember
public Boolean AllowPriceOverrideToIgnoreMinPrice = null;
@DataMember
public String Notes = null;
public Long getSkuPk() { return SkuPk; }
public PosLineItem setSkuPk(Long value) { this.SkuPk = value; return this; }
public Long getSasPk() { return SasPk; }
public PosLineItem setSasPk(Long value) { this.SasPk = value; return this; }
public String getSku() { return Sku; }
public PosLineItem setSku(String value) { this.Sku = value; return this; }
public String getSerial() { return Serial; }
public PosLineItem setSerial(String value) { this.Serial = value; return this; }
public BigDecimal getQuantity() { return Quantity; }
public PosLineItem setQuantity(BigDecimal value) { this.Quantity = value; return this; }
public ExceptionInfo getExceptionInfo() { return ExceptionInfo; }
public PosLineItem setExceptionInfo(ExceptionInfo value) { this.ExceptionInfo = value; return this; }
public BigDecimal getDiscount() { return Discount; }
public PosLineItem setDiscount(BigDecimal value) { this.Discount = value; return this; }
public Integer getNicsCat() { return NicsCat; }
public PosLineItem setNicsCat(Integer value) { this.NicsCat = value; return this; }
public Integer getNicsSub() { return NicsSub; }
public PosLineItem setNicsSub(Integer value) { this.NicsSub = value; return this; }
public BigDecimal getPriceOverride() { return PriceOverride; }
public PosLineItem setPriceOverride(BigDecimal value) { this.PriceOverride = value; return this; }
public Boolean isAllowPriceOverrideToIgnoreMinPrice() { return AllowPriceOverrideToIgnoreMinPrice; }
public PosLineItem setAllowPriceOverrideToIgnoreMinPrice(Boolean value) { this.AllowPriceOverrideToIgnoreMinPrice = value; return this; }
public String getNotes() { return Notes; }
public PosLineItem setNotes(String value) { this.Notes = value; return this; }
}
@DataContract
public static class ExceptionInfo
{
@DataMember
public String Barcode = null;
@DataMember
public String Description = null;
@DataMember
public String Base64Image = null;
@DataMember
public Integer Category = null;
@DataMember
public Integer SubCategory = null;
public String getBarcode() { return Barcode; }
public ExceptionInfo setBarcode(String value) { this.Barcode = value; return this; }
public String getDescription() { return Description; }
public ExceptionInfo setDescription(String value) { this.Description = value; return this; }
public String getBase64Image() { return Base64Image; }
public ExceptionInfo setBase64Image(String value) { this.Base64Image = value; return this; }
public Integer getCategory() { return Category; }
public ExceptionInfo setCategory(Integer value) { this.Category = value; return this; }
public Integer getSubCategory() { return SubCategory; }
public ExceptionInfo setSubCategory(Integer value) { this.SubCategory = value; return this; }
}
@DataContract
public static class SubmitPOSTransactionResponse extends BaseResponse
{
@DataMember
public String RefNumber = null;
@DataMember
public ArrayList<PosResponseItem> ErrorItems = null;
public String getRefNumber() { return RefNumber; }
public SubmitPOSTransactionResponse setRefNumber(String value) { this.RefNumber = value; return this; }
public ArrayList<PosResponseItem> getErrorItems() { return ErrorItems; }
public SubmitPOSTransactionResponse setErrorItems(ArrayList<PosResponseItem> value) { this.ErrorItems = value; return this; }
}
@DataContract
public static class BaseResponse
{
/**
*
*/
@DataMember
@ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
public BaseResponseResult Status = null;
public BaseResponseResult getStatus() { return Status; }
public BaseResponse setStatus(BaseResponseResult value) { this.Status = value; return this; }
}
@DataContract
public static class BaseResponseResult
{
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
public String StatusCode = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
public String Login = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
public String ErrorCode = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
public String ErrorDisplayText = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
public String ErrorMessage = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
public String DomainName = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
public String IpAddress = null;
public String getStatusCode() { return StatusCode; }
public BaseResponseResult setStatusCode(String value) { this.StatusCode = value; return this; }
public String getLogin() { return Login; }
public BaseResponseResult setLogin(String value) { this.Login = value; return this; }
public String getErrorCode() { return ErrorCode; }
public BaseResponseResult setErrorCode(String value) { this.ErrorCode = value; return this; }
public String getErrorDisplayText() { return ErrorDisplayText; }
public BaseResponseResult setErrorDisplayText(String value) { this.ErrorDisplayText = value; return this; }
public String getErrorMessage() { return ErrorMessage; }
public BaseResponseResult setErrorMessage(String value) { this.ErrorMessage = value; return this; }
public String getDomainName() { return DomainName; }
public BaseResponseResult setDomainName(String value) { this.DomainName = value; return this; }
public String getIpAddress() { return IpAddress; }
public BaseResponseResult setIpAddress(String value) { this.IpAddress = value; return this; }
}
@DataContract
public static class PosResponseItem extends PosLineItem
{
@DataMember
public BigDecimal PriceEach = null;
@DataMember
public BigDecimal Price = null;
@DataMember
public Boolean Discountable = null;
@DataMember
public String ErrorMessage = null;
public BigDecimal getPriceEach() { return PriceEach; }
public PosResponseItem setPriceEach(BigDecimal value) { this.PriceEach = value; return this; }
public BigDecimal getPrice() { return Price; }
public PosResponseItem setPrice(BigDecimal value) { this.Price = value; return this; }
public Boolean isDiscountable() { return Discountable; }
public PosResponseItem setDiscountable(Boolean value) { this.Discountable = value; return this; }
public String getErrorMessage() { return ErrorMessage; }
public PosResponseItem setErrorMessage(String value) { this.ErrorMessage = value; return this; }
}
}
Java SubmitPOSTransactionRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/SubmitPOSTransaction HTTP/1.1
Host: active-ewebservice.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SubmitPOSTransactionRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<ApiKey>String</ApiKey>
<OAuthToken>String</OAuthToken>
<AppId>String</AppId>
<DeviceId>String</DeviceId>
<Token>String</Token>
<Acct>0</Acct>
<CardExpiration>String</CardExpiration>
<CardTerminalId>String</CardTerminalId>
<CardToken>String</CardToken>
<Deposit>0</Deposit>
<Items xmlns:d2p1="http://schemas.datacontract.org/2004/07/AIM">
<d2p1:PosLineItem>
<d2p1:AllowPriceOverrideToIgnoreMinPrice>false</d2p1:AllowPriceOverrideToIgnoreMinPrice>
<d2p1:Discount>0</d2p1:Discount>
<d2p1:ExceptionInfo>
<d2p1:Barcode>String</d2p1:Barcode>
<d2p1:Base64Image>String</d2p1:Base64Image>
<d2p1:Category>0</d2p1:Category>
<d2p1:Description>String</d2p1:Description>
<d2p1:SubCategory>0</d2p1:SubCategory>
</d2p1:ExceptionInfo>
<d2p1:NicsCat>0</d2p1:NicsCat>
<d2p1:NicsSub>0</d2p1:NicsSub>
<d2p1:Notes>String</d2p1:Notes>
<d2p1:PriceOverride>0</d2p1:PriceOverride>
<d2p1:Quantity>0</d2p1:Quantity>
<d2p1:SasPk>0</d2p1:SasPk>
<d2p1:Serial>String</d2p1:Serial>
<d2p1:Sku>String</d2p1:Sku>
<d2p1:SkuPk>0</d2p1:SkuPk>
</d2p1:PosLineItem>
</Items>
<LocId>0</LocId>
<Notes>String</Notes>
<OnlineContractRef>String</OnlineContractRef>
<OtherTenderCategory>0</OtherTenderCategory>
<PONumber>String</PONumber>
<SaveCard>false</SaveCard>
<ShipId>0</ShipId>
<TaxId>0</TaxId>
<TenderType>String</TenderType>
<TokenPk>0</TokenPk>
<TransactionMode>String</TransactionMode>
</SubmitPOSTransactionRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SubmitPOSTransactionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService"> <Status> <DomainName>String</DomainName> <ErrorCode>String</ErrorCode> <ErrorDisplayText>String</ErrorDisplayText> <ErrorMessage>String</ErrorMessage> <IpAddress>String</IpAddress> <Login>String</Login> <StatusCode>String</StatusCode> </Status> <ErrorItems> <PosResponseItem> <AllowPriceOverrideToIgnoreMinPrice xmlns="http://schemas.datacontract.org/2004/07/AIM">false</AllowPriceOverrideToIgnoreMinPrice> <Discount xmlns="http://schemas.datacontract.org/2004/07/AIM">0</Discount> <ExceptionInfo xmlns="http://schemas.datacontract.org/2004/07/AIM"> <Barcode>String</Barcode> <Base64Image>String</Base64Image> <Category>0</Category> <Description>String</Description> <SubCategory>0</SubCategory> </ExceptionInfo> <NicsCat xmlns="http://schemas.datacontract.org/2004/07/AIM">0</NicsCat> <NicsSub xmlns="http://schemas.datacontract.org/2004/07/AIM">0</NicsSub> <Notes xmlns="http://schemas.datacontract.org/2004/07/AIM">String</Notes> <PriceOverride xmlns="http://schemas.datacontract.org/2004/07/AIM">0</PriceOverride> <Quantity xmlns="http://schemas.datacontract.org/2004/07/AIM">0</Quantity> <SasPk xmlns="http://schemas.datacontract.org/2004/07/AIM">0</SasPk> <Serial xmlns="http://schemas.datacontract.org/2004/07/AIM">String</Serial> <Sku xmlns="http://schemas.datacontract.org/2004/07/AIM">String</Sku> <SkuPk xmlns="http://schemas.datacontract.org/2004/07/AIM">0</SkuPk> <Discountable>false</Discountable> <ErrorMessage>String</ErrorMessage> <Price>0</Price> <PriceEach>0</PriceEach> </PosResponseItem> </ErrorItems> <RefNumber>String</RefNumber> </SubmitPOSTransactionResponse>