Mews · Arazzo Workflow

Mews Quote Rate Pricing

Version 1.0.0

Resolve a rate on a service, then read its price across a date range.

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

Provider

mews-com

Workflows

quote-rate-pricing
Resolve a rate and read its pricing for a date range.
Loads the rate for a service and returns its base amount prices across the requested time-unit range.
2 steps inputs: accessToken, client, clientToken, enterpriseId, firstTimeUnitStartUtc, lastTimeUnitStartUtc, rateId, serviceId outputs: baseAmountPrices, currency, rateId
1
getRate
rates_getAll
Resolve the rate for the service so pricing can be read against it.
2
getRatePricing
rates_getPricing
Read the rate's base amount prices across the requested time-unit range.

Source API Descriptions

Arazzo Workflow Specification

mews-com-quote-rate-pricing-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Mews Quote Rate Pricing
  summary: Resolve a rate on a service, then read its price across a date range.
  description: >-
    The Mews rate-quote pattern. The Connector API rates/getAll action resolves
    the rate for a service, and rates/getPricing returns the base amount prices
    per time unit across a date range. 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: quote-rate-pricing
  summary: Resolve a rate and read its pricing for a date range.
  description: >-
    Loads the rate for a service and returns its base amount prices across the
    requested time-unit range.
  inputs:
    type: object
    required:
    - clientToken
    - accessToken
    - client
    - enterpriseId
    - serviceId
    - rateId
    - firstTimeUnitStartUtc
    - lastTimeUnitStartUtc
    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 rate belongs to.
      serviceId:
        type: string
        description: The service the rate belongs to.
      rateId:
        type: string
        description: The rate to quote.
      firstTimeUnitStartUtc:
        type: string
        description: Start of the first time unit to price, in UTC.
      lastTimeUnitStartUtc:
        type: string
        description: Start of the last time unit to price, in UTC.
  steps:
  - stepId: getRate
    description: >-
      Resolve the rate for the service so pricing can be read against it.
    operationId: rates_getAll
    requestBody:
      contentType: application/json
      payload:
        ClientToken: $inputs.clientToken
        AccessToken: $inputs.accessToken
        Client: $inputs.client
        EnterpriseIds:
        - $inputs.enterpriseId
        ServiceIds:
        - $inputs.serviceId
        RateIds:
        - $inputs.rateId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      resolvedRateId: $response.body#/Rates/0/Id
    onSuccess:
    - name: found
      type: goto
      stepId: getRatePricing
      criteria:
      - context: $response.body
        condition: $.Rates.length > 0
        type: jsonpath
    - name: notFound
      type: end
      criteria:
      - context: $response.body
        condition: $.Rates.length == 0
        type: jsonpath
  - stepId: getRatePricing
    description: >-
      Read the rate's base amount prices across the requested time-unit range.
    operationId: rates_getPricing
    requestBody:
      contentType: application/json
      payload:
        ClientToken: $inputs.clientToken
        AccessToken: $inputs.accessToken
        Client: $inputs.client
        RateId: $steps.getRate.outputs.resolvedRateId
        FirstTimeUnitStartUtc: $inputs.firstTimeUnitStartUtc
        LastTimeUnitStartUtc: $inputs.lastTimeUnitStartUtc
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      currency: $response.body#/Currency
      baseAmountPrices: $response.body#/BaseAmountPrices
  outputs:
    rateId: $steps.getRate.outputs.resolvedRateId
    currency: $steps.getRatePricing.outputs.currency
    baseAmountPrices: $steps.getRatePricing.outputs.baseAmountPrices