Policy Group Update

Supply the universal profile ID of the account the policy group exists in and the policy group ID of the policy group you wish to update.

Sample Policy Group Update request data

xmlns:v1="http://www.travelport.com/schema/policy/admin/policygroup/v1"
xmlns:com="http://www.travelport.com/schema/policy/admin/common/v1"
<v1:performCRUDRQ>
         <v1:BasePolicyRequestHeader source="Web" requestorId="DAVES" accountId="749538" requestCategory="Update"/>
         <v1:PolicyGroupRequestProfile policyGroupId="100443">
            <com:PolicyGroupProfile defaultGroupInd="false" endDate="2016-12-31" startDate="2016-01-01">
               <com:Profile>
                  <com:Name>SandboxAdminPG1</com:Name>
                  <com:Summary>Sandbox test policy group created through Admin CRUD web service</com:Summary>
               </com:Profile>
            </com:PolicyGroupProfile>
            <v1:PoliciesAttached>
               <v1:Policy category="AIR" policyId="100502"/>
               <v1:Policy category="HOTEL" policyId="100504"/>
               <v1:Policy category="REASONCODE" policyId="100505"/>
               <v1:Policy category="CAR" policyId="100513"/>
               <v1:Policy category="EMAIL" policyId="100032"/>
            </v1:PoliciesAttached>
            <v1:DomesticCountries>
               <v1:Country>AU</v1:Country>
               <v1:Country>NZ</v1:Country>
            </v1:DomesticCountries>
         </v1:PolicyGroupRequestProfile>
</v1:performCRUDRQ>

The following elements are supplied in an Update request:

performCRUDRQ / BasePolicyRequestHeader (requestCategory = Update)

PolicyGroupRequestProfile – wrapper element for policy group data
attribute: policyGroupId – Policy DB id of the Policy Group to be updated

PolicyGroupProfile
attribute: defaultGroupInd – true / false flag used to indicate if this policy group is the default group for this account – only one policy group can be flagged as the default policy group for a given account
attribute: startDate – date on which this policy group becomes effective.
attribute: endDate – date on which this policy group is no longer valid (if not specified the end date will default to Open-ended).

Profile – wrapper element for name / summary data

Name – name of this policy group

Summary – user defined summary describing the purpose / application of this policy group

PoliciesAttached – wrapper element around list of Policy elements associated with this policy group.

Policy – defines an individual policy to be attached
attribute: category – type of Policy (AIR / CAR / HOTEL / REASONCODE / EMAIL)
attribute: policyId - id within the Policy DB of this particular policy

DomesticCountries – wrapper element around list of country codes that are considered domestic countries.

Country – defines an individual two character (IATA) country code that is considered domestic, or, can be one of a given set of 6 character region codes from the table included below. When a region is specified any country in that region is considered to be domestic.

Sample Policy Group Update response data

xmlns:ns2=http://www.travelport.com/schema/policy/admin/common/v1
xmlns:ns5=http://www.travelport.com/schema/policy/admin/policygroup/v1
<ns5:performCRUDRS>
         <ns5:BasePolicyResponseHeader accountId="749538" requestorId="DAVES"/>
         <ns2:AdditionalMessage iD="749538" name="SandboxAdminPG1" status="Processed">
            <ns2:Element iD="0" name="PoliciesAttached" status="Processed">
               <ns2:SubElement iD="100502" name="PoliciesAttached" status="Processed">AIR</ns2:SubElement>
               <ns2:SubElement iD="100504" name="PoliciesAttached" status="Processed">HOTEL</ns2:SubElement>
               <ns2:SubElement iD="100505" name="PoliciesAttached" status="Processed">REASONCODE</ns2:SubElement>
               <ns2:SubElement iD="100513" name="PoliciesAttached" status="Processed">CAR</ns2:SubElement>
               <ns2:SubElement iD="100032" name="PoliciesAttached" status="Processed">EMAIL</ns2:SubElement>
            </ns2:Element>
            <ns2:Element iD="0" name="Profile" status="Processed">
               <ns2:SubElement iD="100443" name="Profile" status="Processed">Success</ns2:SubElement>
            </ns2:Element>
            <ns2:Element iD="0" name="DomesticCountries" status="Processed">
               <ns2:SubElement iD="0" name="DomesticCountries" status="Processed">AU</ns2:SubElement>
               <ns2:SubElement iD="0" name="DomesticCountries" status="Processed">NZ</ns2:SubElement>
            </ns2:Element>
         </ns2:AdditionalMessage>
