diff --git a/pom.xml b/pom.xml index b16a5b9..61838e2 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ org.projectlombok lombok - 1.18.22 + 1.18.38 provided diff --git a/src/main/java/io/ljunggren/fedex/api/model/Dimension.java b/src/main/java/io/ljunggren/fedex/api/model/Dimension.java index 4ddc682..f27454b 100644 --- a/src/main/java/io/ljunggren/fedex/api/model/Dimension.java +++ b/src/main/java/io/ljunggren/fedex/api/model/Dimension.java @@ -1,22 +1,24 @@ -package io.ljunggren.fedex.api.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class Dimension { - - private Integer length; - private Integer width; - private Integer height; - @JsonProperty("units") - private DimensionUnit unit; - -} +package io.ljunggren.fedex.api.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class Dimension { + + private Integer length; + private Integer width; + private Integer height; + @JsonProperty("units") + private DimensionUnit unit; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/PackageType.java b/src/main/java/io/ljunggren/fedex/api/model/PackageType.java new file mode 100644 index 0000000..2679aed --- /dev/null +++ b/src/main/java/io/ljunggren/fedex/api/model/PackageType.java @@ -0,0 +1,46 @@ +package io.ljunggren.fedex.api.model; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import lombok.Getter; + +@Getter +public enum PackageType { + + FEDEX_ENVELOPE("FEDEX_ENVELOPE", "FedEx Envelope", false, false), + CUSTOM_PACKAGE("YOUR_PACKAGING", "Custom Package", true, true), + FEDEX_SMALL_BOX("FEDEX_SMALL_BOX", "FedEx Small Box", false, true), + FEDEX_MEDIUM_BOX("FEDEX_MEDIUM_BOX", "FedEx Medium Box", false, true), + FEDEX_LARGE_BOX("FEDEX_LARGE_BOX", "FedEx Large Box", false, true), + FEDEX_EXTRA_LARGE_BOX("FEDEX_EXTRA_LARGE_BOX", "FedEx Extra Large Box", false, true), + FEDEX_TUBE("FEDEX_TUBE", "FedEx Tube", false, true), + FEDEX_PAK("FEDEX_PAK", "FedEx Pak", false, true); + + private String value; + private String text; + private boolean dimensional; + private boolean multipackage; + + private PackageType(String value, String text, boolean dimensional, boolean multipackage) { + this.value = value; + this.text = text; + this.dimensional = dimensional; + this.multipackage = multipackage; + } + + public static List getNonDimensionals() { + return Arrays.stream(PackageType.values()) + .filter(type -> !type.isDimensional()) + .collect(Collectors.toList()); + } + + public static PackageType getByValue(String value) { + return Arrays.stream(PackageType.values()) + .filter(type -> type.getValue().equals(value)) + .findFirst() + .orElse(null); + } + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/request/Commodity.java b/src/main/java/io/ljunggren/fedex/api/model/rate/request/Commodity.java new file mode 100644 index 0000000..3c8332f --- /dev/null +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/request/Commodity.java @@ -0,0 +1,23 @@ +package io.ljunggren.fedex.api.model.rate.request; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import io.ljunggren.fedex.api.model.tracking.response.CurrencyValue; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class Commodity { + + private String description; + private String countryOfManufacture; + private Integer quantity; + private CurrencyValue unitPrice; + private CurrencyValue customsValue; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/request/CustomsClearanceDetail.java b/src/main/java/io/ljunggren/fedex/api/model/rate/request/CustomsClearanceDetail.java new file mode 100644 index 0000000..04d3f06 --- /dev/null +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/request/CustomsClearanceDetail.java @@ -0,0 +1,19 @@ +package io.ljunggren.fedex.api.model.rate.request; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import lombok.Data; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class CustomsClearanceDetail { + + private List commodities; + private DutiesPayment dutiesPayment; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/request/DutiesPayment.java b/src/main/java/io/ljunggren/fedex/api/model/rate/request/DutiesPayment.java new file mode 100644 index 0000000..48b8ddb --- /dev/null +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/request/DutiesPayment.java @@ -0,0 +1,16 @@ +package io.ljunggren.fedex.api.model.rate.request; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import lombok.Data; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class DutiesPayment { + + private String paymentType = "SENDER"; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/request/RateRequest.java b/src/main/java/io/ljunggren/fedex/api/model/rate/request/RateRequest.java index b6abd17..9cc7833 100644 --- a/src/main/java/io/ljunggren/fedex/api/model/rate/request/RateRequest.java +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/request/RateRequest.java @@ -1,16 +1,23 @@ -package io.ljunggren.fedex.api.model.rate.request; - -import io.ljunggren.fedex.api.model.AccountNumber; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class RateRequest { - - private AccountNumber accountNumber; - private RequestedShipment requestedShipment; - -} +package io.ljunggren.fedex.api.model.rate.request; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import io.ljunggren.fedex.api.model.AccountNumber; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class RateRequest { + + private AccountNumber accountNumber; + private RateRequestControlParameters rateRequestControlParameters; + private RequestedShipment requestedShipment; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/request/RateRequestControlParameters.java b/src/main/java/io/ljunggren/fedex/api/model/rate/request/RateRequestControlParameters.java new file mode 100644 index 0000000..88a8b4f --- /dev/null +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/request/RateRequestControlParameters.java @@ -0,0 +1,16 @@ +package io.ljunggren.fedex.api.model.rate.request; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import lombok.Data; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class RateRequestControlParameters { + + private boolean returnTransitTimes; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/request/RequestedShipment.java b/src/main/java/io/ljunggren/fedex/api/model/rate/request/RequestedShipment.java index 74007b8..fe69fd1 100644 --- a/src/main/java/io/ljunggren/fedex/api/model/rate/request/RequestedShipment.java +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/request/RequestedShipment.java @@ -1,28 +1,30 @@ -package io.ljunggren.fedex.api.model.rate.request; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; - -import io.ljunggren.fedex.api.model.LocationContactAndAddress; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@JsonInclude(Include.NON_NULL) -public class RequestedShipment { - - private LocationContactAndAddress shipper; - private LocationContactAndAddress recipient; - private PickupType pickupType; - @JsonProperty("rateRequestType") - private List rateRequestTypes; - private List requestedPackageLineItems; - private List carrierCodes; - -} +package io.ljunggren.fedex.api.model.rate.request; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; + +import io.ljunggren.fedex.api.model.LocationContactAndAddress; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class RequestedShipment { + + private LocationContactAndAddress shipper; + private LocationContactAndAddress recipient; + private String shipDateStamp; + private PickupType pickupType; + @JsonProperty("rateRequestType") + private List rateRequestTypes; + private List requestedPackageLineItems; + private List carrierCodes; + private CustomsClearanceDetail customsClearanceDetail; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/response/OperationalDetail.java b/src/main/java/io/ljunggren/fedex/api/model/rate/response/OperationalDetail.java index bf45b61..29c24fa 100644 --- a/src/main/java/io/ljunggren/fedex/api/model/rate/response/OperationalDetail.java +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/response/OperationalDetail.java @@ -1,23 +1,17 @@ -package io.ljunggren.fedex.api.model.rate.response; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(Include.NON_NULL) -public class OperationalDetail { - - private boolean ineligibleForMoneyBackGuarantee; - private String astraDescription; - private String airportId; - private String serviceCode; - -} +package io.ljunggren.fedex.api.model.rate.response; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import lombok.Data; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class OperationalDetail { + + private boolean ineligibleForMoneyBackGuarantee; + private String deliveryDate; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/response/RateOutput.java b/src/main/java/io/ljunggren/fedex/api/model/rate/response/RateOutput.java index 5649d5c..624ae48 100644 --- a/src/main/java/io/ljunggren/fedex/api/model/rate/response/RateOutput.java +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/response/RateOutput.java @@ -1,24 +1,26 @@ -package io.ljunggren.fedex.api.model.rate.response; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(Include.NON_NULL) -public class RateOutput { - - private List rateReplyDetails; - private String quoteDate; - private boolean encoded; - -} +package io.ljunggren.fedex.api.model.rate.response; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import io.ljunggren.fedex.api.model.Alert; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class RateOutput { + + private List rateReplyDetails; + private String quoteDate; + private boolean encoded; + private List alerts; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/response/ShipmentRateDetail.java b/src/main/java/io/ljunggren/fedex/api/model/rate/response/ShipmentRateDetail.java index 2693a5b..bef7ea4 100644 --- a/src/main/java/io/ljunggren/fedex/api/model/rate/response/ShipmentRateDetail.java +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/response/ShipmentRateDetail.java @@ -1,28 +1,31 @@ -package io.ljunggren.fedex.api.model.rate.response; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(Include.NON_NULL) -public class ShipmentRateDetail { - - private String rateZone; - private Double fuelSurchargePercent; - private Double totalSurcharges; - private Double totalFreightDiscount; - private List surCharges; - private String pricingCode; // TODO: change to enum - private String currency; // TODO: change to enum - -} +package io.ljunggren.fedex.api.model.rate.response; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class ShipmentRateDetail { + + private String rateZone; + private Double fuelSurchargePercent; + private Double totalSurcharges; + private Double totalFreightDiscount; + @JsonProperty("freightDiscount") + private List freightDiscounts; + private List surCharges; + private String pricingCode; // TODO: change to enum + private String currency; // TODO: change to enum + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/rate/response/SurCharge.java b/src/main/java/io/ljunggren/fedex/api/model/rate/response/SurCharge.java index f0c1500..8659d8b 100644 --- a/src/main/java/io/ljunggren/fedex/api/model/rate/response/SurCharge.java +++ b/src/main/java/io/ljunggren/fedex/api/model/rate/response/SurCharge.java @@ -1,22 +1,23 @@ -package io.ljunggren.fedex.api.model.rate.response; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(Include.NON_NULL) -public class SurCharge { - - private String type; // TODO: change to enum - private String description; - private Double amount; - -} +package io.ljunggren.fedex.api.model.rate.response; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(Include.NON_NULL) +public class SurCharge { + + private String type; // TODO: change to enum + private String description; + private Double amount; + private Double percent; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/tracking/response/CurrencyValue.java b/src/main/java/io/ljunggren/fedex/api/model/tracking/response/CurrencyValue.java new file mode 100644 index 0000000..41763db --- /dev/null +++ b/src/main/java/io/ljunggren/fedex/api/model/tracking/response/CurrencyValue.java @@ -0,0 +1,18 @@ +package io.ljunggren.fedex.api.model.tracking.response; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class CurrencyValue { + + private String currency; + private Double value; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/tracking/response/PackageDetail.java b/src/main/java/io/ljunggren/fedex/api/model/tracking/response/PackageDetail.java index 514b784..a00f5f7 100644 --- a/src/main/java/io/ljunggren/fedex/api/model/tracking/response/PackageDetail.java +++ b/src/main/java/io/ljunggren/fedex/api/model/tracking/response/PackageDetail.java @@ -1,29 +1,29 @@ -package io.ljunggren.fedex.api.model.tracking.response; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class PackageDetail { - - private String physicalPackagingType; - private String sequenceNumber; - private String undeliveredCount; - private Detail packagingDescription; - private String count; - @JsonProperty("weightAndDimensions") - private WeightAndDimension weightAndDimension; - private List packageContent; - private String contentPieceCount; - private Value declaredValue; - -} +package io.ljunggren.fedex.api.model.tracking.response; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class PackageDetail { + + private String physicalPackagingType; + private String sequenceNumber; + private String undeliveredCount; + private Detail packagingDescription; + private String count; + @JsonProperty("weightAndDimensions") + private WeightAndDimension weightAndDimension; + private List packageContent; + private String contentPieceCount; + private CurrencyValue declaredValue; + +} diff --git a/src/main/java/io/ljunggren/fedex/api/model/tracking/response/Value.java b/src/main/java/io/ljunggren/fedex/api/model/tracking/response/Value.java deleted file mode 100644 index f84949f..0000000 --- a/src/main/java/io/ljunggren/fedex/api/model/tracking/response/Value.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.ljunggren.fedex.api.model.tracking.response; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class Value { - - private String currency; - private Double value; - -} diff --git a/src/main/java/io/ljunggren/fedex/api/service/BaseService.java b/src/main/java/io/ljunggren/fedex/api/service/BaseService.java index f26f444..048417d 100644 --- a/src/main/java/io/ljunggren/fedex/api/service/BaseService.java +++ b/src/main/java/io/ljunggren/fedex/api/service/BaseService.java @@ -1,58 +1,58 @@ -package io.ljunggren.fedex.api.service; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.List; - -import org.apache.http.HttpResponse; -import org.apache.http.client.config.CookieSpecs; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; - -import com.fasterxml.jackson.core.JsonProcessingException; - -import io.ljunggren.json.utils.JsonUtils; - -public class BaseService { - - protected String domain; - - protected BaseService(String domain) { - this.domain = domain; - } - - protected static final List KNOWN_RESPONSE_CODES = Arrays.asList(new Integer[] { - 200, 400, 401, 403, 404, 500, 503 - }); - protected static final int THROTTLING_CODE = 429; - - protected CloseableHttpClient getHttpClient() { - return HttpClients.custom() - .setDefaultRequestConfig(RequestConfig.custom() - .setCookieSpec(CookieSpecs.STANDARD).build()) - .build(); - } - - protected static String getResult(HttpResponse response) throws UnsupportedOperationException, IOException { - BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent(), StandardCharsets.UTF_8)); - StringBuilder result = new StringBuilder(); - String line = new String(); - while ((line = rd.readLine()) != null) { - result.append(line); - } - return result.toString(); - } - - protected T parse(String json, Class clazz) throws Exception { - try { - return JsonUtils.jsonToObject(json, clazz); - } catch (JsonProcessingException e) { - throw new Exception("Unable to parse response"); - } - } - -} +package io.ljunggren.fedex.api.service; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + +import org.apache.http.HttpResponse; +import org.apache.http.client.config.CookieSpecs; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; + +import com.fasterxml.jackson.core.JsonProcessingException; + +import io.ljunggren.json.utils.JsonUtils; + +public class BaseService { + + protected String domain; + + protected BaseService(String domain) { + this.domain = domain; + } + + protected static final List KNOWN_RESPONSE_CODES = Arrays.asList(new Integer[] { + 200, 400, 401, 403, 404, 500, 503 + }); + protected static final int THROTTLING_CODE = 429; + + protected CloseableHttpClient getHttpClient() { + return HttpClients.custom() + .setDefaultRequestConfig(RequestConfig.custom() + .setCookieSpec(CookieSpecs.STANDARD).build()) + .build(); + } + + protected static String getResult(HttpResponse response) throws UnsupportedOperationException, IOException { + BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent(), StandardCharsets.UTF_8)); + StringBuilder result = new StringBuilder(); + String line = new String(); + while ((line = rd.readLine()) != null) { + result.append(line); + } + return result.toString(); + } + + protected T parse(String json, Class clazz) throws Exception { + try { + return JsonUtils.jsonToObject(json, clazz); + } catch (JsonProcessingException e) { + throw new Exception("Unable to parse response"); + } + } + +} diff --git a/src/main/java/io/ljunggren/fedex/api/service/OauthService.java b/src/main/java/io/ljunggren/fedex/api/service/OauthService.java index 4feb7fd..586dbd4 100644 --- a/src/main/java/io/ljunggren/fedex/api/service/OauthService.java +++ b/src/main/java/io/ljunggren/fedex/api/service/OauthService.java @@ -1,48 +1,48 @@ -package io.ljunggren.fedex.api.service; - -import java.util.Arrays; -import java.util.List; - -import org.apache.http.NameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.message.BasicNameValuePair; - -import io.ljunggren.fedex.api.authorization.AuthToken; - -public class OauthService extends BaseService { - - public OauthService(String domain) { - super(domain); - } - - private final String URI = domain + "/oauth/token"; - - public AuthToken authorize(String clientId, String clientSecret) throws Exception { - return authorize(clientId, clientSecret, getHttpClient()); - } - - public AuthToken authorize(String clientId, String clientSecret, CloseableHttpClient httpClient) throws Exception { - HttpPost post = new HttpPost(URI); - List parameters = generateParameters(clientId, clientSecret); - try { - post.setEntity(new UrlEncodedFormEntity(parameters)); - CloseableHttpResponse response = httpClient.execute(post); - String json = getResult(response); - return parse(json, AuthToken.class); - } finally { - httpClient.close(); - } - } - - private List generateParameters(String clientId, String clientSecret) { - return Arrays.asList(new BasicNameValuePair[] { - new BasicNameValuePair("grant_type", "client_credentials"), - new BasicNameValuePair("client_id", clientId), - new BasicNameValuePair("client_secret", clientSecret) - }); - } - -} +package io.ljunggren.fedex.api.service; + +import java.util.Arrays; +import java.util.List; + +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.message.BasicNameValuePair; + +import io.ljunggren.fedex.api.authorization.AuthToken; + +public class OauthService extends BaseService { + + public OauthService(String domain) { + super(domain); + } + + private final String URI = domain + "/oauth/token"; + + public AuthToken authorize(String clientId, String clientSecret) throws Exception { + return authorize(clientId, clientSecret, getHttpClient()); + } + + public AuthToken authorize(String clientId, String clientSecret, CloseableHttpClient httpClient) throws Exception { + HttpPost post = new HttpPost(URI); + List parameters = generateParameters(clientId, clientSecret); + try { + post.setEntity(new UrlEncodedFormEntity(parameters)); + CloseableHttpResponse response = httpClient.execute(post); + String json = getResult(response); + return parse(json, AuthToken.class); + } finally { + httpClient.close(); + } + } + + private List generateParameters(String clientId, String clientSecret) { + return Arrays.asList(new BasicNameValuePair[] { + new BasicNameValuePair("grant_type", "client_credentials"), + new BasicNameValuePair("client_id", clientId), + new BasicNameValuePair("client_secret", clientSecret) + }); + } + +} diff --git a/src/main/java/io/ljunggren/fedex/api/service/RateService.java b/src/main/java/io/ljunggren/fedex/api/service/RateService.java index cd18b54..1b345d6 100644 --- a/src/main/java/io/ljunggren/fedex/api/service/RateService.java +++ b/src/main/java/io/ljunggren/fedex/api/service/RateService.java @@ -1,63 +1,63 @@ -package io.ljunggren.fedex.api.service; - -import java.io.IOException; - -import org.apache.http.Header; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.message.BasicHeader; - -import io.ljunggren.fedex.api.model.CodeMessage; -import io.ljunggren.fedex.api.model.rate.request.RateRequest; -import io.ljunggren.fedex.api.model.rate.response.RateResponse; -import io.ljunggren.json.utils.JsonUtils; - -public class RateService extends BaseService { - - public RateService(String domain) { - super(domain); - } - - private final String URI = domain + "/rate/v1/rates/quotes"; - - public RateResponse request(RateRequest rateRequest, String accessToken) throws IOException { - return request(rateRequest, accessToken, getHttpClient()); - } - - public RateResponse request(RateRequest rateRequest, String accessToken, CloseableHttpClient httpClient) throws IOException { - HttpPost post = new HttpPost(URI); - Header[] headers = generateHeaders(accessToken); - try { - post.setHeaders(headers); - post.setEntity(new StringEntity(JsonUtils.objectToJson(rateRequest))); - CloseableHttpResponse response = httpClient.execute(post); - int responseCode = response.getStatusLine().getStatusCode(); - String json = getResult(response); - if (KNOWN_RESPONSE_CODES.contains(responseCode)) { - return parse(json, RateResponse.class); - } - if (THROTTLING_CODE == responseCode) { - return new RateResponse().addError( - new CodeMessage("Throttled", "Too many requests")); - } - return new RateResponse().addError( - new CodeMessage("Response Error", String.format("Unknown response code %d", responseCode))); - } catch (Exception e) { - return new RateResponse().addError( - new CodeMessage("Response Error", e.getMessage())); - } finally { - httpClient.close(); - } - } - - private Header[] generateHeaders(String accessToken) { - return new Header[] { - new BasicHeader("content-type", "application/json"), - new BasicHeader("x-locale", "en_US"), - new BasicHeader("authorization", String.format("Bearer %s", accessToken)) - }; - } - -} +package io.ljunggren.fedex.api.service; + +import java.io.IOException; + +import org.apache.http.Header; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.message.BasicHeader; + +import io.ljunggren.fedex.api.model.CodeMessage; +import io.ljunggren.fedex.api.model.rate.request.RateRequest; +import io.ljunggren.fedex.api.model.rate.response.RateResponse; +import io.ljunggren.json.utils.JsonUtils; + +public class RateService extends BaseService { + + public RateService(String domain) { + super(domain); + } + + private final String URI = domain + "/rate/v1/rates/quotes"; + + public RateResponse request(RateRequest rateRequest, String accessToken) throws IOException { + return request(rateRequest, accessToken, getHttpClient()); + } + + public RateResponse request(RateRequest rateRequest, String accessToken, CloseableHttpClient httpClient) throws IOException { + HttpPost post = new HttpPost(URI); + Header[] headers = generateHeaders(accessToken); + try { + post.setHeaders(headers); + post.setEntity(new StringEntity(JsonUtils.objectToJson(rateRequest))); + CloseableHttpResponse response = httpClient.execute(post); + int responseCode = response.getStatusLine().getStatusCode(); + String json = getResult(response); + if (KNOWN_RESPONSE_CODES.contains(responseCode)) { + return parse(json, RateResponse.class); + } + if (THROTTLING_CODE == responseCode) { + return new RateResponse().addError( + new CodeMessage("Throttled", "Too many requests")); + } + return new RateResponse().addError( + new CodeMessage("Response Error", String.format("Unknown response code %d", responseCode))); + } catch (Exception e) { + return new RateResponse().addError( + new CodeMessage("Response Error", e.getMessage())); + } finally { + httpClient.close(); + } + } + + private Header[] generateHeaders(String accessToken) { + return new Header[] { + new BasicHeader("content-type", "application/json"), + new BasicHeader("x-locale", "en_US"), + new BasicHeader("authorization", String.format("Bearer %s", accessToken)) + }; + } + +} diff --git a/src/main/java/io/ljunggren/fedex/api/service/TrackingService.java b/src/main/java/io/ljunggren/fedex/api/service/TrackingService.java index 0f06acd..9196c6d 100644 --- a/src/main/java/io/ljunggren/fedex/api/service/TrackingService.java +++ b/src/main/java/io/ljunggren/fedex/api/service/TrackingService.java @@ -1,63 +1,63 @@ -package io.ljunggren.fedex.api.service; - -import java.io.IOException; - -import org.apache.http.Header; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.message.BasicHeader; - -import io.ljunggren.fedex.api.model.CodeMessage; -import io.ljunggren.fedex.api.model.tracking.request.TrackingRequest; -import io.ljunggren.fedex.api.model.tracking.response.TrackingResponse; -import io.ljunggren.json.utils.JsonUtils; - -public class TrackingService extends BaseService { - - public TrackingService(String domain) { - super(domain); - } - - private final String URI = domain + "/track/v1/trackingnumbers";; - - public TrackingResponse track(TrackingRequest trackingRequest, String accessToken) throws IOException { - return track(trackingRequest, accessToken, getHttpClient()); - } - - public TrackingResponse track(TrackingRequest trackingRequest, String accessToken, CloseableHttpClient httpClient) throws IOException { - HttpPost post = new HttpPost(URI); - Header[] headers = generateHeaders(accessToken); - try { - post.setHeaders(headers); - post.setEntity(new StringEntity(JsonUtils.objectToJson(trackingRequest))); - CloseableHttpResponse response = httpClient.execute(post); - int responseCode = response.getStatusLine().getStatusCode(); - String json = getResult(response); - if (KNOWN_RESPONSE_CODES.contains(responseCode)) { - return parse(json, TrackingResponse.class); - } - if (THROTTLING_CODE == responseCode) { - return new TrackingResponse().addError( - new CodeMessage("Throttled", "Too many requests")); - } - return new TrackingResponse().addError( - new CodeMessage("Tracking Error", String.format("Unknown response code %d", responseCode))); - } catch(Exception e) { - return new TrackingResponse().addError( - new CodeMessage("Tracking Error", e.getMessage())); - } finally { - httpClient.close(); - } - } - - private Header[] generateHeaders(String accessToken) { - return new Header[] { - new BasicHeader("content-type", "application/json"), - new BasicHeader("x-locale", "en_US"), - new BasicHeader("authorization", String.format("Bearer %s", accessToken)) - }; - } - -} +package io.ljunggren.fedex.api.service; + +import java.io.IOException; + +import org.apache.http.Header; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.message.BasicHeader; + +import io.ljunggren.fedex.api.model.CodeMessage; +import io.ljunggren.fedex.api.model.tracking.request.TrackingRequest; +import io.ljunggren.fedex.api.model.tracking.response.TrackingResponse; +import io.ljunggren.json.utils.JsonUtils; + +public class TrackingService extends BaseService { + + public TrackingService(String domain) { + super(domain); + } + + private final String URI = domain + "/track/v1/trackingnumbers";; + + public TrackingResponse track(TrackingRequest trackingRequest, String accessToken) throws IOException { + return track(trackingRequest, accessToken, getHttpClient()); + } + + public TrackingResponse track(TrackingRequest trackingRequest, String accessToken, CloseableHttpClient httpClient) throws IOException { + HttpPost post = new HttpPost(URI); + Header[] headers = generateHeaders(accessToken); + try { + post.setHeaders(headers); + post.setEntity(new StringEntity(JsonUtils.objectToJson(trackingRequest))); + CloseableHttpResponse response = httpClient.execute(post); + int responseCode = response.getStatusLine().getStatusCode(); + String json = getResult(response); + if (KNOWN_RESPONSE_CODES.contains(responseCode)) { + return parse(json, TrackingResponse.class); + } + if (THROTTLING_CODE == responseCode) { + return new TrackingResponse().addError( + new CodeMessage("Throttled", "Too many requests")); + } + return new TrackingResponse().addError( + new CodeMessage("Tracking Error", String.format("Unknown response code %d", responseCode))); + } catch(Exception e) { + return new TrackingResponse().addError( + new CodeMessage("Tracking Error", e.getMessage())); + } finally { + httpClient.close(); + } + } + + private Header[] generateHeaders(String accessToken) { + return new Header[] { + new BasicHeader("content-type", "application/json"), + new BasicHeader("x-locale", "en_US"), + new BasicHeader("authorization", String.format("Bearer %s", accessToken)) + }; + } + +} diff --git a/src/test/java/io/ljunggren/fedex/api/authorization/OauthResponseTest.java b/src/test/java/io/ljunggren/fedex/api/authorization/OauthResponseTest.java index 99f1f28..dcc80eb 100644 --- a/src/test/java/io/ljunggren/fedex/api/authorization/OauthResponseTest.java +++ b/src/test/java/io/ljunggren/fedex/api/authorization/OauthResponseTest.java @@ -1,41 +1,41 @@ -package io.ljunggren.fedex.api.authorization; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; - -import org.apache.commons.io.IOUtils; -import org.junit.Test; - -import io.ljunggren.json.utils.JsonUtils; - -public class OauthResponseTest { - - private String readFromResources(String file) throws IOException { - return IOUtils.toString(this.getClass().getResourceAsStream(file), "UTF-8"); - } - - @Test - public void deserializeTest() throws IOException { - String json = readFromResources("/oauthResponse.json"); - AuthToken response = JsonUtils.jsonToObject(json, AuthToken.class); - assertNotNull(response); - } - - @Test - public void serializeTest() throws IOException { - String json = readFromResources("/oauthResponse.json"); - AuthToken response = JsonUtils.jsonToObject(json, AuthToken.class); - String serializeResponse = JsonUtils.objectToJson(response); - assertTrue(JsonUtils.areEqual(json, serializeResponse)); - } - - @Test - public void deserializeWithErrorTest() throws IOException { - String json = readFromResources("/oauthErrorResponse.json"); - AuthToken response = JsonUtils.jsonToObject(json, AuthToken.class); - assertNotNull(response); - } - -} +package io.ljunggren.fedex.api.authorization; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; + +import org.apache.commons.io.IOUtils; +import org.junit.Test; + +import io.ljunggren.json.utils.JsonUtils; + +public class OauthResponseTest { + + private String readFromResources(String file) throws IOException { + return IOUtils.toString(this.getClass().getResourceAsStream(file), "UTF-8"); + } + + @Test + public void deserializeTest() throws IOException { + String json = readFromResources("/oauthResponse.json"); + AuthToken response = JsonUtils.jsonToObject(json, AuthToken.class); + assertNotNull(response); + } + + @Test + public void serializeTest() throws IOException { + String json = readFromResources("/oauthResponse.json"); + AuthToken response = JsonUtils.jsonToObject(json, AuthToken.class); + String serializeResponse = JsonUtils.objectToJson(response); + assertTrue(JsonUtils.areEqual(json, serializeResponse)); + } + + @Test + public void deserializeWithErrorTest() throws IOException { + String json = readFromResources("/oauthErrorResponse.json"); + AuthToken response = JsonUtils.jsonToObject(json, AuthToken.class); + assertNotNull(response); + } + +} diff --git a/src/test/java/io/ljunggren/fedex/api/factory/TrackingFactoryTest.java b/src/test/java/io/ljunggren/fedex/api/factory/TrackingFactoryTest.java index f24e20b..63aa72d 100644 --- a/src/test/java/io/ljunggren/fedex/api/factory/TrackingFactoryTest.java +++ b/src/test/java/io/ljunggren/fedex/api/factory/TrackingFactoryTest.java @@ -1,28 +1,28 @@ -package io.ljunggren.fedex.api.factory; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import com.fasterxml.jackson.core.JsonProcessingException; - -import io.ljunggren.fedex.api.model.tracking.request.TrackingRequest; - -public class TrackingFactoryTest { - - @Test - public void instantiationTest() { - assertNotNull(new TrackingFactory()); - } - - @Test - public void basicRequestTest() throws JsonProcessingException { - String[] tackingNumbers = new String[] {"449044304137821", "149331877648230", "020207021381215"}; - TrackingRequest request = TrackingFactory.basicRequest(tackingNumbers); - assertTrue(request.isIncludeDetailedScans()); - assertEquals(3, request.getTrackingInfos().size()); - } - -} +package io.ljunggren.fedex.api.factory; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import com.fasterxml.jackson.core.JsonProcessingException; + +import io.ljunggren.fedex.api.model.tracking.request.TrackingRequest; + +public class TrackingFactoryTest { + + @Test + public void instantiationTest() { + assertNotNull(new TrackingFactory()); + } + + @Test + public void basicRequestTest() throws JsonProcessingException { + String[] tackingNumbers = new String[] {"449044304137821", "149331877648230", "020207021381215"}; + TrackingRequest request = TrackingFactory.basicRequest(tackingNumbers); + assertTrue(request.isIncludeDetailedScans()); + assertEquals(3, request.getTrackingInfos().size()); + } + +} diff --git a/src/test/java/io/ljunggren/fedex/api/model/rate/response/RateResponseTest.java b/src/test/java/io/ljunggren/fedex/api/model/rate/response/RateResponseTest.java index 5272967..9e0a206 100644 --- a/src/test/java/io/ljunggren/fedex/api/model/rate/response/RateResponseTest.java +++ b/src/test/java/io/ljunggren/fedex/api/model/rate/response/RateResponseTest.java @@ -1,25 +1,25 @@ -package io.ljunggren.fedex.api.model.rate.response; - -import static org.junit.Assert.*; - -import java.io.IOException; - -import org.apache.commons.io.IOUtils; -import org.junit.Test; - -import io.ljunggren.json.utils.JsonUtils; - -public class RateResponseTest { - - private String readFromResources(String file) throws IOException { - return IOUtils.toString(this.getClass().getResourceAsStream(file), "UTF-8"); - } - - @Test - public void parseTest() throws IOException { - String json = readFromResources("/rateResponse.json"); - RateResponse response = JsonUtils.jsonToObject(json, RateResponse.class); - assertNotNull(response); - } - -} +package io.ljunggren.fedex.api.model.rate.response; + +import static org.junit.Assert.*; + +import java.io.IOException; + +import org.apache.commons.io.IOUtils; +import org.junit.Test; + +import io.ljunggren.json.utils.JsonUtils; + +public class RateResponseTest { + + private String readFromResources(String file) throws IOException { + return IOUtils.toString(this.getClass().getResourceAsStream(file), "UTF-8"); + } + + @Test + public void parseTest() throws IOException { + String json = readFromResources("/rateResponse.json"); + RateResponse response = JsonUtils.jsonToObject(json, RateResponse.class); + assertNotNull(response); + } + +} diff --git a/src/test/java/io/ljunggren/fedex/api/tracking/request/TrackingRequestTest.java b/src/test/java/io/ljunggren/fedex/api/tracking/request/TrackingRequestTest.java index f9aaa08..b01a23c 100644 --- a/src/test/java/io/ljunggren/fedex/api/tracking/request/TrackingRequestTest.java +++ b/src/test/java/io/ljunggren/fedex/api/tracking/request/TrackingRequestTest.java @@ -1,35 +1,35 @@ -package io.ljunggren.fedex.api.tracking.request; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; - -import org.apache.commons.io.IOUtils; -import org.junit.Test; - -import io.ljunggren.fedex.api.model.tracking.request.TrackingRequest; -import io.ljunggren.json.utils.JsonUtils; - -public class TrackingRequestTest { - - private String readFromResources(String file) throws IOException { - return IOUtils.toString(this.getClass().getResourceAsStream(file), "UTF-8"); - } - - @Test - public void deserializeTest() throws IOException { - String json = readFromResources("/trackingRequest.json"); - TrackingRequest request = JsonUtils.jsonToObject(json, TrackingRequest.class); - assertNotNull(request); - } - - @Test - public void serializeTest() throws IOException { - String json = readFromResources("/trackingRequest.json"); - TrackingRequest request = JsonUtils.jsonToObject(json, TrackingRequest.class); - String serializedRequest = JsonUtils.objectToJson(request); - assertTrue(JsonUtils.areEqual(json, serializedRequest)); - } - -} +package io.ljunggren.fedex.api.tracking.request; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; + +import org.apache.commons.io.IOUtils; +import org.junit.Test; + +import io.ljunggren.fedex.api.model.tracking.request.TrackingRequest; +import io.ljunggren.json.utils.JsonUtils; + +public class TrackingRequestTest { + + private String readFromResources(String file) throws IOException { + return IOUtils.toString(this.getClass().getResourceAsStream(file), "UTF-8"); + } + + @Test + public void deserializeTest() throws IOException { + String json = readFromResources("/trackingRequest.json"); + TrackingRequest request = JsonUtils.jsonToObject(json, TrackingRequest.class); + assertNotNull(request); + } + + @Test + public void serializeTest() throws IOException { + String json = readFromResources("/trackingRequest.json"); + TrackingRequest request = JsonUtils.jsonToObject(json, TrackingRequest.class); + String serializedRequest = JsonUtils.objectToJson(request); + assertTrue(JsonUtils.areEqual(json, serializedRequest)); + } + +} diff --git a/src/test/resources/oauthErrorResponse.json b/src/test/resources/oauthErrorResponse.json index 92d2ae9..dce9d39 100644 --- a/src/test/resources/oauthErrorResponse.json +++ b/src/test/resources/oauthErrorResponse.json @@ -1,9 +1,9 @@ -{ - "transactionId": "8925ec9b-fff6-412e-ae76-ec84303240f2", - "errors": [ - { - "code": "NOT.AUTHORIZED.ERROR", - "message": "The given client credentials were not valid. Please modify your request and try again." - } - ] +{ + "transactionId": "8925ec9b-fff6-412e-ae76-ec84303240f2", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "The given client credentials were not valid. Please modify your request and try again." + } + ] } \ No newline at end of file diff --git a/src/test/resources/oauthResponse.json b/src/test/resources/oauthResponse.json index dea4ec1..ca24a1c 100644 --- a/src/test/resources/oauthResponse.json +++ b/src/test/resources/oauthResponse.json @@ -1,6 +1,6 @@ -{ - "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJDWFMiLCJTRUNVUkUiX", - "token_type": "bearer", - "expires_in": 3599, - "scope": "CXS SECURE" +{ + "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJDWFMiLCJTRUNVUkUiX", + "token_type": "bearer", + "expires_in": 3599, + "scope": "CXS SECURE" } \ No newline at end of file diff --git a/src/test/resources/rateRequest.json b/src/test/resources/rateRequest.json index dfe644c..deaaba5 100644 --- a/src/test/resources/rateRequest.json +++ b/src/test/resources/rateRequest.json @@ -1,35 +1,35 @@ -{ - "accountNumber" : { - "value" : "000004434" - }, - "requestedShipment" : { - "shipper" : { - "address" : { - "residential" : true, - "streetLines" : [ "660 Erin Dr." ], - "city" : "Avon", - "stateOrProvinceCode" : "IN", - "postalCode" : "46123", - "countryCode" : "US" - } - }, - "recipient" : { - "address" : { - "residential" : true, - "streetLines" : [ "9904 Stage Run Dr." ], - "city" : "Olive Branch", - "stateOrProvinceCode" : "MS", - "postalCode" : "38654", - "countryCode" : "US" - } - }, - "rateRequestType" : ["LIST", "INCENTIVE", "ACCOUNT", "PREFERRED"], - "pickupType" : "DROPOFF_AT_FEDEX_LOCATION", - "requestedPackageLineItems" : [ { - "weight" : { - "value" : 3.0, - "units" : "LB" - } - } ] - } +{ + "accountNumber" : { + "value" : "000004434" + }, + "requestedShipment" : { + "shipper" : { + "address" : { + "residential" : true, + "streetLines" : [ "660 Erin Dr." ], + "city" : "Avon", + "stateOrProvinceCode" : "IN", + "postalCode" : "46123", + "countryCode" : "US" + } + }, + "recipient" : { + "address" : { + "residential" : true, + "streetLines" : [ "9904 Stage Run Dr." ], + "city" : "Olive Branch", + "stateOrProvinceCode" : "MS", + "postalCode" : "38654", + "countryCode" : "US" + } + }, + "rateRequestType" : ["LIST", "INCENTIVE", "ACCOUNT", "PREFERRED"], + "pickupType" : "DROPOFF_AT_FEDEX_LOCATION", + "requestedPackageLineItems" : [ { + "weight" : { + "value" : 3.0, + "units" : "LB" + } + } ] + } } \ No newline at end of file diff --git a/src/test/resources/rateResponse.json b/src/test/resources/rateResponse.json index c98b41f..3d55565 100644 --- a/src/test/resources/rateResponse.json +++ b/src/test/resources/rateResponse.json @@ -1,1292 +1,1292 @@ -{ - "transactionId" : "88431f9e-6e50-4917-8596-c512417d9371", - "output" : { - "rateReplyDetails" : [ { - "serviceType" : "FIRST_OVERNIGHT", - "serviceName" : "FedEx First Overnight®", - "packagingType" : "YOUR_PACKAGING", - "ratedShipmentDetails" : [ { - "rateType" : "ACCOUNT", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 2.68, - "totalBaseCharge" : 128.23, - "totalNetCharge" : 154.68, - "totalNetFedExCharge" : 154.68, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 26.45, - "totalFreightDiscount" : 0.0, - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 22.19 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "10" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 2.68, - "packageRateDetail" : { - "rateType" : "PAYOR_ACCOUNT_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 128.23, - "netFreight" : 128.23, - "totalSurcharges" : 26.45, - "netFedExCharge" : 154.68, - "totalTaxes" : 0.0, - "netCharge" : 154.68, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 0.0, - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 22.19 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - }, { - "rateType" : "LIST", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 0.0, - "totalBaseCharge" : 128.23, - "totalNetCharge" : 157.36, - "totalNetFedExCharge" : 157.36, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 29.13, - "totalFreightDiscount" : 0.0, - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 22.58 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "10" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 0.0, - "packageRateDetail" : { - "rateType" : "PAYOR_LIST_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 128.23, - "netFreight" : 128.23, - "totalSurcharges" : 29.13, - "netFedExCharge" : 157.36, - "totalTaxes" : 0.0, - "netCharge" : 157.36, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 0.0, - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 22.58 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - } ], - "operationalDetail" : { - "ineligibleForMoneyBackGuarantee" : false, - "astraDescription" : "1ST OVR", - "airportId" : "MEM", - "serviceCode" : "06" - }, - "signatureOptionType" : "SERVICE_DEFAULT", - "serviceDescription" : { - "serviceId" : "EP1000000006", - "serviceType" : "FIRST_OVERNIGHT", - "code" : "06", - "names" : [ { - "type" : "long", - "encoding" : "utf-8", - "value" : "FedEx First Overnight®" - }, { - "type" : "long", - "encoding" : "ascii", - "value" : "FedEx First Overnight" - }, { - "type" : "medium", - "encoding" : "utf-8", - "value" : "FedEx First Overnight®" - }, { - "type" : "medium", - "encoding" : "ascii", - "value" : "FedEx First Overnight" - }, { - "type" : "short", - "encoding" : "utf-8", - "value" : "FO" - }, { - "type" : "short", - "encoding" : "ascii", - "value" : "FO" - }, { - "type" : "abbrv", - "encoding" : "ascii", - "value" : "FO" - } ], - "serviceCategory" : "parcel", - "description" : "First Overnight", - "astraDescription" : "1ST OVR" - } - }, { - "serviceType" : "PRIORITY_OVERNIGHT", - "serviceName" : "FedEx Priority Overnight®", - "packagingType" : "YOUR_PACKAGING", - "ratedShipmentDetails" : [ { - "rateType" : "ACCOUNT", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 73.05, - "totalBaseCharge" : 97.23, - "totalNetCharge" : 48.11, - "totalNetFedExCharge" : 48.11, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 11.16, - "totalFreightDiscount" : 60.28, - "freightDiscount" : [ { - "type" : "VOLUME", - "description" : "Volume discount", - "amount" : 60.28, - "percent" : 62.0 - } ], - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 6.9 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "1530" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 73.05, - "packageRateDetail" : { - "rateType" : "PAYOR_ACCOUNT_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 97.23, - "netFreight" : 36.95, - "totalSurcharges" : 11.16, - "netFedExCharge" : 48.11, - "totalTaxes" : 0.0, - "netCharge" : 48.11, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 60.28, - "freightDiscounts" : [ { - "type" : "VOLUME", - "description" : "Base", - "amount" : 60.28, - "percent" : 62.0 - } ], - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 6.9 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - }, { - "rateType" : "LIST", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 0.0, - "totalBaseCharge" : 97.23, - "totalNetCharge" : 121.16, - "totalNetFedExCharge" : 121.16, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 23.93, - "totalFreightDiscount" : 0.0, - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 17.38 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "1530" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 0.0, - "packageRateDetail" : { - "rateType" : "PAYOR_LIST_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 97.23, - "netFreight" : 97.23, - "totalSurcharges" : 23.93, - "netFedExCharge" : 121.16, - "totalTaxes" : 0.0, - "netCharge" : 121.16, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 0.0, - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 17.38 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - } ], - "operationalDetail" : { - "ineligibleForMoneyBackGuarantee" : false, - "astraDescription" : "P1", - "airportId" : "MEM", - "serviceCode" : "01" - }, - "signatureOptionType" : "SERVICE_DEFAULT", - "serviceDescription" : { - "serviceId" : "EP1000000002", - "serviceType" : "PRIORITY_OVERNIGHT", - "code" : "01", - "names" : [ { - "type" : "long", - "encoding" : "utf-8", - "value" : "FedEx Priority Overnight®" - }, { - "type" : "long", - "encoding" : "ascii", - "value" : "FedEx Priority Overnight" - }, { - "type" : "medium", - "encoding" : "utf-8", - "value" : "FedEx Priority Overnight®" - }, { - "type" : "medium", - "encoding" : "ascii", - "value" : "FedEx Priority Overnight" - }, { - "type" : "short", - "encoding" : "utf-8", - "value" : "P-1" - }, { - "type" : "short", - "encoding" : "ascii", - "value" : "P-1" - }, { - "type" : "abbrv", - "encoding" : "ascii", - "value" : "PO" - } ], - "serviceCategory" : "parcel", - "description" : "Priority Overnight", - "astraDescription" : "P1" - } - }, { - "serviceType" : "STANDARD_OVERNIGHT", - "serviceName" : "FedEx Standard Overnight®", - "packagingType" : "YOUR_PACKAGING", - "ratedShipmentDetails" : [ { - "rateType" : "ACCOUNT", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 68.3, - "totalBaseCharge" : 89.23, - "totalNetCharge" : 43.52, - "totalNetFedExCharge" : 43.52, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 10.5, - "totalFreightDiscount" : 56.21, - "freightDiscount" : [ { - "type" : "VOLUME", - "description" : "Volume discount", - "amount" : 56.21, - "percent" : 63.0 - } ], - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 6.24 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "1327" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 68.3, - "packageRateDetail" : { - "rateType" : "PAYOR_ACCOUNT_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 89.23, - "netFreight" : 33.02, - "totalSurcharges" : 10.5, - "netFedExCharge" : 43.52, - "totalTaxes" : 0.0, - "netCharge" : 43.52, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 56.21, - "freightDiscounts" : [ { - "type" : "VOLUME", - "description" : "Base", - "amount" : 56.21, - "percent" : 63.0 - } ], - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 6.24 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - }, { - "rateType" : "LIST", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 0.0, - "totalBaseCharge" : 89.23, - "totalNetCharge" : 111.82, - "totalNetFedExCharge" : 111.82, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 22.59, - "totalFreightDiscount" : 0.0, - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 16.04 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "1327" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 0.0, - "packageRateDetail" : { - "rateType" : "PAYOR_LIST_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 89.23, - "netFreight" : 89.23, - "totalSurcharges" : 22.59, - "netFedExCharge" : 111.82, - "totalTaxes" : 0.0, - "netCharge" : 111.82, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 0.0, - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 16.04 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - } ], - "operationalDetail" : { - "ineligibleForMoneyBackGuarantee" : false, - "astraDescription" : "STD OVR", - "airportId" : "MEM", - "serviceCode" : "05" - }, - "signatureOptionType" : "SERVICE_DEFAULT", - "serviceDescription" : { - "serviceId" : "EP1000000005", - "serviceType" : "STANDARD_OVERNIGHT", - "code" : "05", - "names" : [ { - "type" : "long", - "encoding" : "utf-8", - "value" : "FedEx Standard Overnight®" - }, { - "type" : "long", - "encoding" : "ascii", - "value" : "FedEx Standard Overnight" - }, { - "type" : "medium", - "encoding" : "utf-8", - "value" : "FedEx Standard Overnight®" - }, { - "type" : "medium", - "encoding" : "ascii", - "value" : "FedEx Standard Overnight" - }, { - "type" : "short", - "encoding" : "utf-8", - "value" : "SOS" - }, { - "type" : "short", - "encoding" : "ascii", - "value" : "SOS" - }, { - "type" : "abbrv", - "encoding" : "ascii", - "value" : "SO" - } ], - "serviceCategory" : "parcel", - "description" : "Standard Overnight", - "astraDescription" : "STD OVR" - } - }, { - "serviceType" : "FEDEX_2_DAY_AM", - "serviceName" : "FedEx 2Day® AM", - "packagingType" : "YOUR_PACKAGING", - "ratedShipmentDetails" : [ { - "rateType" : "ACCOUNT", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 24.94, - "totalBaseCharge" : 36.47, - "totalNetCharge" : 25.29, - "totalNetFedExCharge" : 25.29, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 7.89, - "totalFreightDiscount" : 19.07, - "freightDiscount" : [ { - "type" : "VOLUME", - "description" : "Volume discount", - "amount" : 19.07, - "percent" : 52.3 - } ], - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 3.63 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "8" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 24.94, - "packageRateDetail" : { - "rateType" : "PAYOR_ACCOUNT_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 36.47, - "netFreight" : 17.4, - "totalSurcharges" : 7.89, - "netFedExCharge" : 25.29, - "totalTaxes" : 0.0, - "netCharge" : 25.29, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 19.07, - "freightDiscounts" : [ { - "type" : "VOLUME", - "description" : "Base", - "amount" : 19.07, - "percent" : 52.3 - } ], - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 3.63 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - }, { - "rateType" : "LIST", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 0.0, - "totalBaseCharge" : 36.47, - "totalNetCharge" : 50.23, - "totalNetFedExCharge" : 50.23, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 13.76, - "totalFreightDiscount" : 0.0, - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 7.21 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "8" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 0.0, - "packageRateDetail" : { - "rateType" : "PAYOR_LIST_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 36.47, - "netFreight" : 36.47, - "totalSurcharges" : 13.76, - "netFedExCharge" : 50.23, - "totalTaxes" : 0.0, - "netCharge" : 50.23, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 0.0, - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 7.21 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - } ], - "operationalDetail" : { - "ineligibleForMoneyBackGuarantee" : false, - "astraDescription" : "2DAY AM", - "airportId" : "MEM", - "serviceCode" : "49" - }, - "signatureOptionType" : "SERVICE_DEFAULT", - "serviceDescription" : { - "serviceId" : "EP1000000023", - "serviceType" : "FEDEX_2_DAY_AM", - "code" : "49", - "names" : [ { - "type" : "long", - "encoding" : "utf-8", - "value" : "FedEx 2Day® AM" - }, { - "type" : "long", - "encoding" : "ascii", - "value" : "FedEx 2Day AM" - }, { - "type" : "medium", - "encoding" : "utf-8", - "value" : "FedEx 2Day® AM" - }, { - "type" : "medium", - "encoding" : "ascii", - "value" : "FedEx 2Day AM" - }, { - "type" : "short", - "encoding" : "utf-8", - "value" : "E2AM" - }, { - "type" : "short", - "encoding" : "ascii", - "value" : "E2AM" - }, { - "type" : "abbrv", - "encoding" : "ascii", - "value" : "TA" - } ], - "serviceCategory" : "parcel", - "description" : "2DAY AM", - "astraDescription" : "2DAY AM" - } - }, { - "serviceType" : "FEDEX_2_DAY", - "serviceName" : "FedEx 2Day®", - "packagingType" : "YOUR_PACKAGING", - "ratedShipmentDetails" : [ { - "rateType" : "ACCOUNT", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 22.83, - "totalBaseCharge" : 30.16, - "totalNetCharge" : 20.03, - "totalNetFedExCharge" : 20.03, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 7.13, - "totalFreightDiscount" : 17.26, - "freightDiscount" : [ { - "type" : "VOLUME", - "description" : "Volume discount", - "amount" : 17.26, - "percent" : 63.5 - } ], - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 2.87 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "6024" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 22.83, - "packageRateDetail" : { - "rateType" : "PAYOR_ACCOUNT_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 30.16, - "netFreight" : 12.9, - "totalSurcharges" : 7.13, - "netFedExCharge" : 20.03, - "totalTaxes" : 0.0, - "netCharge" : 20.03, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 17.26, - "freightDiscounts" : [ { - "type" : "VOLUME", - "description" : "Base", - "amount" : 17.26, - "percent" : 63.5 - } ], - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 2.87 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - }, { - "rateType" : "LIST", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 0.0, - "totalBaseCharge" : 30.16, - "totalNetCharge" : 42.86, - "totalNetFedExCharge" : 42.86, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 12.7, - "totalFreightDiscount" : 0.0, - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 6.15 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "6024" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 0.0, - "packageRateDetail" : { - "rateType" : "PAYOR_LIST_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 30.16, - "netFreight" : 30.16, - "totalSurcharges" : 12.7, - "netFedExCharge" : 42.86, - "totalTaxes" : 0.0, - "netCharge" : 42.86, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 0.0, - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 6.15 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - } ], - "operationalDetail" : { - "ineligibleForMoneyBackGuarantee" : false, - "astraDescription" : "E2", - "airportId" : "MEM", - "serviceCode" : "03" - }, - "signatureOptionType" : "SERVICE_DEFAULT", - "serviceDescription" : { - "serviceId" : "EP1000000003", - "serviceType" : "FEDEX_2_DAY", - "code" : "03", - "names" : [ { - "type" : "long", - "encoding" : "utf-8", - "value" : "FedEx 2Day®" - }, { - "type" : "long", - "encoding" : "ascii", - "value" : "FedEx 2Day" - }, { - "type" : "medium", - "encoding" : "utf-8", - "value" : "FedEx 2Day®" - }, { - "type" : "medium", - "encoding" : "ascii", - "value" : "FedEx 2Day" - }, { - "type" : "short", - "encoding" : "utf-8", - "value" : "P-2" - }, { - "type" : "short", - "encoding" : "ascii", - "value" : "P-2" - }, { - "type" : "abbrv", - "encoding" : "ascii", - "value" : "ES" - } ], - "serviceCategory" : "parcel", - "description" : "2Day", - "astraDescription" : "E2" - } - }, { - "serviceType" : "FEDEX_EXPRESS_SAVER", - "serviceName" : "FedEx Express Saver®", - "packagingType" : "YOUR_PACKAGING", - "ratedShipmentDetails" : [ { - "rateType" : "ACCOUNT", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 18.86, - "totalBaseCharge" : 27.02, - "totalNetCharge" : 20.33, - "totalNetFedExCharge" : 20.33, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 7.18, - "totalFreightDiscount" : 13.87, - "freightDiscount" : [ { - "type" : "VOLUME", - "description" : "Volume discount", - "amount" : 13.87, - "percent" : 57.5 - } ], - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 2.92 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "7171" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 18.86, - "packageRateDetail" : { - "rateType" : "PAYOR_ACCOUNT_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 27.02, - "netFreight" : 13.15, - "totalSurcharges" : 7.18, - "netFedExCharge" : 20.33, - "totalTaxes" : 0.0, - "netCharge" : 20.33, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 13.87, - "freightDiscounts" : [ { - "type" : "VOLUME", - "description" : "Base", - "amount" : 13.87, - "percent" : 57.5 - } ], - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 4.26 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 2.92 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - }, { - "rateType" : "LIST", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 0.0, - "totalBaseCharge" : 27.02, - "totalNetCharge" : 39.19, - "totalNetFedExCharge" : 39.19, - "shipmentRateDetail" : { - "rateZone" : "04", - "dimDivisor" : 0, - "fuelSurchargePercent" : 16.75, - "totalSurcharges" : 12.17, - "totalFreightDiscount" : 0.0, - "surCharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 5.62 - } ], - "pricingCode" : "PACKAGE", - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "currency" : "USD", - "rateScale" : "7171" - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 0.0, - "packageRateDetail" : { - "rateType" : "PAYOR_LIST_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 27.02, - "netFreight" : 27.02, - "totalSurcharges" : 12.17, - "netFedExCharge" : 39.19, - "totalTaxes" : 0.0, - "netCharge" : 39.19, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 0.0, - "surcharges" : [ { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential Delivery Charge", - "amount" : 6.55 - }, { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "amount" : 5.62 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - } ], - "operationalDetail" : { - "ineligibleForMoneyBackGuarantee" : false, - "astraDescription" : "XS", - "airportId" : "MEM", - "serviceCode" : "20" - }, - "signatureOptionType" : "SERVICE_DEFAULT", - "serviceDescription" : { - "serviceId" : "EP1000000013", - "serviceType" : "FEDEX_EXPRESS_SAVER", - "code" : "20", - "names" : [ { - "type" : "long", - "encoding" : "utf-8", - "value" : "FedEx Express Saver®" - }, { - "type" : "long", - "encoding" : "ascii", - "value" : "FedEx Express Saver" - }, { - "type" : "medium", - "encoding" : "utf-8", - "value" : "FedEx Express Saver®" - }, { - "type" : "medium", - "encoding" : "ascii", - "value" : "FedEx Express Saver" - } ], - "serviceCategory" : "parcel", - "description" : "Express Saver", - "astraDescription" : "XS" - } - }, { - "serviceType" : "GROUND_HOME_DELIVERY", - "serviceName" : "FedEx Home Delivery®", - "packagingType" : "YOUR_PACKAGING", - "ratedShipmentDetails" : [ { - "rateType" : "ACCOUNT", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 7.82, - "totalBaseCharge" : 15.16, - "totalNetCharge" : 17.04, - "totalNetFedExCharge" : 17.04, - "shipmentRateDetail" : { - "rateZone" : "4", - "dimDivisor" : 200, - "fuelSurchargePercent" : 17.75, - "totalSurcharges" : 6.44, - "totalFreightDiscount" : 4.56, - "freightDiscount" : [ { - "type" : "VOLUME", - "description" : "Volume discount", - "amount" : 4.56, - "percent" : 30.05 - } ], - "surCharges" : [ { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "level" : "PACKAGE", - "amount" : 2.57 - }, { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential surcharge", - "level" : "PACKAGE", - "amount" : 3.87 - } ], - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "dimDivisorType" : "PRODUCT", - "currency" : "USD", - "totalRateScaleWeight" : { - "units" : "LB", - "value" : 3.0 - } - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 7.82, - "packageRateDetail" : { - "rateType" : "PAYOR_ACCOUNT_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 15.16, - "netFreight" : 10.6, - "totalSurcharges" : 6.44, - "netFedExCharge" : 17.04, - "totalTaxes" : 0.0, - "netCharge" : 17.04, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 4.56, - "freightDiscounts" : [ { - "type" : "VOLUME", - "description" : "Volume", - "amount" : 4.56, - "percent" : 30.05 - } ], - "surcharges" : [ { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "level" : "PACKAGE", - "amount" : 2.57 - }, { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential surcharge", - "level" : "PACKAGE", - "amount" : 3.87 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - }, { - "rateType" : "LIST", - "ratedWeightMethod" : "ACTUAL", - "totalDiscounts" : 0.0, - "totalBaseCharge" : 15.16, - "totalNetCharge" : 24.86, - "totalNetFedExCharge" : 24.86, - "shipmentRateDetail" : { - "rateZone" : "4", - "dimDivisor" : 139, - "fuelSurchargePercent" : 17.75, - "totalSurcharges" : 9.7, - "totalFreightDiscount" : 0.0, - "surCharges" : [ { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "level" : "PACKAGE", - "amount" : 3.75 - }, { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential surcharge", - "level" : "PACKAGE", - "amount" : 5.95 - } ], - "totalBillingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "dimDivisorType" : "COUNTRY", - "currency" : "USD", - "totalRateScaleWeight" : { - "units" : "LB", - "value" : 3.0 - } - }, - "ratedPackages" : [ { - "groupNumber" : 0, - "effectiveNetDiscount" : 0.0, - "packageRateDetail" : { - "rateType" : "PAYOR_LIST_PACKAGE", - "ratedWeightMethod" : "ACTUAL", - "baseCharge" : 15.16, - "netFreight" : 15.16, - "totalSurcharges" : 9.7, - "netFedExCharge" : 24.86, - "totalTaxes" : 0.0, - "netCharge" : 24.86, - "totalRebates" : 0.0, - "billingWeight" : { - "units" : "LB", - "value" : 3.0 - }, - "totalFreightDiscounts" : 0.0, - "surcharges" : [ { - "type" : "FUEL", - "description" : "Fuel Surcharge", - "level" : "PACKAGE", - "amount" : 3.75 - }, { - "type" : "RESIDENTIAL_DELIVERY", - "description" : "Residential surcharge", - "level" : "PACKAGE", - "amount" : 5.95 - } ], - "currency" : "USD" - }, - "sequenceNumber" : 1 - } ], - "currency" : "USD" - } ], - "operationalDetail" : { - "ineligibleForMoneyBackGuarantee" : false, - "astraDescription" : "FXH", - "airportId" : "MEM", - "serviceCode" : "90" - }, - "signatureOptionType" : "SERVICE_DEFAULT", - "serviceDescription" : { - "serviceId" : "EP1000000133", - "serviceType" : "GROUND_HOME_DELIVERY", - "code" : "90", - "names" : [ { - "type" : "long", - "encoding" : "utf-8", - "value" : "FedEx Home Delivery®" - }, { - "type" : "long", - "encoding" : "ascii", - "value" : "FedEx Home Delivery" - }, { - "type" : "medium", - "encoding" : "utf-8", - "value" : "Home Delivery®" - }, { - "type" : "medium", - "encoding" : "ascii", - "value" : "Home Delivery" - }, { - "type" : "short", - "encoding" : "utf-8", - "value" : "HD" - }, { - "type" : "short", - "encoding" : "ascii", - "value" : "HD" - }, { - "type" : "abbrv", - "encoding" : "ascii", - "value" : "QH" - } ], - "description" : "FedEx Home Delivery", - "astraDescription" : "FXH" - } - } ], - "quoteDate" : "2025-06-03", - "encoded" : false - } +{ + "transactionId" : "88431f9e-6e50-4917-8596-c512417d9371", + "output" : { + "rateReplyDetails" : [ { + "serviceType" : "FIRST_OVERNIGHT", + "serviceName" : "FedEx First Overnight®", + "packagingType" : "YOUR_PACKAGING", + "ratedShipmentDetails" : [ { + "rateType" : "ACCOUNT", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 2.68, + "totalBaseCharge" : 128.23, + "totalNetCharge" : 154.68, + "totalNetFedExCharge" : 154.68, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 26.45, + "totalFreightDiscount" : 0.0, + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 22.19 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "10" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 2.68, + "packageRateDetail" : { + "rateType" : "PAYOR_ACCOUNT_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 128.23, + "netFreight" : 128.23, + "totalSurcharges" : 26.45, + "netFedExCharge" : 154.68, + "totalTaxes" : 0.0, + "netCharge" : 154.68, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 0.0, + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 22.19 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + }, { + "rateType" : "LIST", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 0.0, + "totalBaseCharge" : 128.23, + "totalNetCharge" : 157.36, + "totalNetFedExCharge" : 157.36, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 29.13, + "totalFreightDiscount" : 0.0, + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 22.58 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "10" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 0.0, + "packageRateDetail" : { + "rateType" : "PAYOR_LIST_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 128.23, + "netFreight" : 128.23, + "totalSurcharges" : 29.13, + "netFedExCharge" : 157.36, + "totalTaxes" : 0.0, + "netCharge" : 157.36, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 0.0, + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 22.58 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + } ], + "operationalDetail" : { + "ineligibleForMoneyBackGuarantee" : false, + "astraDescription" : "1ST OVR", + "airportId" : "MEM", + "serviceCode" : "06" + }, + "signatureOptionType" : "SERVICE_DEFAULT", + "serviceDescription" : { + "serviceId" : "EP1000000006", + "serviceType" : "FIRST_OVERNIGHT", + "code" : "06", + "names" : [ { + "type" : "long", + "encoding" : "utf-8", + "value" : "FedEx First Overnight®" + }, { + "type" : "long", + "encoding" : "ascii", + "value" : "FedEx First Overnight" + }, { + "type" : "medium", + "encoding" : "utf-8", + "value" : "FedEx First Overnight®" + }, { + "type" : "medium", + "encoding" : "ascii", + "value" : "FedEx First Overnight" + }, { + "type" : "short", + "encoding" : "utf-8", + "value" : "FO" + }, { + "type" : "short", + "encoding" : "ascii", + "value" : "FO" + }, { + "type" : "abbrv", + "encoding" : "ascii", + "value" : "FO" + } ], + "serviceCategory" : "parcel", + "description" : "First Overnight", + "astraDescription" : "1ST OVR" + } + }, { + "serviceType" : "PRIORITY_OVERNIGHT", + "serviceName" : "FedEx Priority Overnight®", + "packagingType" : "YOUR_PACKAGING", + "ratedShipmentDetails" : [ { + "rateType" : "ACCOUNT", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 73.05, + "totalBaseCharge" : 97.23, + "totalNetCharge" : 48.11, + "totalNetFedExCharge" : 48.11, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 11.16, + "totalFreightDiscount" : 60.28, + "freightDiscount" : [ { + "type" : "VOLUME", + "description" : "Volume discount", + "amount" : 60.28, + "percent" : 62.0 + } ], + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 6.9 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "1530" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 73.05, + "packageRateDetail" : { + "rateType" : "PAYOR_ACCOUNT_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 97.23, + "netFreight" : 36.95, + "totalSurcharges" : 11.16, + "netFedExCharge" : 48.11, + "totalTaxes" : 0.0, + "netCharge" : 48.11, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 60.28, + "freightDiscounts" : [ { + "type" : "VOLUME", + "description" : "Base", + "amount" : 60.28, + "percent" : 62.0 + } ], + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 6.9 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + }, { + "rateType" : "LIST", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 0.0, + "totalBaseCharge" : 97.23, + "totalNetCharge" : 121.16, + "totalNetFedExCharge" : 121.16, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 23.93, + "totalFreightDiscount" : 0.0, + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 17.38 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "1530" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 0.0, + "packageRateDetail" : { + "rateType" : "PAYOR_LIST_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 97.23, + "netFreight" : 97.23, + "totalSurcharges" : 23.93, + "netFedExCharge" : 121.16, + "totalTaxes" : 0.0, + "netCharge" : 121.16, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 0.0, + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 17.38 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + } ], + "operationalDetail" : { + "ineligibleForMoneyBackGuarantee" : false, + "astraDescription" : "P1", + "airportId" : "MEM", + "serviceCode" : "01" + }, + "signatureOptionType" : "SERVICE_DEFAULT", + "serviceDescription" : { + "serviceId" : "EP1000000002", + "serviceType" : "PRIORITY_OVERNIGHT", + "code" : "01", + "names" : [ { + "type" : "long", + "encoding" : "utf-8", + "value" : "FedEx Priority Overnight®" + }, { + "type" : "long", + "encoding" : "ascii", + "value" : "FedEx Priority Overnight" + }, { + "type" : "medium", + "encoding" : "utf-8", + "value" : "FedEx Priority Overnight®" + }, { + "type" : "medium", + "encoding" : "ascii", + "value" : "FedEx Priority Overnight" + }, { + "type" : "short", + "encoding" : "utf-8", + "value" : "P-1" + }, { + "type" : "short", + "encoding" : "ascii", + "value" : "P-1" + }, { + "type" : "abbrv", + "encoding" : "ascii", + "value" : "PO" + } ], + "serviceCategory" : "parcel", + "description" : "Priority Overnight", + "astraDescription" : "P1" + } + }, { + "serviceType" : "STANDARD_OVERNIGHT", + "serviceName" : "FedEx Standard Overnight®", + "packagingType" : "YOUR_PACKAGING", + "ratedShipmentDetails" : [ { + "rateType" : "ACCOUNT", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 68.3, + "totalBaseCharge" : 89.23, + "totalNetCharge" : 43.52, + "totalNetFedExCharge" : 43.52, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 10.5, + "totalFreightDiscount" : 56.21, + "freightDiscount" : [ { + "type" : "VOLUME", + "description" : "Volume discount", + "amount" : 56.21, + "percent" : 63.0 + } ], + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 6.24 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "1327" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 68.3, + "packageRateDetail" : { + "rateType" : "PAYOR_ACCOUNT_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 89.23, + "netFreight" : 33.02, + "totalSurcharges" : 10.5, + "netFedExCharge" : 43.52, + "totalTaxes" : 0.0, + "netCharge" : 43.52, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 56.21, + "freightDiscounts" : [ { + "type" : "VOLUME", + "description" : "Base", + "amount" : 56.21, + "percent" : 63.0 + } ], + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 6.24 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + }, { + "rateType" : "LIST", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 0.0, + "totalBaseCharge" : 89.23, + "totalNetCharge" : 111.82, + "totalNetFedExCharge" : 111.82, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 22.59, + "totalFreightDiscount" : 0.0, + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 16.04 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "1327" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 0.0, + "packageRateDetail" : { + "rateType" : "PAYOR_LIST_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 89.23, + "netFreight" : 89.23, + "totalSurcharges" : 22.59, + "netFedExCharge" : 111.82, + "totalTaxes" : 0.0, + "netCharge" : 111.82, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 0.0, + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 16.04 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + } ], + "operationalDetail" : { + "ineligibleForMoneyBackGuarantee" : false, + "astraDescription" : "STD OVR", + "airportId" : "MEM", + "serviceCode" : "05" + }, + "signatureOptionType" : "SERVICE_DEFAULT", + "serviceDescription" : { + "serviceId" : "EP1000000005", + "serviceType" : "STANDARD_OVERNIGHT", + "code" : "05", + "names" : [ { + "type" : "long", + "encoding" : "utf-8", + "value" : "FedEx Standard Overnight®" + }, { + "type" : "long", + "encoding" : "ascii", + "value" : "FedEx Standard Overnight" + }, { + "type" : "medium", + "encoding" : "utf-8", + "value" : "FedEx Standard Overnight®" + }, { + "type" : "medium", + "encoding" : "ascii", + "value" : "FedEx Standard Overnight" + }, { + "type" : "short", + "encoding" : "utf-8", + "value" : "SOS" + }, { + "type" : "short", + "encoding" : "ascii", + "value" : "SOS" + }, { + "type" : "abbrv", + "encoding" : "ascii", + "value" : "SO" + } ], + "serviceCategory" : "parcel", + "description" : "Standard Overnight", + "astraDescription" : "STD OVR" + } + }, { + "serviceType" : "FEDEX_2_DAY_AM", + "serviceName" : "FedEx 2Day® AM", + "packagingType" : "YOUR_PACKAGING", + "ratedShipmentDetails" : [ { + "rateType" : "ACCOUNT", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 24.94, + "totalBaseCharge" : 36.47, + "totalNetCharge" : 25.29, + "totalNetFedExCharge" : 25.29, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 7.89, + "totalFreightDiscount" : 19.07, + "freightDiscount" : [ { + "type" : "VOLUME", + "description" : "Volume discount", + "amount" : 19.07, + "percent" : 52.3 + } ], + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 3.63 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "8" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 24.94, + "packageRateDetail" : { + "rateType" : "PAYOR_ACCOUNT_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 36.47, + "netFreight" : 17.4, + "totalSurcharges" : 7.89, + "netFedExCharge" : 25.29, + "totalTaxes" : 0.0, + "netCharge" : 25.29, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 19.07, + "freightDiscounts" : [ { + "type" : "VOLUME", + "description" : "Base", + "amount" : 19.07, + "percent" : 52.3 + } ], + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 3.63 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + }, { + "rateType" : "LIST", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 0.0, + "totalBaseCharge" : 36.47, + "totalNetCharge" : 50.23, + "totalNetFedExCharge" : 50.23, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 13.76, + "totalFreightDiscount" : 0.0, + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 7.21 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "8" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 0.0, + "packageRateDetail" : { + "rateType" : "PAYOR_LIST_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 36.47, + "netFreight" : 36.47, + "totalSurcharges" : 13.76, + "netFedExCharge" : 50.23, + "totalTaxes" : 0.0, + "netCharge" : 50.23, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 0.0, + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 7.21 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + } ], + "operationalDetail" : { + "ineligibleForMoneyBackGuarantee" : false, + "astraDescription" : "2DAY AM", + "airportId" : "MEM", + "serviceCode" : "49" + }, + "signatureOptionType" : "SERVICE_DEFAULT", + "serviceDescription" : { + "serviceId" : "EP1000000023", + "serviceType" : "FEDEX_2_DAY_AM", + "code" : "49", + "names" : [ { + "type" : "long", + "encoding" : "utf-8", + "value" : "FedEx 2Day® AM" + }, { + "type" : "long", + "encoding" : "ascii", + "value" : "FedEx 2Day AM" + }, { + "type" : "medium", + "encoding" : "utf-8", + "value" : "FedEx 2Day® AM" + }, { + "type" : "medium", + "encoding" : "ascii", + "value" : "FedEx 2Day AM" + }, { + "type" : "short", + "encoding" : "utf-8", + "value" : "E2AM" + }, { + "type" : "short", + "encoding" : "ascii", + "value" : "E2AM" + }, { + "type" : "abbrv", + "encoding" : "ascii", + "value" : "TA" + } ], + "serviceCategory" : "parcel", + "description" : "2DAY AM", + "astraDescription" : "2DAY AM" + } + }, { + "serviceType" : "FEDEX_2_DAY", + "serviceName" : "FedEx 2Day®", + "packagingType" : "YOUR_PACKAGING", + "ratedShipmentDetails" : [ { + "rateType" : "ACCOUNT", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 22.83, + "totalBaseCharge" : 30.16, + "totalNetCharge" : 20.03, + "totalNetFedExCharge" : 20.03, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 7.13, + "totalFreightDiscount" : 17.26, + "freightDiscount" : [ { + "type" : "VOLUME", + "description" : "Volume discount", + "amount" : 17.26, + "percent" : 63.5 + } ], + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 2.87 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "6024" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 22.83, + "packageRateDetail" : { + "rateType" : "PAYOR_ACCOUNT_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 30.16, + "netFreight" : 12.9, + "totalSurcharges" : 7.13, + "netFedExCharge" : 20.03, + "totalTaxes" : 0.0, + "netCharge" : 20.03, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 17.26, + "freightDiscounts" : [ { + "type" : "VOLUME", + "description" : "Base", + "amount" : 17.26, + "percent" : 63.5 + } ], + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 2.87 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + }, { + "rateType" : "LIST", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 0.0, + "totalBaseCharge" : 30.16, + "totalNetCharge" : 42.86, + "totalNetFedExCharge" : 42.86, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 12.7, + "totalFreightDiscount" : 0.0, + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 6.15 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "6024" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 0.0, + "packageRateDetail" : { + "rateType" : "PAYOR_LIST_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 30.16, + "netFreight" : 30.16, + "totalSurcharges" : 12.7, + "netFedExCharge" : 42.86, + "totalTaxes" : 0.0, + "netCharge" : 42.86, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 0.0, + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 6.15 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + } ], + "operationalDetail" : { + "ineligibleForMoneyBackGuarantee" : false, + "astraDescription" : "E2", + "airportId" : "MEM", + "serviceCode" : "03" + }, + "signatureOptionType" : "SERVICE_DEFAULT", + "serviceDescription" : { + "serviceId" : "EP1000000003", + "serviceType" : "FEDEX_2_DAY", + "code" : "03", + "names" : [ { + "type" : "long", + "encoding" : "utf-8", + "value" : "FedEx 2Day®" + }, { + "type" : "long", + "encoding" : "ascii", + "value" : "FedEx 2Day" + }, { + "type" : "medium", + "encoding" : "utf-8", + "value" : "FedEx 2Day®" + }, { + "type" : "medium", + "encoding" : "ascii", + "value" : "FedEx 2Day" + }, { + "type" : "short", + "encoding" : "utf-8", + "value" : "P-2" + }, { + "type" : "short", + "encoding" : "ascii", + "value" : "P-2" + }, { + "type" : "abbrv", + "encoding" : "ascii", + "value" : "ES" + } ], + "serviceCategory" : "parcel", + "description" : "2Day", + "astraDescription" : "E2" + } + }, { + "serviceType" : "FEDEX_EXPRESS_SAVER", + "serviceName" : "FedEx Express Saver®", + "packagingType" : "YOUR_PACKAGING", + "ratedShipmentDetails" : [ { + "rateType" : "ACCOUNT", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 18.86, + "totalBaseCharge" : 27.02, + "totalNetCharge" : 20.33, + "totalNetFedExCharge" : 20.33, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 7.18, + "totalFreightDiscount" : 13.87, + "freightDiscount" : [ { + "type" : "VOLUME", + "description" : "Volume discount", + "amount" : 13.87, + "percent" : 57.5 + } ], + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 2.92 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "7171" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 18.86, + "packageRateDetail" : { + "rateType" : "PAYOR_ACCOUNT_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 27.02, + "netFreight" : 13.15, + "totalSurcharges" : 7.18, + "netFedExCharge" : 20.33, + "totalTaxes" : 0.0, + "netCharge" : 20.33, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 13.87, + "freightDiscounts" : [ { + "type" : "VOLUME", + "description" : "Base", + "amount" : 13.87, + "percent" : 57.5 + } ], + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 4.26 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 2.92 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + }, { + "rateType" : "LIST", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 0.0, + "totalBaseCharge" : 27.02, + "totalNetCharge" : 39.19, + "totalNetFedExCharge" : 39.19, + "shipmentRateDetail" : { + "rateZone" : "04", + "dimDivisor" : 0, + "fuelSurchargePercent" : 16.75, + "totalSurcharges" : 12.17, + "totalFreightDiscount" : 0.0, + "surCharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 5.62 + } ], + "pricingCode" : "PACKAGE", + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "currency" : "USD", + "rateScale" : "7171" + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 0.0, + "packageRateDetail" : { + "rateType" : "PAYOR_LIST_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 27.02, + "netFreight" : 27.02, + "totalSurcharges" : 12.17, + "netFedExCharge" : 39.19, + "totalTaxes" : 0.0, + "netCharge" : 39.19, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 0.0, + "surcharges" : [ { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential Delivery Charge", + "amount" : 6.55 + }, { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "amount" : 5.62 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + } ], + "operationalDetail" : { + "ineligibleForMoneyBackGuarantee" : false, + "astraDescription" : "XS", + "airportId" : "MEM", + "serviceCode" : "20" + }, + "signatureOptionType" : "SERVICE_DEFAULT", + "serviceDescription" : { + "serviceId" : "EP1000000013", + "serviceType" : "FEDEX_EXPRESS_SAVER", + "code" : "20", + "names" : [ { + "type" : "long", + "encoding" : "utf-8", + "value" : "FedEx Express Saver®" + }, { + "type" : "long", + "encoding" : "ascii", + "value" : "FedEx Express Saver" + }, { + "type" : "medium", + "encoding" : "utf-8", + "value" : "FedEx Express Saver®" + }, { + "type" : "medium", + "encoding" : "ascii", + "value" : "FedEx Express Saver" + } ], + "serviceCategory" : "parcel", + "description" : "Express Saver", + "astraDescription" : "XS" + } + }, { + "serviceType" : "GROUND_HOME_DELIVERY", + "serviceName" : "FedEx Home Delivery®", + "packagingType" : "YOUR_PACKAGING", + "ratedShipmentDetails" : [ { + "rateType" : "ACCOUNT", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 7.82, + "totalBaseCharge" : 15.16, + "totalNetCharge" : 17.04, + "totalNetFedExCharge" : 17.04, + "shipmentRateDetail" : { + "rateZone" : "4", + "dimDivisor" : 200, + "fuelSurchargePercent" : 17.75, + "totalSurcharges" : 6.44, + "totalFreightDiscount" : 4.56, + "freightDiscount" : [ { + "type" : "VOLUME", + "description" : "Volume discount", + "amount" : 4.56, + "percent" : 30.05 + } ], + "surCharges" : [ { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "level" : "PACKAGE", + "amount" : 2.57 + }, { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential surcharge", + "level" : "PACKAGE", + "amount" : 3.87 + } ], + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "dimDivisorType" : "PRODUCT", + "currency" : "USD", + "totalRateScaleWeight" : { + "units" : "LB", + "value" : 3.0 + } + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 7.82, + "packageRateDetail" : { + "rateType" : "PAYOR_ACCOUNT_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 15.16, + "netFreight" : 10.6, + "totalSurcharges" : 6.44, + "netFedExCharge" : 17.04, + "totalTaxes" : 0.0, + "netCharge" : 17.04, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 4.56, + "freightDiscounts" : [ { + "type" : "VOLUME", + "description" : "Volume", + "amount" : 4.56, + "percent" : 30.05 + } ], + "surcharges" : [ { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "level" : "PACKAGE", + "amount" : 2.57 + }, { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential surcharge", + "level" : "PACKAGE", + "amount" : 3.87 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + }, { + "rateType" : "LIST", + "ratedWeightMethod" : "ACTUAL", + "totalDiscounts" : 0.0, + "totalBaseCharge" : 15.16, + "totalNetCharge" : 24.86, + "totalNetFedExCharge" : 24.86, + "shipmentRateDetail" : { + "rateZone" : "4", + "dimDivisor" : 139, + "fuelSurchargePercent" : 17.75, + "totalSurcharges" : 9.7, + "totalFreightDiscount" : 0.0, + "surCharges" : [ { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "level" : "PACKAGE", + "amount" : 3.75 + }, { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential surcharge", + "level" : "PACKAGE", + "amount" : 5.95 + } ], + "totalBillingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "dimDivisorType" : "COUNTRY", + "currency" : "USD", + "totalRateScaleWeight" : { + "units" : "LB", + "value" : 3.0 + } + }, + "ratedPackages" : [ { + "groupNumber" : 0, + "effectiveNetDiscount" : 0.0, + "packageRateDetail" : { + "rateType" : "PAYOR_LIST_PACKAGE", + "ratedWeightMethod" : "ACTUAL", + "baseCharge" : 15.16, + "netFreight" : 15.16, + "totalSurcharges" : 9.7, + "netFedExCharge" : 24.86, + "totalTaxes" : 0.0, + "netCharge" : 24.86, + "totalRebates" : 0.0, + "billingWeight" : { + "units" : "LB", + "value" : 3.0 + }, + "totalFreightDiscounts" : 0.0, + "surcharges" : [ { + "type" : "FUEL", + "description" : "Fuel Surcharge", + "level" : "PACKAGE", + "amount" : 3.75 + }, { + "type" : "RESIDENTIAL_DELIVERY", + "description" : "Residential surcharge", + "level" : "PACKAGE", + "amount" : 5.95 + } ], + "currency" : "USD" + }, + "sequenceNumber" : 1 + } ], + "currency" : "USD" + } ], + "operationalDetail" : { + "ineligibleForMoneyBackGuarantee" : false, + "astraDescription" : "FXH", + "airportId" : "MEM", + "serviceCode" : "90" + }, + "signatureOptionType" : "SERVICE_DEFAULT", + "serviceDescription" : { + "serviceId" : "EP1000000133", + "serviceType" : "GROUND_HOME_DELIVERY", + "code" : "90", + "names" : [ { + "type" : "long", + "encoding" : "utf-8", + "value" : "FedEx Home Delivery®" + }, { + "type" : "long", + "encoding" : "ascii", + "value" : "FedEx Home Delivery" + }, { + "type" : "medium", + "encoding" : "utf-8", + "value" : "Home Delivery®" + }, { + "type" : "medium", + "encoding" : "ascii", + "value" : "Home Delivery" + }, { + "type" : "short", + "encoding" : "utf-8", + "value" : "HD" + }, { + "type" : "short", + "encoding" : "ascii", + "value" : "HD" + }, { + "type" : "abbrv", + "encoding" : "ascii", + "value" : "QH" + } ], + "description" : "FedEx Home Delivery", + "astraDescription" : "FXH" + } + } ], + "quoteDate" : "2025-06-03", + "encoded" : false + } } \ No newline at end of file diff --git a/src/test/resources/trackingRequest.json b/src/test/resources/trackingRequest.json index f032c0e..b07dd2e 100644 --- a/src/test/resources/trackingRequest.json +++ b/src/test/resources/trackingRequest.json @@ -1,10 +1,10 @@ -{ - "includeDetailedScans": false, - "trackingInfo": [ - { - "trackingNumberInfo": { - "trackingNumber": "020207021381215" - } - } - ] +{ + "includeDetailedScans": false, + "trackingInfo": [ + { + "trackingNumberInfo": { + "trackingNumber": "020207021381215" + } + } + ] } \ No newline at end of file diff --git a/src/test/resources/trackingResponse.json b/src/test/resources/trackingResponse.json index 8d01e5c..01dd7cf 100644 --- a/src/test/resources/trackingResponse.json +++ b/src/test/resources/trackingResponse.json @@ -1,428 +1,428 @@ -{ - "transactionId" : "624deea6-b709-470c-8c39-4b5511281492", - "customerTransactionId" : "AnyCo_order123456789", - "output" : { - "completeTrackResults" : [{ - "trackingNumber" : "123456789012", - "trackResults" : [{ - "trackingNumberInfo" : { - "trackingNumber" : "128667043726", - "carrierCode" : "FDXE", - "trackingNumberUniqueId" : "245822~123456789012~FDEG" - }, - "additionalTrackingInfo" : { - "hasAssociatedShipments" : false, - "nickname" : "shipment nickname", - "packageIdentifiers" : [{ - "type" : "SHIPPER_REFERENCE", - "value" : "ASJFGVAS", - "trackingNumberUniqueId" : "245822~123456789012~FDEG" - } - ], - "shipmentNotes" : "shipment notes" - }, - "distanceToDestination" : { - "units" : "KM", - "value" : 685.7 - }, - "consolidationDetail" : [{ - "timeStamp" : "2020-10-13T03:54:44", - "consolidationID" : "47936927", - "reasonDetail" : { - "description" : "Wrong color", - "type" : "REJECTED" - }, - "packageCount" : 25, - "eventType" : "PACKAGE_ADDED_TO_CONSOLIDATION" - } - ], - "meterNumber" : "8468376", - "returnDetail" : { - "authorizationName" : "Sammy Smith", - "reasonDetail" : [{ - "description" : "Wrong color", - "type" : "REJECTED" - } - ] - }, - "serviceDetail" : { - "description" : "FedEx Freight Economy.", - "shortDescription" : "FL", - "type" : "FEDEX_FREIGHT_ECONOMY" - }, - "destinationLocation" : { - "locationId" : "SEA", - "locationContactAndAddress" : { - "contact" : { - "personName" : "John Taylor", - "phoneNumber" : "1234567890", - "companyName" : "Fedex" - }, - "address" : { - "classification" : "BUSINESS", - "residential" : false, - "streetLines" : [ - "1043 North Easy Street", - "Suite 999" - ], - "city" : "SEATTLE", - "urbanizationCode" : "RAFAEL", - "stateOrProvinceCode" : "WA", - "postalCode" : "98101", - "countryCode" : "US" - } - }, - "locationType" : "PICKUP_LOCATION" - }, - "latestStatusDetail" : { - "scanLocation" : { - "classification" : "BUSINESS", - "residential" : false, - "streetLines" : [ - "1043 North Easy Street", - "Suite 999" - ], - "city" : "SEATTLE", - "urbanizationCode" : "RAFAEL", - "stateOrProvinceCode" : "WA", - "postalCode" : "98101", - "countryCode" : "US", - "countryName" : "United States" - }, - "code" : "PU", - "derivedCode" : "PU", - "ancillaryDetails" : [{ - "reason" : "15", - "reasonDescription" : "Customer not available or business closed", - "action" : "Contact us at to discuss possible delivery or pickup alternatives.", - "actionDescription" : "Customer not Available or Business Closed" - } - ], - "statusByLocale" : "Picked up", - "description" : "Picked up", - "delayDetail" : { - "type" : "WEATHER", - "subType" : "SNOW", - "status" : "DELAYED" - } - }, - "serviceCommitMessage" : { - "message" : "No scheduled delivery date available at this time.", - "type" : "ESTIMATED_DELIVERY_DATE_UNAVAILABLE" - }, - "informationNotes" : [{ - "code" : "CLEARANCE_ENTRY_FEE_APPLIES", - "description" : "this is an informational message" - } - ], - "error" : { - "code" : "TRACKING.TRACKINGNUMBER.EMPTY", - "parameterList" : [{ - "value" : "value", - "key" : "key" - } - ], - "message" : "Please provide tracking number." - }, - "specialHandlings" : [{ - "description" : "Deliver Weekday", - "type" : "DELIVER_WEEKDAY", - "paymentType" : "OTHER" - } - ], - "availableImages" : [{ - "size" : "LARGE", - "type" : "BILL_OF_LADING" - } - ], - "deliveryDetails" : { - "receivedByName" : "Reciever", - "destinationServiceArea" : "EDDUNAVAILABLE", - "destinationServiceAreaDescription" : "Appointment required", - "locationDescription" : "Receptionist/Front Desk", - "actualDeliveryAddress" : { - "classification" : "BUSINESS", - "residential" : false, - "streetLines" : [ - "1043 North Easy Street", - "Suite 999" - ], - "city" : "SEATTLE", - "urbanizationCode" : "RAFAEL", - "stateOrProvinceCode" : "WA", - "postalCode" : "98101", - "countryCode" : "US", - "countryName" : "United States" - }, - "deliveryToday" : false, - "locationType" : "FEDEX_EXPRESS_STATION", - "signedByName" : "Reciever", - "officeOrderDeliveryMethod" : "Courier", - "deliveryAttempts" : "0", - "deliveryOptionEligibilityDetails" : [{ - "option" : "INDIRECT_SIGNATURE_RELEASE", - "eligibility" : "INELIGIBLE" - } - ] - }, - "scanEvents" : [{ - "date" : "2018-02-02T12:01:00", - "derivedStatus" : "Picked Up", - "scanLocation" : { - "locationId" : "SEA", - "locationContactAndAddress" : { - "contact" : { - "personName" : "John Taylor", - "phoneNumber" : "1234567890", - "companyName" : "Fedex" - }, - "address" : { - "classification" : "BUSINESS", - "residential" : false, - "streetLines" : [ - "1043 North Easy Street", - "Suite 999" - ], - "city" : "SEATTLE", - "urbanizationCode" : "RAFAEL", - "stateOrProvinceCode" : "WA", - "postalCode" : "98101", - "countryCode" : "US" - } - }, - "locationType" : "PICKUP_LOCATION" - }, - "exceptionDescription" : "Package available for clearance", - "eventDescription" : "Picked Up", - "eventType" : "PU", - "derivedStatusCode" : "PU", - "exceptionCode" : "A25", - "delayDetail" : { - "type" : "WEATHER", - "subType" : "SNOW", - "status" : "DELAYED" - } - } - ], - "dateAndTimes" : [{ - "dateTime" : "2007-09-27T00:00:00", - "type" : "ACTUAL_DELIVERY" - } - ], - "packageDetails" : { - "physicalPackagingType" : "BARREL", - "sequenceNumber" : "45", - "undeliveredCount" : "7", - "packagingDescription" : { - "description" : "FedEx Pak", - "type" : "FEDEX_PAK" - }, - "count" : "1", - "weightAndDimensions" : { - "weight" : [{ - "unit" : "LB", - "value" : "22222.0" - } - ], - "dimensions" : [{ - "length" : 100, - "width" : 50, - "height" : 30, - "units" : "CM" - } - ] - }, - "packageContent" : [ - "wire hangers", - "buttons" - ], - "contentPieceCount" : "100", - "declaredValue" : { - "currency" : "USD", - "value" : 56.8 - } - }, - "goodsClassificationCode" : "goodsClassificationCode", - "holdAtLocation" : { - "locationId" : "SEA", - "locationContactAndAddress" : { - "contact" : { - "personName" : "John Taylor", - "phoneNumber" : "1234567890", - "companyName" : "Fedex" - }, - "address" : { - "classification" : "BUSINESS", - "residential" : false, - "streetLines" : [ - "1043 North Easy Street", - "Suite 999" - ], - "city" : "SEATTLE", - "urbanizationCode" : "RAFAEL", - "stateOrProvinceCode" : "WA", - "postalCode" : "98101", - "countryCode" : "US", - "countryName" : "United States" - } - }, - "locationType" : "PICKUP_LOCATION" - }, - "customDeliveryOptions" : [{ - "requestedAppointmentDetail" : { - "date" : "2019-05-07", - "window" : [{ - "description" : "Description field", - "window" : { - "begins" : "2021-10-01T08:00:00", - "ends" : "2021-10-15T00:00:00" - }, - "type" : "ESTIMATED_DELIVERY" - } - ] - }, - "description" : "Redirect the package to the hold location.", - "type" : "REDIRECT_TO_HOLD_AT_LOCATION", - "status" : "HELD" - } - ], - "estimatedDeliveryTimeWindow" : { - "description" : "Description field", - "window" : { - "begins" : "2021-10-01T08:00:00", - "ends" : "2021-10-15T00:00:00" - }, - "type" : "ESTIMATED_DELIVERY" - }, - "pieceCounts" : [{ - "count" : "35", - "description" : "picec count description", - "type" : "ORIGIN" - } - ], - "originLocation" : { - "locationId" : "SEA", - "locationContactAndAddress" : { - "contact" : { - "personName" : "John Taylor", - "phoneNumber" : "1234567890", - "companyName" : "Fedex" - }, - "address" : { - "classification" : "BUSINESS", - "residential" : false, - "streetLines" : [ - "1043 North Easy Street", - "Suite 999" - ], - "city" : "SEATTLE", - "urbanizationCode" : "RAFAEL", - "stateOrProvinceCode" : "WA", - "postalCode" : "98101", - "countryCode" : "US" - } - }, - "locationType" : "PICKUP_LOCATION" - }, - "recipientInformation" : { - "contact" : { - "personName" : "John Taylor", - "phoneNumber" : "1234567890", - "companyName" : "Fedex" - }, - "address" : { - "classification" : "BUSINESS", - "residential" : false, - "streetLines" : [ - "1043 North Easy Street", - "Suite 999" - ], - "city" : "SEATTLE", - "urbanizationCode" : "RAFAEL", - "stateOrProvinceCode" : "WA", - "postalCode" : "98101", - "countryCode" : "US", - "countryName" : "United States" - } - }, - "standardTransitTimeWindow" : { - "description" : "Description field", - "window" : { - "begins" : "2021-10-01T08:00:00", - "ends" : "2021-10-15T00:00:00" - }, - "type" : "ESTIMATED_DELIVERY" - }, - "shipmentDetails" : { - "contents" : [{ - "itemNumber" : "RZ5678", - "receivedQuantity" : "13", - "description" : "pulyurethane rope", - "partNumber" : "RK1345" - } - ], - "beforePossessionStatus" : false, - "weight" : [{ - "unit" : "LB", - "value" : "22222.0" - } - ], - "contentPieceCount" : "3333", - "splitShipments" : [{ - "pieceCount" : "10", - "statusDescription" : "status", - "timestamp" : "2019-05-07T08:00:07", - "statusCode" : "statuscode" - } - ] - }, - "reasonDetail" : { - "description" : "Wrong color", - "type" : "REJECTED" - }, - "availableNotifications" : [ - "ON_DELIVERY", - "ON_EXCEPTION" - ], - "shipperInformation" : { - "contact" : { - "personName" : "John Taylor", - "phoneNumber" : "1234567890", - "companyName" : "Fedex" - }, - "address" : { - "classification" : "BUSINESS", - "residential" : false, - "streetLines" : [ - "1043 North Easy Street", - "Suite 999" - ], - "city" : "SEATTLE", - "urbanizationCode" : "RAFAEL", - "stateOrProvinceCode" : "WA", - "postalCode" : "98101", - "countryCode" : "US", - "countryName" : "United States" - } - }, - "lastUpdatedDestinationAddress" : { - "classification" : "BUSINESS", - "residential" : false, - "streetLines" : [ - "1043 North Easy Street", - "Suite 999" - ], - "city" : "SEATTLE", - "urbanizationCode" : "RAFAEL", - "stateOrProvinceCode" : "WA", - "postalCode" : "98101", - "countryCode" : "US", - "countryName" : "United States" - } - } - ] - } - ], - "alerts" : "TRACKING.DATA.NOTFOUND - Tracking data unavailable" - } +{ + "transactionId" : "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId" : "AnyCo_order123456789", + "output" : { + "completeTrackResults" : [{ + "trackingNumber" : "123456789012", + "trackResults" : [{ + "trackingNumberInfo" : { + "trackingNumber" : "128667043726", + "carrierCode" : "FDXE", + "trackingNumberUniqueId" : "245822~123456789012~FDEG" + }, + "additionalTrackingInfo" : { + "hasAssociatedShipments" : false, + "nickname" : "shipment nickname", + "packageIdentifiers" : [{ + "type" : "SHIPPER_REFERENCE", + "value" : "ASJFGVAS", + "trackingNumberUniqueId" : "245822~123456789012~FDEG" + } + ], + "shipmentNotes" : "shipment notes" + }, + "distanceToDestination" : { + "units" : "KM", + "value" : 685.7 + }, + "consolidationDetail" : [{ + "timeStamp" : "2020-10-13T03:54:44", + "consolidationID" : "47936927", + "reasonDetail" : { + "description" : "Wrong color", + "type" : "REJECTED" + }, + "packageCount" : 25, + "eventType" : "PACKAGE_ADDED_TO_CONSOLIDATION" + } + ], + "meterNumber" : "8468376", + "returnDetail" : { + "authorizationName" : "Sammy Smith", + "reasonDetail" : [{ + "description" : "Wrong color", + "type" : "REJECTED" + } + ] + }, + "serviceDetail" : { + "description" : "FedEx Freight Economy.", + "shortDescription" : "FL", + "type" : "FEDEX_FREIGHT_ECONOMY" + }, + "destinationLocation" : { + "locationId" : "SEA", + "locationContactAndAddress" : { + "contact" : { + "personName" : "John Taylor", + "phoneNumber" : "1234567890", + "companyName" : "Fedex" + }, + "address" : { + "classification" : "BUSINESS", + "residential" : false, + "streetLines" : [ + "1043 North Easy Street", + "Suite 999" + ], + "city" : "SEATTLE", + "urbanizationCode" : "RAFAEL", + "stateOrProvinceCode" : "WA", + "postalCode" : "98101", + "countryCode" : "US" + } + }, + "locationType" : "PICKUP_LOCATION" + }, + "latestStatusDetail" : { + "scanLocation" : { + "classification" : "BUSINESS", + "residential" : false, + "streetLines" : [ + "1043 North Easy Street", + "Suite 999" + ], + "city" : "SEATTLE", + "urbanizationCode" : "RAFAEL", + "stateOrProvinceCode" : "WA", + "postalCode" : "98101", + "countryCode" : "US", + "countryName" : "United States" + }, + "code" : "PU", + "derivedCode" : "PU", + "ancillaryDetails" : [{ + "reason" : "15", + "reasonDescription" : "Customer not available or business closed", + "action" : "Contact us at to discuss possible delivery or pickup alternatives.", + "actionDescription" : "Customer not Available or Business Closed" + } + ], + "statusByLocale" : "Picked up", + "description" : "Picked up", + "delayDetail" : { + "type" : "WEATHER", + "subType" : "SNOW", + "status" : "DELAYED" + } + }, + "serviceCommitMessage" : { + "message" : "No scheduled delivery date available at this time.", + "type" : "ESTIMATED_DELIVERY_DATE_UNAVAILABLE" + }, + "informationNotes" : [{ + "code" : "CLEARANCE_ENTRY_FEE_APPLIES", + "description" : "this is an informational message" + } + ], + "error" : { + "code" : "TRACKING.TRACKINGNUMBER.EMPTY", + "parameterList" : [{ + "value" : "value", + "key" : "key" + } + ], + "message" : "Please provide tracking number." + }, + "specialHandlings" : [{ + "description" : "Deliver Weekday", + "type" : "DELIVER_WEEKDAY", + "paymentType" : "OTHER" + } + ], + "availableImages" : [{ + "size" : "LARGE", + "type" : "BILL_OF_LADING" + } + ], + "deliveryDetails" : { + "receivedByName" : "Reciever", + "destinationServiceArea" : "EDDUNAVAILABLE", + "destinationServiceAreaDescription" : "Appointment required", + "locationDescription" : "Receptionist/Front Desk", + "actualDeliveryAddress" : { + "classification" : "BUSINESS", + "residential" : false, + "streetLines" : [ + "1043 North Easy Street", + "Suite 999" + ], + "city" : "SEATTLE", + "urbanizationCode" : "RAFAEL", + "stateOrProvinceCode" : "WA", + "postalCode" : "98101", + "countryCode" : "US", + "countryName" : "United States" + }, + "deliveryToday" : false, + "locationType" : "FEDEX_EXPRESS_STATION", + "signedByName" : "Reciever", + "officeOrderDeliveryMethod" : "Courier", + "deliveryAttempts" : "0", + "deliveryOptionEligibilityDetails" : [{ + "option" : "INDIRECT_SIGNATURE_RELEASE", + "eligibility" : "INELIGIBLE" + } + ] + }, + "scanEvents" : [{ + "date" : "2018-02-02T12:01:00", + "derivedStatus" : "Picked Up", + "scanLocation" : { + "locationId" : "SEA", + "locationContactAndAddress" : { + "contact" : { + "personName" : "John Taylor", + "phoneNumber" : "1234567890", + "companyName" : "Fedex" + }, + "address" : { + "classification" : "BUSINESS", + "residential" : false, + "streetLines" : [ + "1043 North Easy Street", + "Suite 999" + ], + "city" : "SEATTLE", + "urbanizationCode" : "RAFAEL", + "stateOrProvinceCode" : "WA", + "postalCode" : "98101", + "countryCode" : "US" + } + }, + "locationType" : "PICKUP_LOCATION" + }, + "exceptionDescription" : "Package available for clearance", + "eventDescription" : "Picked Up", + "eventType" : "PU", + "derivedStatusCode" : "PU", + "exceptionCode" : "A25", + "delayDetail" : { + "type" : "WEATHER", + "subType" : "SNOW", + "status" : "DELAYED" + } + } + ], + "dateAndTimes" : [{ + "dateTime" : "2007-09-27T00:00:00", + "type" : "ACTUAL_DELIVERY" + } + ], + "packageDetails" : { + "physicalPackagingType" : "BARREL", + "sequenceNumber" : "45", + "undeliveredCount" : "7", + "packagingDescription" : { + "description" : "FedEx Pak", + "type" : "FEDEX_PAK" + }, + "count" : "1", + "weightAndDimensions" : { + "weight" : [{ + "unit" : "LB", + "value" : "22222.0" + } + ], + "dimensions" : [{ + "length" : 100, + "width" : 50, + "height" : 30, + "units" : "CM" + } + ] + }, + "packageContent" : [ + "wire hangers", + "buttons" + ], + "contentPieceCount" : "100", + "declaredValue" : { + "currency" : "USD", + "value" : 56.8 + } + }, + "goodsClassificationCode" : "goodsClassificationCode", + "holdAtLocation" : { + "locationId" : "SEA", + "locationContactAndAddress" : { + "contact" : { + "personName" : "John Taylor", + "phoneNumber" : "1234567890", + "companyName" : "Fedex" + }, + "address" : { + "classification" : "BUSINESS", + "residential" : false, + "streetLines" : [ + "1043 North Easy Street", + "Suite 999" + ], + "city" : "SEATTLE", + "urbanizationCode" : "RAFAEL", + "stateOrProvinceCode" : "WA", + "postalCode" : "98101", + "countryCode" : "US", + "countryName" : "United States" + } + }, + "locationType" : "PICKUP_LOCATION" + }, + "customDeliveryOptions" : [{ + "requestedAppointmentDetail" : { + "date" : "2019-05-07", + "window" : [{ + "description" : "Description field", + "window" : { + "begins" : "2021-10-01T08:00:00", + "ends" : "2021-10-15T00:00:00" + }, + "type" : "ESTIMATED_DELIVERY" + } + ] + }, + "description" : "Redirect the package to the hold location.", + "type" : "REDIRECT_TO_HOLD_AT_LOCATION", + "status" : "HELD" + } + ], + "estimatedDeliveryTimeWindow" : { + "description" : "Description field", + "window" : { + "begins" : "2021-10-01T08:00:00", + "ends" : "2021-10-15T00:00:00" + }, + "type" : "ESTIMATED_DELIVERY" + }, + "pieceCounts" : [{ + "count" : "35", + "description" : "picec count description", + "type" : "ORIGIN" + } + ], + "originLocation" : { + "locationId" : "SEA", + "locationContactAndAddress" : { + "contact" : { + "personName" : "John Taylor", + "phoneNumber" : "1234567890", + "companyName" : "Fedex" + }, + "address" : { + "classification" : "BUSINESS", + "residential" : false, + "streetLines" : [ + "1043 North Easy Street", + "Suite 999" + ], + "city" : "SEATTLE", + "urbanizationCode" : "RAFAEL", + "stateOrProvinceCode" : "WA", + "postalCode" : "98101", + "countryCode" : "US" + } + }, + "locationType" : "PICKUP_LOCATION" + }, + "recipientInformation" : { + "contact" : { + "personName" : "John Taylor", + "phoneNumber" : "1234567890", + "companyName" : "Fedex" + }, + "address" : { + "classification" : "BUSINESS", + "residential" : false, + "streetLines" : [ + "1043 North Easy Street", + "Suite 999" + ], + "city" : "SEATTLE", + "urbanizationCode" : "RAFAEL", + "stateOrProvinceCode" : "WA", + "postalCode" : "98101", + "countryCode" : "US", + "countryName" : "United States" + } + }, + "standardTransitTimeWindow" : { + "description" : "Description field", + "window" : { + "begins" : "2021-10-01T08:00:00", + "ends" : "2021-10-15T00:00:00" + }, + "type" : "ESTIMATED_DELIVERY" + }, + "shipmentDetails" : { + "contents" : [{ + "itemNumber" : "RZ5678", + "receivedQuantity" : "13", + "description" : "pulyurethane rope", + "partNumber" : "RK1345" + } + ], + "beforePossessionStatus" : false, + "weight" : [{ + "unit" : "LB", + "value" : "22222.0" + } + ], + "contentPieceCount" : "3333", + "splitShipments" : [{ + "pieceCount" : "10", + "statusDescription" : "status", + "timestamp" : "2019-05-07T08:00:07", + "statusCode" : "statuscode" + } + ] + }, + "reasonDetail" : { + "description" : "Wrong color", + "type" : "REJECTED" + }, + "availableNotifications" : [ + "ON_DELIVERY", + "ON_EXCEPTION" + ], + "shipperInformation" : { + "contact" : { + "personName" : "John Taylor", + "phoneNumber" : "1234567890", + "companyName" : "Fedex" + }, + "address" : { + "classification" : "BUSINESS", + "residential" : false, + "streetLines" : [ + "1043 North Easy Street", + "Suite 999" + ], + "city" : "SEATTLE", + "urbanizationCode" : "RAFAEL", + "stateOrProvinceCode" : "WA", + "postalCode" : "98101", + "countryCode" : "US", + "countryName" : "United States" + } + }, + "lastUpdatedDestinationAddress" : { + "classification" : "BUSINESS", + "residential" : false, + "streetLines" : [ + "1043 North Easy Street", + "Suite 999" + ], + "city" : "SEATTLE", + "urbanizationCode" : "RAFAEL", + "stateOrProvinceCode" : "WA", + "postalCode" : "98101", + "countryCode" : "US", + "countryName" : "United States" + } + } + ] + } + ], + "alerts" : "TRACKING.DATA.NOTFOUND - Tracking data unavailable" + } } \ No newline at end of file