v1

latestOpenAPI 3.1.02026-08-0610222105.1 KB
Company Policies

Update policy

This endpoint updates a policy by ID.

put/v2/companies/{companyId}/policies/{policyId}

Request body

namestring required

Name of the policy.

type'DEFAULT' | 'GROUP' | 'INTERNAL' required

Policy type.

parentPolicyIdstring uuid

Policy to inherit the values of linked rules. If empty, consider the company default policy.

enableAgentActionOverrideboolean

True if agent can override the PREVENT_BOOKING action. If enabled, outOfPolicyAgentApprovalInfos for all travel types should be provided.

isRestrictiveboolean

True if policy is a restrictive policy.

category'EMPLOYEE' | 'GUEST'

Category of the policy.

Example request

{
  "type": "GROUP",
  "parentPolicyId": "f7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  "currency": {
    "currencyCode": "USD"
  },
  "inPolicyApprovalInfo": {
    "approvalConditions": [
      {
        "rules": [
          {
            "travelRegionRule": {
              "travelRegionType": "DOMESTIC"
            }
          }
        ]
      }
    ]
  },
  "outOfPolicyApprovalInfo": {
    "approvalConditions": [
      {
        "rules": [
          {
            "travelRegionRule": {
              "travelRegionType": "DOMESTIC"
            }
          }
        ]
      }
    ]
  },
  "inPolicyApprovalInfos": [
    {
      "approvalConditions": [
        {
          "rules": [
            {
              "travelRegionRule": {
                "travelRegionType": "DOMESTIC"
              }
            }
          ]
        }
      ]
    }
  ],
  "outOfPolicyApprovalInfos": [
    {
      "approvalConditions": [
        {
          "rules": [
            {
              "travelRegionRule": {
                "travelRegionType": "DOMESTIC"
              }
            }
          ]
        }
      ]
    }
  ],
  "outOfPolicyAgentApprovalInfos": [
    {
      "approvalConditions": [
        {
          "rules": [
            {
              "travelRegionRule": {
                "travelRegionType": "DOMESTIC"
              }
            }
          ]
        }
      ]
    }
  ],
  "userGroups": [
    {
      "legalEntityIds": [
        {
          "id": "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3"
        }
      ],
      "officeIds": [
        {
          "id": "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3"
        }
      ],
      "personas": [
        "EMPLOYEE"
      ],
      "countryCodes": [
        "GB"
      ],
      "workerTypes": [
        "EMPLOYEE"
      ]
    }
  ],
  "commonPolicyRules": {
    "restrictedContinents": {
      "isLinked": true
    },
    "restrictedCountries": {
      "isLinked": true
    }
  },
  "carPolicyRules": {
    "maxCarPricePerNumberOfDays": {
      "isLinked": true
    },
    "allowedCarTypes": {
      "isLinked": true
    }
  },
  "hotelPolicyRules": {
    "restrictedHotels": {
      "isLinked": true
    },
    "maxHotelPriceByLocation": {
      "isLinked": true
    },
    "hotelAdvanceBookingWindow": {
      "isLinked": true
    },
    "hotelCancellation": {
      "isLinked": true
    },
    "hotelChainCodes": {
      "isLinked": true
    },
    "hotelStarRating": {
      "isLinked": true
    },
    "hotelMedianRateNightly": {
      "isLinked": true
    },
    "hotelCentralTierExemption": {
      "isLinked": true
    }
  },
  "airPolicyRules": {
    "restrictedAirlines": {
      "isLinked": true
    },
    "restrictedAirCrafts": {
      "isLinked": true
    },
    "maxFlightBookingPriceByDuration": {
      "isLinked": true
    },
    "flightCabinUpgrade": {
      "isLinked": true
    },
    "flightAdvanceBookingWindow": {
      "isLinked": true
    },
    "flightTicketsRefundable": {
      "isLinked": true
    },
    "flightTicketsChangeable": {
      "isLinked": true
    },
    "highestFlightCabinByDurationDomestic": {
      "isLinked": true
    },
    "highestFlightCabinByDurationInternational": {
      "isLinked": true
    },
    "highestFlightCabinOvernight": {
      "isLinked": true
    },
    "differenceBetweenFlightFareAndMedianFare": {
      "isLinked": true
    },
    "co2EmissionPerPassengerPerKm": {
      "isLinked": true
    },
    "maxFlightBookingPriceInternational": {
      "isLinked": true
    },
    "maxFlightBookingPriceDomestic": {
      "isLinked": true
    },
    "lowestLogicalFare": {
      "isLinked": true
    }
  },
  "isRestrictive": true,
  "rules": [
    {
      "ruleType": "CAR_TYPES_NOT_ALLOWED",
      "policyValue": {
        "isLinked": true
      }
    }
  ],
  "airOopReasonCodes": {
    "props": {
      "reasonCodes": [
        {
          "questionFormat": "CHECKBOX",
          "isRequired": true,
          "isDisabled": true
        }
      ]
    }
  },
  "hotelOopReasonCodes": {
    "props": {
      "reasonCodes": [
        {
          "questionFormat": "CHECKBOX",
          "isRequired": true,
          "isDisabled": true
        }
      ]
    }
  },
  "carOopReasonCodes": {
    "props": {
      "reasonCodes": [
        {
          "questionFormat": "CHECKBOX",
          "isRequired": true,
          "isDisabled": true
        }
      ]
    }
  },
  "railOopReasonCodes": {
    "props": {
      "reasonCodes": [
        {
          "questionFormat": "CHECKBOX",
          "isRequired": true,
          "isDisabled": true
        }
      ]
    }
  },
  "category": "EMPLOYEE"
}

Response

Updated Successfully