{% liquid
assign address = shopify_rate_check.destination.address1 | downcase | replace: ".", ""
assign is_po_box = address contains "po box"
assign ground_price = 1200
assign expedited_price = 2200
%}
{
"rates": [
{
"service_name": {{ "Postal Ground" | json }},
"service_code": "GROUND_PO",
"currency": {{ shopify_rate_check.currency | json }},
"total_price": {{ ground_price }},
"description": {{ "Safe delivery for PO boxes" | json }}
}
{% unless is_po_box %}
,
{
"service_name": {{ "Courier Express" | json }},
"service_code": "EXPRESS",
"currency": {{ shopify_rate_check.currency | json }},
"total_price": {{ expedited_price }},
"description": {{ "Hand-delivered express service" | json }}
}
{% endunless %}
]
}