ZenHR Inc Business Travel Policies API

The Business Travel Policies API from ZenHR Inc — 2 operation(s) for business travel policies.

OpenAPI Specification

zenhr-inc-business-travel-policies-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: ZenHR Approvals Business Travel Policies API
  version: v3
  description: REST API for the ZenHR HR & payroll platform. Integrate external applications with ZenHR to manage branches, employees, master/professional/financial data, payroll (salaries, financial transactions, loans, overtime), time off, attendance, competencies, HR letters, terminations, business travel, and documents. Responds in JSON with standard HTTP status codes; authenticated via OAuth 2.0 (authorization code + PKCE). Derived by API Evangelist from the provider's published Postman documentation collection.
  contact:
    name: ZenHR DevOps
    email: devops@zenhr.com
    url: https://api-docs.zenhr.com/
  x-apievangelist-source: https://api-docs.zenhr.com/ (Postman published collection 2sA3dxDWwR)
servers:
- url: https://app.zenhr.com/api/v3
  description: Production
- url: https://aiapi.zenhr.com/api/v3
  description: Attendance ingestion (AI) host
security:
- oauth2:
  - read:employee
tags:
- name: Business Travel Policies
paths:
  /branches/{branch_id}/business_travel_policies:
    get:
      summary: 1. View All Business Travel Policies
      tags:
      - Business Travel Policies
      operationId: 1ViewAllBusinessTravelPolicies
      responses:
        '200':
          description: Successful response
        '401':
          description: Unauthorized
        '404':
          description: Not found
      parameters:
      - name: branch_id
        in: path
        required: true
        schema:
          type: string
    post:
      summary: 4. Create Business Travel Policy
      tags:
      - Business Travel Policies
      operationId: 4CreateBusinessTravelPolicy
      responses:
        '200':
          description: Successful response
        '401':
          description: Unauthorized
        '404':
          description: Not found
      parameters:
      - name: branch_id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
            example:
              business_travel_policy:
                name:
                  ar: 3 قيس
                  en: Qais 3
                position_ids:
                - '166606'
                business_travel_destinations_attributes:
                  '0':
                    _destroy: false
                    category: domestic
                    country: 4
                    per_diem: '12.23'
                    per_diem_currency: SAR
                    departure_country: []
                    departure_city:
                    - ''
                    - 82
                    arrival_country: []
                    arrival_city:
                    - ''
                    - 82
                    business_travel_accommodation_attributes:
                      hotel_tier:
                        '1': false
                        '2': false
                        '3': false
                        '4': true
                        '5': true
                      period_type: night
                      max_accommodation_cost: '1220.00'
                      max_accommodation_cost_currency: SAR
                    business_travel_transportation_attributes:
                      airticket_class:
                        '0': false
                        '1': false
                        '2': false
                      travel_type:
                        '0': true
                        '1': true
                        '2': true
                        '3': true
                      max_airticket_cost: '1200.00'
                      max_airticket_cost_currency: SAR
                      max_travel_cost: '1200.00'
                      max_travel_cost_currency: SAR
                      transportation_payments_attributes:
                      - _destroy: false
                        financial_transaction_amount: '12.00'
                        financial_transaction_amount_currency: SAR
                        financial_transaction_type_id: 9139
                        travel_type: 0
                      - _destroy: false
                        financial_transaction_amount: '12.00'
                        financial_transaction_amount_currency: SAR
                        financial_transaction_type_id: 12116
                        travel_type: 1
                      - _destroy: false
                        financial_transaction_amount: '230.00'
                        financial_transaction_amount_currency: SAR
                        financial_transaction_type_id: 9139
                        travel_type: 2
                      - _destroy: false
                        financial_transaction_amount: '200.00'
                        financial_transaction_amount_currency: SAR
                        financial_transaction_type_id: 29795
                        travel_type: 3
                  '1':
                    _destroy: false
                    category: international
                    per_diem: '1200.00'
                    per_diem_currency: SAR
                    departure_country:
                    - 7
                    departure_city: []
                    arrival_country:
                    - 35
                    arrival_city: []
                    business_travel_accommodation_attributes:
                      hotel_tier:
                        '1': false
                        '2': true
                        '3': false
                        '4': true
                        '5': false
                      period_type: night
                      max_accommodation_cost: '1200.00'
                      max_accommodation_cost_currency: SAR
                    business_travel_transportation_attributes:
                      airticket_class:
                        '0': false
                        '1': true
                        '2': true
                      travel_type:
                        '0': false
                        '1': false
                        '2': false
                        '3': false
                      max_airticket_cost: '12300.00'
                      max_airticket_cost_currency: SAR
                      max_travel_cost: ''
                      max_travel_cost_currency: SAR
  /branches/{branch_id}/business_travel_policies/{business_travel_policy_id}:
    get:
      summary: 2. View Business Travel Policy
      tags:
      - Business Travel Policies
      operationId: 2ViewBusinessTravelPolicy
      responses:
        '200':
          description: Successful response
        '401':
          description: Unauthorized
        '404':
          description: Not found
      parameters:
      - name: branch_id
        in: path
        required: true
        schema:
          type: string
      - name: business_travel_policy_id
        in: path
        required: true
        schema:
          type: string
    put:
      summary: 3. Update Business Travel Policy
      tags:
      - Business Travel Policies
      operationId: 3UpdateBusinessTravelPolicy
      responses:
        '200':
          description: Successful response
        '401':
          description: Unauthorized
        '404':
          description: Not found
      parameters:
      - name: branch_id
        in: path
        required: true
        schema:
          type: string
      - name: business_travel_policy_id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
            example:
              business_travel_policy:
                name:
                  ar: بي تي
                  en: bt
                position_ids:
                - '811'
                - '42569'
                - '58816'
                - '58806'
                business_travel_destinations_attributes:
                  '0':
                    _destroy: false
                    id: 1
                    category: international
                    per_diem: '22.00'
                    per_diem_currency: SAR
                    departure_country:
                    - 7
                    departure_city:
                    - ''
                    arrival_country:
                    - 28
                    arrival_city:
                    - ''
                    business_travel_accommodation_attributes:
                      id: 1
                      hotel_tier:
                        '1': false
                        '2': false
                        '3': false
                        '4': false
                        '5': false
                      period_type: night
                      max_accommodation_cost: ''
                      max_accommodation_cost_currency: SAR
                    business_travel_transportation_attributes:
                      id: 1
                      airticket_class:
                        '0': false
                        '1': false
                        '2': false
                      travel_type:
                        '0': false
                        '1': false
                        '2': false
                        '3': false
                      max_airticket_cost: ''
                      max_airticket_cost_currency: SAR
                      max_travel_cost: ''
                      max_travel_cost_currency: SAR
                  '1':
                    _destroy: false
                    id: 2
                    category: domestic
                    country: 1
                    per_diem: '11.00'
                    per_diem_currency: SAR
                    departure_country: []
                    departure_city:
                    - ''
                    - 1
                    arrival_country: []
                    arrival_city:
                    - ''
                    - 4
                    business_travel_accommodation_attributes:
                      id: 2
                      hotel_tier:
                        '1': false
                        '2': false
                        '3': false
                        '4': false
                        '5': false
                      period_type: night
                      max_accommodation_cost: ''
                      max_accommodation_cost_currency: SAR
                    business_travel_transportation_attributes:
                      id: 2
                      airticket_class:
                        '0': false
                        '1': false
                        '2': false
                      travel_type:
                        '0': true
                        '1': false
                        '2': true
                        '3': false
                      max_airticket_cost: ''
                      max_airticket_cost_currency: SAR
                      max_travel_cost: ''
                      max_travel_cost_currency: SAR
                  '2':
                    _destroy: false
                    id: 516
                    category: international
                    per_diem: '4.00'
                    per_diem_currency: SAR
                    departure_country:
                    - 23
                    departure_city:
                    - ''
                    arrival_country:
                    - 23
                    arrival_city:
                    - ''
                    business_travel_accommodation_attributes:
                      id: 516
                      hotel_tier:
                        '1': false
                        '2': false
                        '3': true
                        '4': false
                        '5': true
                      period_type: night
                      max_accommodation_cost: ''
                      max_accommodation_cost_currency: SAR
                    business_travel_transportation_attributes:
                      id: 516
                      airticket_class:
                        '0': true
                        '1': false
                        '2': false
                      travel_type:
                        '0': false
                        '1': false
                        '2': false
                        '3': false
                      max_airticket_cost: ''
                      max_airticket_cost_currency: SAR
                      max_travel_cost: ''
                      max_travel_cost_currency: SAR
                  '3':
                    _destroy: false
                    id: 622
                    category: domestic
                    country: 4
                    per_diem: '699.00'
                    per_diem_currency: SAR
                    departure_country: []
                    departure_city:
                    - ''
                    - 82
                    arrival_country: []
                    arrival_city:
                    - ''
                    - 82
                    business_travel_accommodation_attributes:
                      id: 622
                      hotel_tier:
                        '1': false
                        '2': false
                        '3': false
                        '4': false
                        '5': false
                      period_type: night
                      max_accommodation_cost: ''
                      max_accommodation_cost_currency: SAR
                    business_travel_transportation_attributes:
                      id: 622
                      airticket_class:
                        '0': false
                        '1': false
                        '2': false
                      travel_type:
                        '0': false
                        '1': false
                        '2': false
                        '3': false
                      max_airticket_cost: ''
                      max_airticket_cost_currency: SAR
                      max_travel_cost: ''
                      max_travel_cost_currency: SAR
    delete:
      summary: 5. Delete Business Travel Policy
      tags:
      - Business Travel Policies
      operationId: 5DeleteBusinessTravelPolicy
      responses:
        '200':
          description: Successful response
        '401':
          description: Unauthorized
        '404':
          description: Not found
      parameters:
      - name: branch_id
        in: path
        required: true
        schema:
          type: string
      - name: business_travel_policy_id
        in: path
        required: true
        schema:
          type: string
components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.zenhr.com/en/oauth/authorize
          tokenUrl: https://api.zenhr.com/en/oauth/token
          scopes:
            read:branch: Read branch data
            read:employee: Read employee data
            accessed_employees_branches:employee: Access employees within permitted branches
            read:professional_info: Read employee professional information
            read:termination: Read termination data
            read:employee_disciplinary_actions: Read employee disciplinary actions
            read:financial_transaction: Read financial transactions
            read:performance_evaluation: Read performance evaluations
            read:timeoff_transaction: Read time-off transactions