Skip to main content

Workflow Rate Quote Type

A Workflow Rate Quote Type is a special workflow type that defines the process for generating a rate quote.

When to Use a Workflow Rate Quote Type

  • To get a rate quote for a shipment and specific shipper and consignee details.

Inputs

A Workflow Rate Quote Type must provide the following inputs:

  • orderId: Order ID. (Required)
  • fromOrderEntityId: From order entity ID. (Optional). If not provided, first shipper order entity will be used.
  • toOrderEntityId: To order entity ID. (Optional). If not provided, first consignee order entity will be used.
  • commodityIds: Commodity IDs. (Optional). If not provided, all commodities will be used.

Outputs

A Workflow Rate Quote Type must provide the following outputs:

  • quotes: List of rate quote objects. (Required)
{
"quotes": [
{
"quoteDate": "2024-01-01",
"quoteNumber": "123456",
"serviceName": "FEDEX Ground",
"serviceCode": "03",
"transitDays": 3,
"charges": [],
"total": 100
}
]
}

Quote Object

  • quoteDate: Date of the quote.
  • quoteNumber: Quote number. Provided by the carrier.
  • serviceName: Service name. Example: FEDEX Ground, UPS Ground, etc.
  • serviceCode: Service code. Example: 03, 02, etc.
  • transitDays: Transit days. (Optional)
  • charges: List of charges of the quote.
  • total: Total of the quote.
{
"quoteDate": "2024-01-01",
"quoteNumber": "123456",
"serviceName": "FEDEX Ground",
"serviceCode": "03",
"transitDays": 3,
"charges": [],
"total": 100
}

Tags

A Workflow Rate Quote Type must have the following tags:

  • rateQuote: Indicates that the workflow is a rate quote workflow.

Example

workflow:
name: "Rate Quote"
workflowId: "2e28201d-704e-40b1-8568-7a87d198e255"
isActive: true
workflowType: "Quote"
executionMode: "Sync" # Rate quote workflows can only be executed in Sync mode
version: "1.0"
tags:
- "rateQuote"

inputs:
- name: "orderId"
type: "number"
props:
required: true

# Optional for multi leg orders
- name: "fromOrderEntityId" # Shipper
type: "number"
props:
required: false

# Intermediate warehouse
- name: "toOrderEntityId"
type: "number"
props:
required: false

outputs:
- name: "quotes"
mapping: "getRateQuote.quotes" # List of rate quote objects

activities:
- name: "getOrder"
tasks:
- task: "Query/GraphQL"
name: "getOrder"
inputs:
query: |
query($orderId: Int!, $organizationId: Int!) {
order(orderId: $orderId, organizationId: $organizationId) {
...OrderFields
}
}
variables:
orderId: "{{ orderId }}"
organizationId: "{{ organizationId }}"
outputs:
- name: "order"
mapping: "order"

- name: "getRateQuote"
tasks:
- task: "Utilities/HttpRequest"
name: "getRateQuote"
inputs:
url: "https://api.carrier.com/rate-quote"
method: "POST"
headers:
Authorization: "Bearer {{ apiKey }}"
body:
orderId: "{{ orderId }}"
origin: "{{ order.origin }}"
destination: "{{ order.destination }}"
commodities: "{{ order.commodities }}"
outputs:
- name: "quotes"
mapping: "quotes"

- name: "mapQuotes"
tasks:
- task: "Utilities/Map"
name: "mapQuotes"
inputs:
data: "{{ getRateQuote.quotes }}"
mapping: "quotes"
outputs:
- name: "quotes"
mapping: "quotes"