Client_Initiations

<back to all web services

ConsumerInitiation

Consumer Initiation Service

Requires Authentication
The following routes are available for this service:
POST/consumerinitiation
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ValidateError:
    error_number: Optional[str] = None
    error_description: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ConsumerInitiationResponse:
    # @ApiMember(Description="Response message")
    message: Optional[str] = None
    """
    Response message
    """


    # @ApiMember(Description="File identifier for the created initiation")
    file_id: Optional[str] = None
    """
    File identifier for the created initiation
    """


    # @ApiMember(Description="List of validation errors, if any")
    errors: Optional[List[ValidateError]] = None
    """
    List of validation errors, if any
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RelocationsRequestFileTransfereeDetails:
    # @ApiMember(Description="First name of the transferee", IsRequired=true)
    first_name: Optional[str] = None
    """
    First name of the transferee
    """


    # @ApiMember(Description="Last name of the transferee", IsRequired=true)
    last_name: Optional[str] = None
    """
    Last name of the transferee
    """


    # @ApiMember(Description="Preferred email address", IsRequired=true)
    preferred_email: Optional[str] = None
    """
    Preferred email address
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AssignmentLocationDetails:
    # @ApiMember(Description="Work city", IsRequired=true)
    work_city: Optional[str] = None
    """
    Work city
    """


    # @ApiMember(Description="Current work location state")
    current_work_state: Optional[str] = None
    """
    Current work location state
    """


    # @ApiMember(Description="Work state or province")
    work_state: Optional[str] = None
    """
    Work state or province
    """


    # @ApiMember(Description="Destination work location state")
    destination_work_state: Optional[str] = None
    """
    Destination work location state
    """


    # @ApiMember(Description="Work country", IsRequired=true)
    work_country: Optional[str] = None
    """
    Work country
    """


    # @ApiMember(Description="Preferred work location state")
    preferred_work_state: Optional[str] = None
    """
    Preferred work location state
    """


    # @ApiMember(Description="Preferred work location country")
    preferred_work_country: Optional[str] = None
    """
    Preferred work location country
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RelocationsRequestFileAssignmentDetails:
    # @ApiMember(Description="Program name or code", IsRequired=true)
    program: Optional[str] = None
    """
    Program name or code
    """


    # @ApiMember(Description="Type of assignment", IsRequired=true)
    assignment_type: Optional[str] = None
    """
    Type of assignment
    """


    # @ApiMember(Description="Assignment start date", IsRequired=true)
    start_date: Optional[datetime.datetime] = None
    """
    Assignment start date
    """


    # @ApiMember(Description="Company name", IsRequired=true)
    company_name: Optional[str] = None
    """
    Company name
    """


    # @ApiMember(Description="Contact", IsRequired=true)
    contact: Optional[str] = None
    """
    Contact
    """


    # @ApiMember(Description="Current assignment location details", IsRequired=true)
    current: Optional[AssignmentLocationDetails] = None
    """
    Current assignment location details
    """


    # @ApiMember(Description="Destination assignment location details", IsRequired=true)
    destination: Optional[AssignmentLocationDetails] = None
    """
    Destination assignment location details
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RelocationsRequestFile:
    # @ApiMember(Description="Command type for the request (INITIATE)", IsRequired=true)
    command: Optional[str] = None
    """
    Command type for the request (INITIATE)
    """


    # @ApiMember(Description="External identifier for the transferee", IsRequired=true)
    external_i_d: Optional[str] = None
    """
    External identifier for the transferee
    """


    # @ApiMember(Description="Details about the transferee", IsRequired=true)
    transferee_details: Optional[RelocationsRequestFileTransfereeDetails] = None
    """
    Details about the transferee
    """


    # @ApiMember(Description="List of addresses associated with the transferee", IsRequired=true)
    addresses: Optional[List[RelocationsRequestFileAddress]] = None
    """
    List of addresses associated with the transferee
    """


    # @ApiMember(Description="List of phone numbers associated with the transferee", IsRequired=true)
    phones: Optional[List[RelocationsRequestFilePhone]] = None
    """
    List of phone numbers associated with the transferee
    """


    # @ApiMember(Description="Assignment details for the relocation", IsRequired=true)
    assignment_details: Optional[RelocationsRequestFileAssignmentDetails] = None
    """
    Assignment details for the relocation
    """


# @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)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ConsumerInitiation(IPost):
    """
    Consumer Initiation Service
    """

    # @ApiMember(Description="Client identifier", IsRequired=true)
    client_i_d: Optional[str] = None
    """
    Client identifier
    """


    # @ApiMember(Description="Consumer relocation request file details", IsRequired=true)
    file: Optional[RelocationsRequestFile] = None
    """
    Consumer relocation request file details
    """


class AddressType(str, Enum):
    CURRENT_HOME = 'CurrentHome'
    DESTINATION_HOME = 'DestinationHome'
    CURRENT_WORK = 'CurrentWork'
    DESTINATION_WORK = 'DestinationWork'


class YesNo(str, Enum):
    Y = 'Y'
    N = 'N'
    ITEM = 'Item'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RelocationsRequestFileAddress:
    # @ApiMember(Description="Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)", IsRequired=true)
    address_type: Optional[AddressType] = None
    """
    Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)
    """


    # @ApiMember(Description="Indicates if this is the primary address", IsRequired=true)
    primary: Optional[YesNo] = None
    """
    Indicates if this is the primary address
    """


    # @ApiMember(Description="Address line 1", IsRequired=true)
    address_line1: Optional[str] = None
    """
    Address line 1
    """


    # @ApiMember(Description="City", IsRequired=true)
    city: Optional[str] = None
    """
    City
    """


    # @ApiMember(Description="Country", IsRequired=true)
    country: Optional[str] = None
    """
    Country
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RelocationsRequestFilePhone:
    # @ApiMember(Description="Phone type (e.g., Mobile, OriginHome)", IsRequired=true)
    type: Optional[str] = None
    """
    Phone type (e.g., Mobile, OriginHome)
    """


    # @ApiMember(Description="Indicates if this is the primary phone number", IsRequired=true)
    primary: Optional[YesNo] = None
    """
    Indicates if this is the primary phone number
    """


    # @ApiMember(Description="Phone number", IsRequired=true)
    number: Optional[str] = None
    """
    Phone number
    """

Python ConsumerInitiation DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + 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
		}
	]
}