actions:
- name: "Get Auth Token"
type: "http_request"
method: "POST"
url: "https://api.example.com/token"
headers:
Content-Type: "application/x-www-form-urlencoded"
data:
auth_type: "DEV"
grant_type: "password"
username: "dummy_user"
password: "dummy_pass"
set:
access_token: output.access_token
- name: "Fetch Destination City Code"
type: "http_request"
method: "GET"
url: "https://api.example.com/cities"
headers:
Authorization: "Bearer {{ vars.access_token }}"
data:
zipCode: "{{ request.destination.postal_code }}"
set:
destination_city_code: output.city_id
- name: "Generate Shipping Quote"
type: "http_request"
method: "POST"
url: "https://api.example.com/shipping"
headers:
Authorization: "Bearer {{ vars.access_token }}"
Content-Type: "application/json"
data:
OriginZipCode: "{{ request.origin.postal_code }}"
OriginCityId: 1234
DestinationZipCode: "{{ request.destination.postal_code }}"
DestinationCityId: "{{ vars.destination_city_code }}"
TotalWeight: 10.0
InvoiceValue: 999.99
ReceiverCpfcnpj: "00000000000000"
ContactName: "Contact Name"
ContactPhoneNumber: "123456789"
Packs:
- AmountPackages: 1
set:
carrier_name: "Example Carrier"
carrier_code: "EXPRESS"
price: output.total_price
currency: "BRL"
type: "ship"
min_delivery_date: "2025-01-01T00:00:00-0300"
max_delivery_date: "2025-01-05T00:00:00-0300"
phone_required: true
reference: "dummy_ref"