| POST | /consumerinitiation |
|---|
export class ValidateError
{
public ErrorNumber: string;
public ErrorDescription: string;
public constructor(init?: Partial<ValidateError>) { (Object as any).assign(this, init); }
}
export class ConsumerInitiationResponse
{
/** @description Response message */
// @ApiMember(Description="Response message")
public Message: string;
/** @description File identifier for the created initiation */
// @ApiMember(Description="File identifier for the created initiation")
public FileId: string;
/** @description List of validation errors, if any */
// @ApiMember(Description="List of validation errors, if any")
public Errors: ValidateError[];
public constructor(init?: Partial<ConsumerInitiationResponse>) { (Object as any).assign(this, init); }
}
export class RelocationsRequestFileTransfereeDetails
{
/** @description First name of the transferee */
// @ApiMember(Description="First name of the transferee", IsRequired=true)
public FirstName: string;
/** @description Last name of the transferee */
// @ApiMember(Description="Last name of the transferee", IsRequired=true)
public LastName: string;
/** @description Preferred email address */
// @ApiMember(Description="Preferred email address", IsRequired=true)
public PreferredEmail: string;
public constructor(init?: Partial<RelocationsRequestFileTransfereeDetails>) { (Object as any).assign(this, init); }
}
export class AssignmentLocationDetails
{
/** @description Work city */
// @ApiMember(Description="Work city", IsRequired=true)
public WorkCity: string;
/** @description Current work location state */
// @ApiMember(Description="Current work location state")
public CurrentWorkState: string;
/** @description Work state or province */
// @ApiMember(Description="Work state or province")
public WorkState: string;
/** @description Destination work location state */
// @ApiMember(Description="Destination work location state")
public DestinationWorkState: string;
/** @description Work country */
// @ApiMember(Description="Work country", IsRequired=true)
public WorkCountry: string;
/** @description Preferred work location state */
// @ApiMember(Description="Preferred work location state")
public PreferredWorkState: string;
/** @description Preferred work location country */
// @ApiMember(Description="Preferred work location country")
public PreferredWorkCountry: string;
public constructor(init?: Partial<AssignmentLocationDetails>) { (Object as any).assign(this, init); }
}
export class RelocationsRequestFileAssignmentDetails
{
/** @description Program name or code */
// @ApiMember(Description="Program name or code", IsRequired=true)
public Program: string;
/** @description Type of assignment */
// @ApiMember(Description="Type of assignment", IsRequired=true)
public AssignmentType: string;
/** @description Assignment start date */
// @ApiMember(Description="Assignment start date", IsRequired=true)
public StartDate: string;
/** @description Company name */
// @ApiMember(Description="Company name", IsRequired=true)
public CompanyName: string;
/** @description Contact */
// @ApiMember(Description="Contact", IsRequired=true)
public Contact: string;
/** @description Current assignment location details */
// @ApiMember(Description="Current assignment location details", IsRequired=true)
public Current: AssignmentLocationDetails;
/** @description Destination assignment location details */
// @ApiMember(Description="Destination assignment location details", IsRequired=true)
public Destination: AssignmentLocationDetails;
public constructor(init?: Partial<RelocationsRequestFileAssignmentDetails>) { (Object as any).assign(this, init); }
}
export class RelocationsRequestFile
{
/** @description Command type for the request (INITIATE) */
// @ApiMember(Description="Command type for the request (INITIATE)", IsRequired=true)
public Command: string;
/** @description External identifier for the transferee */
// @ApiMember(Description="External identifier for the transferee", IsRequired=true)
public ExternalID: string;
/** @description Details about the transferee */
// @ApiMember(Description="Details about the transferee", IsRequired=true)
public TransfereeDetails: RelocationsRequestFileTransfereeDetails;
/** @description List of addresses associated with the transferee */
// @ApiMember(Description="List of addresses associated with the transferee", IsRequired=true)
public Addresses: RelocationsRequestFileAddress[];
/** @description List of phone numbers associated with the transferee */
// @ApiMember(Description="List of phone numbers associated with the transferee", IsRequired=true)
public Phones: RelocationsRequestFilePhone[];
/** @description Assignment details for the relocation */
// @ApiMember(Description="Assignment details for the relocation", IsRequired=true)
public AssignmentDetails: RelocationsRequestFileAssignmentDetails;
public constructor(init?: Partial<RelocationsRequestFile>) { (Object as any).assign(this, init); }
}
/** @description Consumer Initiation Service */
// @Api(Description="Consumer Initiation Service")
// @ApiResponse(Description="Returned when the consumer initiation was successfully processed", StatusCode=200)
// @ApiResponse(Description="Returned if the request validation failed", StatusCode=400)
// @ApiResponse(Description="Returned if the client is not authorized", StatusCode=401)
// @ApiResponse(Description="Returned if an error occurred while processing the request", StatusCode=500)
export class ConsumerInitiation implements IPost
{
/** @description Client identifier */
// @ApiMember(Description="Client identifier", IsRequired=true)
public ClientID: string;
/** @description Consumer relocation request file details */
// @ApiMember(Description="Consumer relocation request file details", IsRequired=true)
public File: RelocationsRequestFile;
public constructor(init?: Partial<ConsumerInitiation>) { (Object as any).assign(this, init); }
}
export enum AddressType
{
CurrentHome = 'CurrentHome',
DestinationHome = 'DestinationHome',
CurrentWork = 'CurrentWork',
DestinationWork = 'DestinationWork',
}
export enum YesNo
{
Y = 'Y',
N = 'N',
Item = 'Item',
}
export class RelocationsRequestFileAddress
{
/** @description Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork) */
// @ApiMember(Description="Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)", IsRequired=true)
public AddressType: AddressType;
/** @description Indicates if this is the primary address */
// @ApiMember(Description="Indicates if this is the primary address", IsRequired=true)
public Primary: YesNo;
/** @description Address line 1 */
// @ApiMember(Description="Address line 1", IsRequired=true)
public AddressLine1: string;
/** @description City */
// @ApiMember(Description="City", IsRequired=true)
public City: string;
/** @description Country */
// @ApiMember(Description="Country", IsRequired=true)
public Country: string;
public constructor(init?: Partial<RelocationsRequestFileAddress>) { (Object as any).assign(this, init); }
}
export class RelocationsRequestFilePhone
{
/** @description Phone type (e.g., Mobile, OriginHome) */
// @ApiMember(Description="Phone type (e.g., Mobile, OriginHome)", IsRequired=true)
public Type: string;
/** @description Indicates if this is the primary phone number */
// @ApiMember(Description="Indicates if this is the primary phone number", IsRequired=true)
public Primary: YesNo;
/** @description Phone number */
// @ApiMember(Description="Phone number", IsRequired=true)
public Number: string;
public constructor(init?: Partial<RelocationsRequestFilePhone>) { (Object as any).assign(this, init); }
}
TypeScript ConsumerInitiation DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /consumerinitiation HTTP/1.1
Host: initiation-pen.sirva.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ClientID: String,
File:
{
Command: String,
ExternalID: String,
TransfereeDetails:
{
FirstName: String,
LastName: String,
PreferredEmail: String
},
Addresses:
[
{
AddressType: CurrentHome,
Primary: Y,
AddressLine1: String,
City: String,
Country: String
}
],
Phones:
[
{
Type: String,
Primary: Y,
Number: String
}
],
AssignmentDetails:
{
Program: String,
AssignmentType: String,
StartDate: 0001-01-01,
CompanyName: String,
Contact: String,
Current:
{
WorkCity: String,
CurrentWorkState: String,
WorkState: String,
DestinationWorkState: String,
WorkCountry: String,
PreferredWorkState: String,
PreferredWorkCountry: String
},
Destination:
{
WorkCity: String,
CurrentWorkState: String,
WorkState: String,
DestinationWorkState: String,
WorkCountry: String,
PreferredWorkState: String,
PreferredWorkCountry: String
}
}
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Message: String,
FileId: String,
Errors:
[
{
ErrorNumber: String,
ErrorDescription: String
}
]
}