diff --git a/src/get-rates-with-shipment-details/format-response.ts b/src/get-rates-with-shipment-details/format-response.ts index 02093fdd..1bac691b 100644 --- a/src/get-rates-with-shipment-details/format-response.ts +++ b/src/get-rates-with-shipment-details/format-response.ts @@ -240,9 +240,9 @@ function formatCustoms( customs: Response.InternationalShipmentOptions ): GetRatesWithShipmentDetailsTypes.Result["customs"] | null { return { - contents: customs.contents, - nonDelivery: customs.non_delivery, - customsItems: customs.customs_items + contents: customs?.contents, + nonDelivery: customs?.non_delivery, + customsItems: customs?.customs_items ? formatCustomsItems(customs.customs_items) : null, };