| GET | /api/ShippingAddressLookup |
|---|
import Foundation
import ServiceStack
/**
* ShippingAddressLookupRequires active-e Customer Service.
*/
// @DataContract
public class ShippingAddressLookupRequest : BaseSecureRequest
{
/**
* Pass in this parameter if you want to lookup all shipping addresses linked to a customer. Not required if using a customer login. Do not pass in this parameter if passing in the ShipId parameter.
*/
// @DataMember
// @ApiMember(Description="Pass in this parameter if you want to lookup all shipping addresses linked to a customer. Not required if using a customer login. Do not pass in this parameter if passing in the ShipId parameter.", Name="Acct", ParameterType="query")
public var acct:Int?
/**
* Use this parameter to lookup a single Shipping Address with this ID. Do not pass in this parameter if passing in the Acct parameter.
*/
// @DataMember
// @ApiMember(Description="Use this parameter to lookup a single Shipping Address with this ID. Do not pass in this parameter if passing in the Acct parameter.", Name="ShipId", ParameterType="query")
public var shipId:Int?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case acct
case shipId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
acct = try container.decodeIfPresent(Int.self, forKey: .acct)
shipId = try container.decodeIfPresent(Int.self, forKey: .shipId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if acct != nil { try container.encode(acct, forKey: .acct) }
if shipId != nil { try container.encode(shipId, forKey: .shipId) }
}
}
// @DataContract
public 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")
public var token:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case token
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
token = try container.decodeIfPresent(String.self, forKey: .token)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if token != nil { try container.encode(token, forKey: .token) }
}
}
// @DataContract
public class BaseRequest : Codable
{
/**
* 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 var apiKey:String
/**
* The OAuthToken token return by AeServices30
*/
// @DataMember
// @ApiMember(DataType="string", Description="The OAuthToken token return by AeServices30", IsRequired=true, Name="OAuthToken", ParameterType="Header")
public var oAuthToken:String
/**
* 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")
public var deviceId:String
/**
* An identifier for your integration
*/
// @DataMember
// @ApiMember(DataType="string", Description="An identifier for your integration", IsRequired=true, Name="AppId", ParameterType="Header")
public var appId:String
required public init(){}
}
// @DataContract
public class ShippingAddressLookupResponse : BaseResponse
{
// @DataMember
public var shipTos:[ShipToInfo] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case shipTos
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
shipTos = try container.decodeIfPresent([ShipToInfo].self, forKey: .shipTos) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if shipTos.count > 0 { try container.encode(shipTos, forKey: .shipTos) }
}
}
// @DataContract
public class BaseResponse : Codable
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
public var status:BaseResponseResult
required public init(){}
}
// @DataContract
public class BaseResponseResult : Codable
{
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
public var statusCode:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
public var login:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
public var errorCode:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
public var errorDisplayText:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
public var errorMessage:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
public var domainName:String
/**
*
*/
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
public var ipAddress:String
required public init(){}
}
// @DataContract
public class ShipToInfo : Codable
{
// @DataMember
public var id:Int
// @DataMember
public var name:String
// @DataMember
public var attention:String
// @DataMember
public var address1:String
// @DataMember
public var address2:String
// @DataMember
public var city:String
// @DataMember
public var state:String
// @DataMember
public var zip:String
// @DataMember
public var country:String
// @DataMember
public var email:String
// @DataMember
public var phone:String
// @DataMember
public var phone2:String
// @DataMember
public var notes:String
// @DataMember
public var primary:Bool
// @DataMember
public var taxLoc:String
// @DataMember
public var active:Bool
required public init(){}
}
Swift ShippingAddressLookupRequest 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.
GET /api/ShippingAddressLookup HTTP/1.1 Host: active-ewebservice.biz Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ShippingAddressLookupResponse 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>
<ShipTos>
<ShipToInfo>
<Active>false</Active>
<Address1>String</Address1>
<Address2>String</Address2>
<Attention>String</Attention>
<City>String</City>
<Country>String</Country>
<Email>String</Email>
<Id>0</Id>
<Name>String</Name>
<Notes>String</Notes>
<Phone>String</Phone>
<Phone2>String</Phone2>
<Primary>false</Primary>
<State>String</State>
<TaxLoc>String</TaxLoc>
<Zip>String</Zip>
</ShipToInfo>
</ShipTos>
</ShippingAddressLookupResponse>