</ns5:performCRUDRS>

The following elements are found in an Update response:

performCRUDRS / BasePolicyResponseHeader

AdditionalMessage – overall status of the response
attribute: iD – reflects policyGroupId from request
attribute: name – name of the updated policy group
attribute: status – will be either “Processed” or “Failure”.

Element – wrapper element for response information for a particular tag – will contain a list of sub elements processed for this particular tag
attribute: iD – “0” / not used on a Policy Group Update
attribute: name – name of element this information is for (PoliciesAttached / Profile / DomesticCountries)
attribute: status – will be either “Processed” or “Failure”.

SubElement – value depends on tag name being returned (PolicyAttached = category from request / Profile = Success / PolicyGroupDomCntry = country code from request)
attribute: iD – value depends on tag name being returned (PolicyAttached = id within the Policy DB of this particular policy / Profile = policy group ID from Policy DB of the newly created Policy Group / PolicyGroupDomCntry = “0” not used)
attribute: name – name of element this information is for (PoliciesAttached / Profile / DomesticCountries) 
attribute: status – will be either “Processed” or “Failure”.

Considerations for a Policy Group Update

A valid response will return status information in the AdditionalMessage section.

The specified Policy Group name must be unique within the account to which it is being added. Note that the same Policy Group name can be repeated in different accounts under the same agency.

When attaching policies only one of each type of policy (AIR / CAR / HOTEL / REASONCODE / EMAIL) can be specified. The specified policies must belong to the account under which the policy group is being configured. If you attempt to attach a policy that does not exist or the type does not match the specified ID you will get the following error:

<ns2:AdditionalMessage iD="0" name="SandboxAdminPG9" status="Failure">
       <ns2:Element iD="0" name="Policy Group" status="Failure">
           <ns2:SubElement iD="201" name="Policy Group" status="Failure">Policy not found or do not exist for this request</ns2:SubElement>
      </ns2:Element>
</ns2:AdditionalMessage>

The web service update process consists of deleting the existing data and replacing it with the data included in the request.

Any data from the original policy group not passed back in the update request will be removed from the policy group.

If the PoliciesAttached element is not included any attached policies will be removed from the policy group, if this element is provided only the policies listed in the request will be attached to the policy group, any other policies will be removed.

If the DomesticCountries element is not included any existing domestic countries will be removed from the policy group, if this element is provided only the countries listed in the request will be added as domestic countries in the policy group, any other domestic countries will be removed (if no countries are specified all countries will be treated as international when applying policy).

The PolicyGroupProfile, Profile and Name tags are required on an update request.

The startDate attribute on the PolicyGroupProfile is required and can be a past date on an update in order to retain the original start date.

The endDate attribute on the PolicyGroupProfile is optional and will default to Open-ended if not specified.

The Summary tag is optional.

If you attempt to make a policy group the default group for an account and another policy group has already been marked as the default you will get the following error:

<ns2:AdditionalMessage iD="0" name="SandboxAdminPG9" status="Failure">
       <ns2:Element iD="0" name="Policy Group" status="Failure">
            <ns2:SubElement iD="102" name="Policy Group" status="Failure">Only one Default policy Group permitted per Account</ns2:SubElement>
       </ns2:Element>
</ns2:AdditionalMessage>

Sample Request and Response

See the Downloads page to download a zip file containing the following XML files.

Sample request:

PolicyGroupUpdateRQ.xml

Sample response:

PolicyGroupUpdateRS.xml