<?xml version="1.0" encoding="UTF-8" ?>
  {% spaceless %}
  <FDXRateRequest xmlns:api="http://www.fedex.com/fsmapi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FDXRateRequest.xsd">

    <RequestHeader>
      <AccountNumber>{{ config.account }}</AccountNumber>
      <MeterNumber>{{ config.meter }}</MeterNumber>
      <CarrierCode>FDXG</CarrierCode>
    </RequestHeader>

    <Service>{{ config.ship_type }}</Service>
    <Packaging>{{ config.packaging }}</Packaging>
    <WeightUnits>{{ box_weight_units|upper }}S</WeightUnits>
    <Weight>{{ box_weight }}</Weight>

    <OriginAddress>
      <StateOrProvinceCode>{{ shipping_address.state }}</StateOrProvinceCode>
      <PostalCode>{{ shipping_address.postal_code|cut:" " }}</PostalCode>
      <CountryCode>{{ shipping_country_code }}</CountryCode>
    </OriginAddress>

    <DestinationAddress>
      <StateOrProvinceCode>{{ contact.shipping_address.state }}</StateOrProvinceCode>
      <PostalCode>{{ contact.shipping_address.postal_code|cut:" " }}</PostalCode>
      <CountryCode>{{ contact.shipping_address.country.iso2_code }}</CountryCode>
    </DestinationAddress>

    <Payment>
      <PayorType>SENDER</PayorType>
    </Payment>

    <DeclaredValue>
      <Value>{{ box_price }}</Value>
      <CurrencyCode>USD</CurrencyCode>
    </DeclaredValue>
    <PackageCount>1</PackageCount>
  </FDXRateRequest>
  {% endspaceless %}
