| POST | /consumerinitiation |
|---|
"use strict";
export class ValidateError {
/** @param {{ErrorNumber?:string,ErrorDescription?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
ErrorNumber;
/** @type {string} */
ErrorDescription;
}
export class ConsumerInitiationResponse {
/** @param {{Message?:string,FileId?:string,Errors?:ValidateError[]}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Response message */
Message;
/**
* @type {string}
* @description File identifier for the created initiation */
FileId;
/**
* @type {ValidateError[]}
* @description List of validation errors, if any */
Errors;
}
export class RelocationsRequestFileTransfereeDetails {
/** @param {{FirstName?:string,LastName?:string,PreferredEmail?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description First name of the transferee */
FirstName;
/**
* @type {string}
* @description Last name of the transferee */
LastName;
/**
* @type {string}
* @description Preferred email address */
PreferredEmail;
}
export class AssignmentLocationDetails {
/** @param {{WorkCity?:string,CurrentWorkState?:string,WorkState?:string,DestinationWorkState?:string,WorkCountry?:string,PreferredWorkState?:string,PreferredWorkCountry?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Work city */
WorkCity;
/**
* @type {string}
* @description Current work location state */
CurrentWorkState;
/**
* @type {string}
* @description Work state or province */
WorkState;
/**
* @type {string}
* @description Destination work location state */
DestinationWorkState;
/**
* @type {string}
* @description Work country */
WorkCountry;
/**
* @type {string}
* @description Preferred work location state */
PreferredWorkState;
/**
* @type {string}
* @description Preferred work location country */
PreferredWorkCountry;
}
export class RelocationsRequestFileAssignmentDetails {
/** @param {{Program?:string,AssignmentType?:string,StartDate?:string,CompanyName?:string,Contact?:string,Current?:AssignmentLocationDetails,Destination?:AssignmentLocationDetails}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Program name or code */
Program;
/**
* @type {string}
* @description Type of assignment */
AssignmentType;
/**
* @type {string}
* @description Assignment start date */
StartDate;
/**
* @type {string}
* @description Company name */
CompanyName;
/**
* @type {string}
* @description Contact */
Contact;
/**
* @type {AssignmentLocationDetails}
* @description Current assignment location details */
Current;
/**
* @type {AssignmentLocationDetails}
* @description Destination assignment location details */
Destination;
}
export class RelocationsRequestFile {
/** @param {{Command?:string,ExternalID?:string,TransfereeDetails?:RelocationsRequestFileTransfereeDetails,Addresses?:RelocationsRequestFileAddress[],Phones?:RelocationsRequestFilePhone[],AssignmentDetails?:RelocationsRequestFileAssignmentDetails}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Command type for the request (INITIATE) */
Command;
/**
* @type {string}
* @description External identifier for the transferee */
ExternalID;
/**
* @type {RelocationsRequestFileTransfereeDetails}
* @description Details about the transferee */
TransfereeDetails;
/**
* @type {RelocationsRequestFileAddress[]}
* @description List of addresses associated with the transferee */
Addresses;
/**
* @type {RelocationsRequestFilePhone[]}
* @description List of phone numbers associated with the transferee */
Phones;
/**
* @type {RelocationsRequestFileAssignmentDetails}
* @description Assignment details for the relocation */
AssignmentDetails;
}
export class ConsumerInitiation {
/** @param {{ClientID?:string,File?:RelocationsRequestFile}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Client identifier */
ClientID;
/**
* @type {RelocationsRequestFile}
* @description Consumer relocation request file details */
File;
}
/** @typedef {'CurrentHome'|'DestinationHome'|'CurrentWork'|'DestinationWork'} */
export var AddressType;
(function (AddressType) {
AddressType["CurrentHome"] = "CurrentHome"
AddressType["DestinationHome"] = "DestinationHome"
AddressType["CurrentWork"] = "CurrentWork"
AddressType["DestinationWork"] = "DestinationWork"
})(AddressType || (AddressType = {}));
/** @typedef {'Y'|'N'|'Item'} */
export var YesNo;
(function (YesNo) {
YesNo["Y"] = "Y"
YesNo["N"] = "N"
YesNo["Item"] = "Item"
})(YesNo || (YesNo = {}));
export class RelocationsRequestFileAddress {
/** @param {{AddressType?:AddressType,Primary?:YesNo,AddressLine1?:string,City?:string,Country?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {AddressType}
* @description Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork) */
AddressType;
/**
* @type {YesNo}
* @description Indicates if this is the primary address */
Primary;
/**
* @type {string}
* @description Address line 1 */
AddressLine1;
/**
* @type {string}
* @description City */
City;
/**
* @type {string}
* @description Country */
Country;
}
export class RelocationsRequestFilePhone {
/** @param {{Type?:string,Primary?:YesNo,Number?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Phone type (e.g., Mobile, OriginHome) */
Type;
/**
* @type {YesNo}
* @description Indicates if this is the primary phone number */
Primary;
/**
* @type {string}
* @description Phone number */
Number;
}
JavaScript ConsumerInitiation DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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/csv
Content-Type: text/csv
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":"\/Date(-62135596800000-0000)\/","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/csv
Content-Length: length
{"Message":"String","FileId":"String","Errors":[{"ErrorNumber":"String","ErrorDescription":"String"}]}