Mews · Arazzo Workflow

Mews Check Out Reservation

Version 1.0.0

Locate a started reservation and process it (check out) closing its bills.

1 workflow 1 source API 1 provider
View Spec View on GitHub HospitalityHotelPMSProperty ManagementTravelBookingReservationsCloudSaaSArazzoWorkflows

Provider

mews-com

Workflows

check-out-reservation
Verify a reservation is started and process it to check the guest out.
Reads the reservation to confirm it is in the Started state, then processes it to complete check-out and close the associated bills.
2 steps inputs: accessToken, client, clientToken, endUtc, enterpriseId, reservationId, serviceId, startUtc outputs: priorState, reservationId
1
getReservation
reservations_getAll
Load the reservation and confirm it is in the Started state so it can be processed (checked out).
2
processReservation
reservations_process
Process the reservation to complete check-out, closing its bills.

Source API Descriptions

Arazzo Workflow Specification

mews-com-check-out-reservation-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Mews Check Out Reservation
  summary: Locate a started reservation and process it (check out) closing its bills.
  description: >-
    The Mews front-desk departure pattern. The Connector API reservations/getAll
    action locates the reservation and confirms it is in the Started state, then
    reservations/process marks the guest as checked out, closing the reservation
    bills. Each step inlines its action-style POST body with the ClientToken,
    AccessToken, and Client authentication fields Mews requires so the flow reads
    and runs without opening the OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: connectorApi
  url: ../openapi/mews-connector-api-openapi.yml
  type: openapi
workflows:
- workflowId: check-out-reservation
  summary: Verify a reservation is started and process it to check the guest out.
  description: >-
    Reads the reservation to confirm it is in the Started state, then processes
    it to complete check-out and close the associated bills.
  inputs:
    type: object
    required:
    - clientToken
    - accessToken
    - client
    - enterpriseId
    - reservationId
    - serviceId
    - startUtc
    - endUtc
    properties:
      clientToken:
        type: string
        description: The Mews ClientToken identifying the integration.
      accessToken:
        type: string
        description: The Mews AccessToken identifying the enterprise.
      client:
        type: string
        description: The client application name and version.
      enterpriseId:
        type: string
        description: The enterprise (property) the reservation belongs to.
      reservationId:
        type: string
        description: The reservation to check out.
      serviceId:
        type: string
        description: The bookable service the reservation belongs to.
      startUtc:
        type: string
        description: Lower bound of the reservation collision interval, in UTC.
      endUtc:
        type: string
        description: Upper bound of the reservation collision interval, in UTC.
  steps:
  - stepId: getReservation
    description: >-
      Load the reservation and confirm it is in the Started state so it can be
      processed (checked out).
    operationId: reservations_getAll
    requestBody:
      contentType: application/json
      payload:
        ClientToken: $inputs.clientToken
        AccessToken: $inputs.accessToken
        Client: $inputs.client
        StartUtc: $inputs.startUtc
        EndUtc: $inputs.endUtc
        ServiceIds:
        - $inputs.serviceId
        ReservationIds:
        - $inputs.reservationId
        States:
        - Started
        Extent:
          Reservations: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      reservationState: $response.body#/Reservations/0/State
    onSuccess:
    - name: isStarted
      type: goto
      stepId: processReservation
      criteria:
      - context: $response.body
        condition: $.Reservations.length > 0
        type: jsonpath
    - name: notStarted
      type: end
      criteria:
      - context: $response.body
        condition: $.Reservations.length == 0
        type: jsonpath
  - stepId: processReservation
    description: >-
      Process the reservation to complete check-out, closing its bills.
    operationId: reservations_process
    requestBody:
      contentType: application/json
      payload:
        ClientToken: $inputs.clientToken
        AccessToken: $inputs.accessToken
        Client: $inputs.client
        EnterpriseId: $inputs.enterpriseId
        ReservationId: $inputs.reservationId
        CloseBills: true
        AllowOpenBalance: false
    successCriteria:
    - condition: $statusCode == 200
  outputs:
    reservationId: $inputs.reservationId
    priorState: $steps.getReservation.outputs.reservationState