diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..44b4b651f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,1153 @@ +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +max_line_length = 120 +tab_width = 4 +ij_continuation_indent_size = 8 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = false +ij_smart_tabs = false +ij_visual_guides = none +ij_wrap_on_typing = false + +[*.css] +ij_css_align_closing_brace_with_properties = false +ij_css_blank_lines_around_nested_selector = 1 +ij_css_blank_lines_between_blocks = 1 +ij_css_block_comment_add_space = false +ij_css_brace_placement = end_of_line +ij_css_enforce_quotes_on_format = false +ij_css_hex_color_long_format = false +ij_css_hex_color_lower_case = false +ij_css_hex_color_short_format = false +ij_css_hex_color_upper_case = false +ij_css_keep_blank_lines_in_code = 2 +ij_css_keep_indents_on_empty_lines = false +ij_css_keep_single_line_blocks = false +ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_css_space_after_colon = true +ij_css_space_before_opening_brace = true +ij_css_use_double_quotes = true +ij_css_value_alignment = do_not_align + +[*.feature] +indent_size = 2 +ij_gherkin_keep_indents_on_empty_lines = false + +[*.haml] +indent_size = 2 +ij_haml_keep_indents_on_empty_lines = false + +[*.java] +ij_java_align_consecutive_assignments = false +ij_java_align_consecutive_variable_declarations = false +ij_java_align_group_field_declarations = false +ij_java_align_multiline_annotation_parameters = false +ij_java_align_multiline_array_initializer_expression = true +ij_java_align_multiline_assignment = false +ij_java_align_multiline_binary_operation = false +ij_java_align_multiline_chained_methods = false +ij_java_align_multiline_extends_list = false +ij_java_align_multiline_for = true +ij_java_align_multiline_method_parentheses = false +ij_java_align_multiline_parameters = true +ij_java_align_multiline_parameters_in_calls = false +ij_java_align_multiline_parenthesized_expression = false +ij_java_align_multiline_records = true +ij_java_align_multiline_resources = true +ij_java_align_multiline_ternary_operation = false +ij_java_align_multiline_text_blocks = false +ij_java_align_multiline_throws_list = false +ij_java_align_subsequent_simple_methods = false +ij_java_align_throws_keyword = false +ij_java_align_types_in_multi_catch = true +ij_java_annotation_parameter_wrap = off +ij_java_array_initializer_new_line_after_left_brace = true +ij_java_array_initializer_right_brace_on_new_line = true +ij_java_array_initializer_wrap = split_into_lines +ij_java_assert_statement_colon_on_next_line = false +ij_java_assert_statement_wrap = normal +ij_java_assignment_wrap = normal +ij_java_binary_operation_sign_on_next_line = false +ij_java_binary_operation_wrap = normal +ij_java_blank_lines_after_anonymous_class_header = 0 +ij_java_blank_lines_after_class_header = 0 +ij_java_blank_lines_after_imports = 1 +ij_java_blank_lines_after_package = 1 +ij_java_blank_lines_around_class = 1 +ij_java_blank_lines_around_field = 0 +ij_java_blank_lines_around_field_in_interface = 0 +ij_java_blank_lines_around_initializer = 1 +ij_java_blank_lines_around_method = 1 +ij_java_blank_lines_around_method_in_interface = 1 +ij_java_blank_lines_before_class_end = 0 +ij_java_blank_lines_before_imports = 1 +ij_java_blank_lines_before_method_body = 0 +ij_java_blank_lines_before_package = 0 +ij_java_block_brace_style = end_of_line +ij_java_block_comment_add_space = false +ij_java_block_comment_at_first_column = true +ij_java_builder_methods = none +ij_java_call_parameters_new_line_after_left_paren = false +ij_java_call_parameters_right_paren_on_new_line = false +ij_java_call_parameters_wrap = normal +ij_java_case_statement_on_separate_line = true +ij_java_catch_on_new_line = false +ij_java_class_annotation_wrap = split_into_lines +ij_java_class_brace_style = end_of_line +ij_java_class_count_to_use_import_on_demand = 999 +ij_java_class_names_in_javadoc = 1 +ij_java_do_not_indent_top_level_class_members = false +ij_java_do_not_wrap_after_single_annotation = false +ij_java_do_not_wrap_after_single_annotation_in_parameter = false +ij_java_do_while_brace_force = always +ij_java_doc_add_blank_line_after_description = true +ij_java_doc_add_blank_line_after_param_comments = false +ij_java_doc_add_blank_line_after_return = false +ij_java_doc_add_p_tag_on_empty_lines = true +ij_java_doc_align_exception_comments = true +ij_java_doc_align_param_comments = true +ij_java_doc_do_not_wrap_if_one_line = false +ij_java_doc_enable_formatting = true +ij_java_doc_enable_leading_asterisks = true +ij_java_doc_indent_on_continuation = false +ij_java_doc_keep_empty_lines = true +ij_java_doc_keep_empty_parameter_tag = true +ij_java_doc_keep_empty_return_tag = true +ij_java_doc_keep_empty_throws_tag = true +ij_java_doc_keep_invalid_tags = true +ij_java_doc_param_description_on_new_line = false +ij_java_doc_preserve_line_breaks = false +ij_java_doc_use_throws_not_exception_tag = true +ij_java_else_on_new_line = false +ij_java_entity_dd_suffix = EJB +ij_java_entity_eb_suffix = Bean +ij_java_entity_hi_suffix = Home +ij_java_entity_lhi_prefix = Local +ij_java_entity_lhi_suffix = Home +ij_java_entity_li_prefix = Local +ij_java_entity_pk_class = java.lang.String +ij_java_entity_vo_suffix = VO +ij_java_enum_constants_wrap = split_into_lines +ij_java_extends_keyword_wrap = normal +ij_java_extends_list_wrap = normal +ij_java_field_annotation_wrap = split_into_lines +ij_java_finally_on_new_line = false +ij_java_for_brace_force = always +ij_java_for_statement_new_line_after_left_paren = false +ij_java_for_statement_right_paren_on_new_line = false +ij_java_for_statement_wrap = normal +ij_java_generate_final_locals = false +ij_java_generate_final_parameters = false +ij_java_if_brace_force = always +ij_java_imports_layout = *,|,javax.**,java.**,|,$* +ij_java_indent_case_from_switch = true +ij_java_insert_inner_class_imports = false +ij_java_insert_override_annotation = true +ij_java_keep_blank_lines_before_right_brace = 2 +ij_java_keep_blank_lines_between_package_declaration_and_header = 2 +ij_java_keep_blank_lines_in_code = 2 +ij_java_keep_blank_lines_in_declarations = 2 +ij_java_keep_builder_methods_indents = false +ij_java_keep_control_statement_in_one_line = true +ij_java_keep_first_column_comment = true +ij_java_keep_indents_on_empty_lines = false +ij_java_keep_line_breaks = false +ij_java_keep_multiple_expressions_in_one_line = false +ij_java_keep_simple_blocks_in_one_line = false +ij_java_keep_simple_classes_in_one_line = true +ij_java_keep_simple_lambdas_in_one_line = false +ij_java_keep_simple_methods_in_one_line = true +ij_java_label_indent_absolute = false +ij_java_label_indent_size = 0 +ij_java_lambda_brace_style = end_of_line +ij_java_layout_static_imports_separately = true +ij_java_line_comment_add_space = false +ij_java_line_comment_add_space_on_reformat = false +ij_java_line_comment_at_first_column = true +ij_java_message_dd_suffix = EJB +ij_java_message_eb_suffix = Bean +ij_java_method_annotation_wrap = split_into_lines +ij_java_method_brace_style = end_of_line +ij_java_method_call_chain_wrap = normal +ij_java_method_parameters_new_line_after_left_paren = false +ij_java_method_parameters_right_paren_on_new_line = false +ij_java_method_parameters_wrap = normal +ij_java_modifier_list_wrap = false +ij_java_multi_catch_types_wrap = normal +ij_java_names_count_to_use_import_on_demand = 999 +ij_java_new_line_after_lparen_in_annotation = false +ij_java_new_line_after_lparen_in_record_header = false +ij_java_parameter_annotation_wrap = normal +ij_java_parentheses_expression_new_line_after_left_paren = false +ij_java_parentheses_expression_right_paren_on_new_line = false +ij_java_place_assignment_sign_on_next_line = false +ij_java_prefer_longer_names = true +ij_java_prefer_parameters_wrap = false +ij_java_record_components_wrap = normal +ij_java_repeat_synchronized = true +ij_java_replace_instanceof_and_cast = false +ij_java_replace_null_check = true +ij_java_replace_sum_lambda_with_method_ref = true +ij_java_resource_list_new_line_after_left_paren = false +ij_java_resource_list_right_paren_on_new_line = false +ij_java_resource_list_wrap = normal +ij_java_rparen_on_new_line_in_annotation = false +ij_java_rparen_on_new_line_in_record_header = false +ij_java_session_dd_suffix = EJB +ij_java_session_eb_suffix = Bean +ij_java_session_hi_suffix = Home +ij_java_session_lhi_prefix = Local +ij_java_session_lhi_suffix = Home +ij_java_session_li_prefix = Local +ij_java_session_si_suffix = Service +ij_java_space_after_closing_angle_bracket_in_type_argument = false +ij_java_space_after_colon = true +ij_java_space_after_comma = true +ij_java_space_after_comma_in_type_arguments = true +ij_java_space_after_for_semicolon = true +ij_java_space_after_quest = true +ij_java_space_after_type_cast = true +ij_java_space_before_annotation_array_initializer_left_brace = false +ij_java_space_before_annotation_parameter_list = true +ij_java_space_before_array_initializer_left_brace = true +ij_java_space_before_catch_keyword = true +ij_java_space_before_catch_left_brace = true +ij_java_space_before_catch_parentheses = true +ij_java_space_before_class_left_brace = true +ij_java_space_before_colon = true +ij_java_space_before_colon_in_foreach = true +ij_java_space_before_comma = false +ij_java_space_before_do_left_brace = true +ij_java_space_before_else_keyword = true +ij_java_space_before_else_left_brace = true +ij_java_space_before_finally_keyword = true +ij_java_space_before_finally_left_brace = true +ij_java_space_before_for_left_brace = true +ij_java_space_before_for_parentheses = true +ij_java_space_before_for_semicolon = false +ij_java_space_before_if_left_brace = true +ij_java_space_before_if_parentheses = true +ij_java_space_before_method_call_parentheses = false +ij_java_space_before_method_left_brace = true +ij_java_space_before_method_parentheses = false +ij_java_space_before_opening_angle_bracket_in_type_parameter = false +ij_java_space_before_quest = true +ij_java_space_before_switch_left_brace = true +ij_java_space_before_switch_parentheses = true +ij_java_space_before_synchronized_left_brace = true +ij_java_space_before_synchronized_parentheses = true +ij_java_space_before_try_left_brace = true +ij_java_space_before_try_parentheses = true +ij_java_space_before_type_parameter_list = false +ij_java_space_before_while_keyword = true +ij_java_space_before_while_left_brace = true +ij_java_space_before_while_parentheses = true +ij_java_space_inside_one_line_enum_braces = false +ij_java_space_within_empty_array_initializer_braces = true +ij_java_space_within_empty_method_call_parentheses = false +ij_java_space_within_empty_method_parentheses = false +ij_java_spaces_around_additive_operators = true +ij_java_spaces_around_annotation_eq = true +ij_java_spaces_around_assignment_operators = true +ij_java_spaces_around_bitwise_operators = true +ij_java_spaces_around_equality_operators = true +ij_java_spaces_around_lambda_arrow = true +ij_java_spaces_around_logical_operators = true +ij_java_spaces_around_method_ref_dbl_colon = false +ij_java_spaces_around_multiplicative_operators = true +ij_java_spaces_around_relational_operators = true +ij_java_spaces_around_shift_operators = true +ij_java_spaces_around_type_bounds_in_type_parameters = true +ij_java_spaces_around_unary_operator = false +ij_java_spaces_within_angle_brackets = false +ij_java_spaces_within_annotation_parentheses = false +ij_java_spaces_within_array_initializer_braces = true +ij_java_spaces_within_braces = false +ij_java_spaces_within_brackets = false +ij_java_spaces_within_cast_parentheses = false +ij_java_spaces_within_catch_parentheses = false +ij_java_spaces_within_for_parentheses = false +ij_java_spaces_within_if_parentheses = false +ij_java_spaces_within_method_call_parentheses = false +ij_java_spaces_within_method_parentheses = false +ij_java_spaces_within_parentheses = false +ij_java_spaces_within_record_header = false +ij_java_spaces_within_switch_parentheses = false +ij_java_spaces_within_synchronized_parentheses = false +ij_java_spaces_within_try_parentheses = false +ij_java_spaces_within_while_parentheses = false +ij_java_special_else_if_treatment = true +ij_java_subclass_name_suffix = Impl +ij_java_ternary_operation_signs_on_next_line = false +ij_java_ternary_operation_wrap = normal +ij_java_test_name_suffix = Test +ij_java_throws_keyword_wrap = normal +ij_java_throws_list_wrap = normal +ij_java_use_external_annotations = false +ij_java_use_fq_class_names = false +ij_java_use_relative_indents = false +ij_java_use_single_class_imports = true +ij_java_variable_annotation_wrap = normal +ij_java_visibility = private +ij_java_while_brace_force = always +ij_java_while_on_new_line = false +ij_java_wrap_comments = false +ij_java_wrap_first_method_in_call_chain = false +ij_java_wrap_long_lines = false + +[*.less] +indent_size = 2 +ij_less_align_closing_brace_with_properties = false +ij_less_blank_lines_around_nested_selector = 1 +ij_less_blank_lines_between_blocks = 1 +ij_less_block_comment_add_space = false +ij_less_brace_placement = 0 +ij_less_enforce_quotes_on_format = false +ij_less_hex_color_long_format = false +ij_less_hex_color_lower_case = false +ij_less_hex_color_short_format = false +ij_less_hex_color_upper_case = false +ij_less_keep_blank_lines_in_code = 2 +ij_less_keep_indents_on_empty_lines = false +ij_less_keep_single_line_blocks = false +ij_less_line_comment_add_space = false +ij_less_line_comment_at_first_column = false +ij_less_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_less_space_after_colon = true +ij_less_space_before_opening_brace = true +ij_less_use_double_quotes = true +ij_less_value_alignment = 0 + +[*.proto] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_protobuf_keep_blank_lines_in_code = 2 +ij_protobuf_keep_indents_on_empty_lines = false +ij_protobuf_keep_line_breaks = true +ij_protobuf_space_after_comma = true +ij_protobuf_space_before_comma = false +ij_protobuf_spaces_around_assignment_operators = true +ij_protobuf_spaces_within_braces = false +ij_protobuf_spaces_within_brackets = false + +[*.sass] +indent_size = 2 +ij_sass_align_closing_brace_with_properties = false +ij_sass_blank_lines_around_nested_selector = 1 +ij_sass_blank_lines_between_blocks = 1 +ij_sass_brace_placement = 0 +ij_sass_enforce_quotes_on_format = false +ij_sass_hex_color_long_format = false +ij_sass_hex_color_lower_case = false +ij_sass_hex_color_short_format = false +ij_sass_hex_color_upper_case = false +ij_sass_keep_blank_lines_in_code = 2 +ij_sass_keep_indents_on_empty_lines = false +ij_sass_keep_single_line_blocks = false +ij_sass_line_comment_add_space = false +ij_sass_line_comment_at_first_column = false +ij_sass_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_sass_space_after_colon = true +ij_sass_space_before_opening_brace = true +ij_sass_use_double_quotes = true +ij_sass_value_alignment = 0 + +[*.scss] +indent_size = 2 +ij_scss_align_closing_brace_with_properties = false +ij_scss_blank_lines_around_nested_selector = 1 +ij_scss_blank_lines_between_blocks = 1 +ij_scss_block_comment_add_space = false +ij_scss_brace_placement = 0 +ij_scss_enforce_quotes_on_format = false +ij_scss_hex_color_long_format = false +ij_scss_hex_color_lower_case = false +ij_scss_hex_color_short_format = false +ij_scss_hex_color_upper_case = false +ij_scss_keep_blank_lines_in_code = 2 +ij_scss_keep_indents_on_empty_lines = false +ij_scss_keep_single_line_blocks = false +ij_scss_line_comment_add_space = false +ij_scss_line_comment_at_first_column = false +ij_scss_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_scss_space_after_colon = true +ij_scss_space_before_opening_brace = true +ij_scss_use_double_quotes = true +ij_scss_value_alignment = 0 + +[*.styl] +indent_size = 2 +ij_stylus_align_closing_brace_with_properties = false +ij_stylus_blank_lines_around_nested_selector = 1 +ij_stylus_blank_lines_between_blocks = 1 +ij_stylus_brace_placement = 0 +ij_stylus_enforce_quotes_on_format = false +ij_stylus_hex_color_long_format = false +ij_stylus_hex_color_lower_case = false +ij_stylus_hex_color_short_format = false +ij_stylus_hex_color_upper_case = false +ij_stylus_keep_blank_lines_in_code = 2 +ij_stylus_keep_indents_on_empty_lines = false +ij_stylus_keep_single_line_blocks = false +ij_stylus_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_stylus_space_after_colon = true +ij_stylus_space_before_opening_brace = true +ij_stylus_use_double_quotes = true +ij_stylus_value_alignment = 0 + +[.editorconfig] +ij_editorconfig_align_group_field_declarations = false +ij_editorconfig_space_after_colon = false +ij_editorconfig_space_after_comma = true +ij_editorconfig_space_before_colon = false +ij_editorconfig_space_before_comma = false +ij_editorconfig_spaces_around_assignment_operators = true + +[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}] +ij_xml_align_attributes = true +ij_xml_align_text = false +ij_xml_attribute_wrap = normal +ij_xml_block_comment_add_space = false +ij_xml_block_comment_at_first_column = true +ij_xml_keep_blank_lines = 2 +ij_xml_keep_indents_on_empty_lines = false +ij_xml_keep_line_breaks = true +ij_xml_keep_line_breaks_in_text = true +ij_xml_keep_whitespaces = false +ij_xml_keep_whitespaces_around_cdata = preserve +ij_xml_keep_whitespaces_inside_cdata = false +ij_xml_line_comment_at_first_column = true +ij_xml_space_after_tag_name = false +ij_xml_space_around_equals_in_attribute = false +ij_xml_space_inside_empty_tag = false +ij_xml_text_wrap = normal +ij_xml_use_custom_settings = false + +[{*.ats,*.cts,*.mts,*.ts}] +ij_continuation_indent_size = 4 +ij_typescript_align_imports = false +ij_typescript_align_multiline_array_initializer_expression = false +ij_typescript_align_multiline_binary_operation = false +ij_typescript_align_multiline_chained_methods = false +ij_typescript_align_multiline_extends_list = false +ij_typescript_align_multiline_for = true +ij_typescript_align_multiline_parameters = true +ij_typescript_align_multiline_parameters_in_calls = false +ij_typescript_align_multiline_ternary_operation = false +ij_typescript_align_object_properties = 0 +ij_typescript_align_union_types = false +ij_typescript_align_var_statements = 0 +ij_typescript_array_initializer_new_line_after_left_brace = false +ij_typescript_array_initializer_right_brace_on_new_line = false +ij_typescript_array_initializer_wrap = off +ij_typescript_assignment_wrap = off +ij_typescript_binary_operation_sign_on_next_line = false +ij_typescript_binary_operation_wrap = off +ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_typescript_blank_lines_after_imports = 1 +ij_typescript_blank_lines_around_class = 1 +ij_typescript_blank_lines_around_field = 0 +ij_typescript_blank_lines_around_field_in_interface = 0 +ij_typescript_blank_lines_around_function = 1 +ij_typescript_blank_lines_around_method = 1 +ij_typescript_blank_lines_around_method_in_interface = 1 +ij_typescript_block_brace_style = end_of_line +ij_typescript_block_comment_add_space = false +ij_typescript_block_comment_at_first_column = true +ij_typescript_call_parameters_new_line_after_left_paren = false +ij_typescript_call_parameters_right_paren_on_new_line = false +ij_typescript_call_parameters_wrap = off +ij_typescript_catch_on_new_line = false +ij_typescript_chained_call_dot_on_new_line = true +ij_typescript_class_brace_style = end_of_line +ij_typescript_comma_on_new_line = false +ij_typescript_do_while_brace_force = never +ij_typescript_else_on_new_line = false +ij_typescript_enforce_trailing_comma = keep +ij_typescript_enum_constants_wrap = on_every_item +ij_typescript_extends_keyword_wrap = off +ij_typescript_extends_list_wrap = off +ij_typescript_field_prefix = _ +ij_typescript_file_name_style = relaxed +ij_typescript_finally_on_new_line = false +ij_typescript_for_brace_force = never +ij_typescript_for_statement_new_line_after_left_paren = false +ij_typescript_for_statement_right_paren_on_new_line = false +ij_typescript_for_statement_wrap = off +ij_typescript_force_quote_style = false +ij_typescript_force_semicolon_style = false +ij_typescript_function_expression_brace_style = end_of_line +ij_typescript_if_brace_force = never +ij_typescript_import_merge_members = global +ij_typescript_import_prefer_absolute_path = global +ij_typescript_import_sort_members = true +ij_typescript_import_sort_module_name = false +ij_typescript_import_use_node_resolution = true +ij_typescript_imports_wrap = on_every_item +ij_typescript_indent_case_from_switch = true +ij_typescript_indent_chained_calls = true +ij_typescript_indent_package_children = 0 +ij_typescript_jsdoc_include_types = false +ij_typescript_jsx_attribute_value = braces +ij_typescript_keep_blank_lines_in_code = 2 +ij_typescript_keep_first_column_comment = true +ij_typescript_keep_indents_on_empty_lines = false +ij_typescript_keep_line_breaks = true +ij_typescript_keep_simple_blocks_in_one_line = false +ij_typescript_keep_simple_methods_in_one_line = false +ij_typescript_line_comment_add_space = true +ij_typescript_line_comment_at_first_column = false +ij_typescript_method_brace_style = end_of_line +ij_typescript_method_call_chain_wrap = off +ij_typescript_method_parameters_new_line_after_left_paren = false +ij_typescript_method_parameters_right_paren_on_new_line = false +ij_typescript_method_parameters_wrap = off +ij_typescript_object_literal_wrap = on_every_item +ij_typescript_parentheses_expression_new_line_after_left_paren = false +ij_typescript_parentheses_expression_right_paren_on_new_line = false +ij_typescript_place_assignment_sign_on_next_line = false +ij_typescript_prefer_as_type_cast = false +ij_typescript_prefer_explicit_types_function_expression_returns = false +ij_typescript_prefer_explicit_types_function_returns = false +ij_typescript_prefer_explicit_types_vars_fields = false +ij_typescript_prefer_parameters_wrap = false +ij_typescript_reformat_c_style_comments = false +ij_typescript_space_after_colon = true +ij_typescript_space_after_comma = true +ij_typescript_space_after_dots_in_rest_parameter = false +ij_typescript_space_after_generator_mult = true +ij_typescript_space_after_property_colon = true +ij_typescript_space_after_quest = true +ij_typescript_space_after_type_colon = true +ij_typescript_space_after_unary_not = false +ij_typescript_space_before_async_arrow_lparen = true +ij_typescript_space_before_catch_keyword = true +ij_typescript_space_before_catch_left_brace = true +ij_typescript_space_before_catch_parentheses = true +ij_typescript_space_before_class_lbrace = true +ij_typescript_space_before_class_left_brace = true +ij_typescript_space_before_colon = true +ij_typescript_space_before_comma = false +ij_typescript_space_before_do_left_brace = true +ij_typescript_space_before_else_keyword = true +ij_typescript_space_before_else_left_brace = true +ij_typescript_space_before_finally_keyword = true +ij_typescript_space_before_finally_left_brace = true +ij_typescript_space_before_for_left_brace = true +ij_typescript_space_before_for_parentheses = true +ij_typescript_space_before_for_semicolon = false +ij_typescript_space_before_function_left_parenth = true +ij_typescript_space_before_generator_mult = false +ij_typescript_space_before_if_left_brace = true +ij_typescript_space_before_if_parentheses = true +ij_typescript_space_before_method_call_parentheses = false +ij_typescript_space_before_method_left_brace = true +ij_typescript_space_before_method_parentheses = false +ij_typescript_space_before_property_colon = false +ij_typescript_space_before_quest = true +ij_typescript_space_before_switch_left_brace = true +ij_typescript_space_before_switch_parentheses = true +ij_typescript_space_before_try_left_brace = true +ij_typescript_space_before_type_colon = false +ij_typescript_space_before_unary_not = false +ij_typescript_space_before_while_keyword = true +ij_typescript_space_before_while_left_brace = true +ij_typescript_space_before_while_parentheses = true +ij_typescript_spaces_around_additive_operators = true +ij_typescript_spaces_around_arrow_function_operator = true +ij_typescript_spaces_around_assignment_operators = true +ij_typescript_spaces_around_bitwise_operators = true +ij_typescript_spaces_around_equality_operators = true +ij_typescript_spaces_around_logical_operators = true +ij_typescript_spaces_around_multiplicative_operators = true +ij_typescript_spaces_around_relational_operators = true +ij_typescript_spaces_around_shift_operators = true +ij_typescript_spaces_around_unary_operator = false +ij_typescript_spaces_within_array_initializer_brackets = false +ij_typescript_spaces_within_brackets = false +ij_typescript_spaces_within_catch_parentheses = false +ij_typescript_spaces_within_for_parentheses = false +ij_typescript_spaces_within_if_parentheses = false +ij_typescript_spaces_within_imports = false +ij_typescript_spaces_within_interpolation_expressions = false +ij_typescript_spaces_within_method_call_parentheses = false +ij_typescript_spaces_within_method_parentheses = false +ij_typescript_spaces_within_object_literal_braces = false +ij_typescript_spaces_within_object_type_braces = true +ij_typescript_spaces_within_parentheses = false +ij_typescript_spaces_within_switch_parentheses = false +ij_typescript_spaces_within_type_assertion = false +ij_typescript_spaces_within_union_types = true +ij_typescript_spaces_within_while_parentheses = false +ij_typescript_special_else_if_treatment = true +ij_typescript_ternary_operation_signs_on_next_line = false +ij_typescript_ternary_operation_wrap = off +ij_typescript_union_types_wrap = on_every_item +ij_typescript_use_chained_calls_group_indents = false +ij_typescript_use_double_quotes = true +ij_typescript_use_explicit_js_extension = auto +ij_typescript_use_path_mapping = always +ij_typescript_use_public_modifier = false +ij_typescript_use_semicolon_after_statement = true +ij_typescript_var_declaration_wrap = normal +ij_typescript_while_brace_force = never +ij_typescript_while_on_new_line = false +ij_typescript_wrap_comments = false + +[{*.bash,*.sh,*.zsh}] +indent_size = 2 +tab_width = 2 +ij_shell_binary_ops_start_line = false +ij_shell_keep_column_alignment_padding = false +ij_shell_minify_program = false +ij_shell_redirect_followed_by_space = false +ij_shell_switch_cases_indented = false +ij_shell_use_unix_line_separator = true + +[{*.cjs,*.js}] +ij_continuation_indent_size = 4 +ij_javascript_align_imports = false +ij_javascript_align_multiline_array_initializer_expression = false +ij_javascript_align_multiline_binary_operation = false +ij_javascript_align_multiline_chained_methods = false +ij_javascript_align_multiline_extends_list = false +ij_javascript_align_multiline_for = true +ij_javascript_align_multiline_parameters = true +ij_javascript_align_multiline_parameters_in_calls = false +ij_javascript_align_multiline_ternary_operation = false +ij_javascript_align_object_properties = 0 +ij_javascript_align_union_types = false +ij_javascript_align_var_statements = 0 +ij_javascript_array_initializer_new_line_after_left_brace = false +ij_javascript_array_initializer_right_brace_on_new_line = false +ij_javascript_array_initializer_wrap = off +ij_javascript_assignment_wrap = off +ij_javascript_binary_operation_sign_on_next_line = false +ij_javascript_binary_operation_wrap = off +ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_javascript_blank_lines_after_imports = 1 +ij_javascript_blank_lines_around_class = 1 +ij_javascript_blank_lines_around_field = 0 +ij_javascript_blank_lines_around_function = 1 +ij_javascript_blank_lines_around_method = 1 +ij_javascript_block_brace_style = end_of_line +ij_javascript_block_comment_add_space = false +ij_javascript_block_comment_at_first_column = true +ij_javascript_call_parameters_new_line_after_left_paren = false +ij_javascript_call_parameters_right_paren_on_new_line = false +ij_javascript_call_parameters_wrap = off +ij_javascript_catch_on_new_line = false +ij_javascript_chained_call_dot_on_new_line = true +ij_javascript_class_brace_style = end_of_line +ij_javascript_comma_on_new_line = false +ij_javascript_do_while_brace_force = never +ij_javascript_else_on_new_line = false +ij_javascript_enforce_trailing_comma = keep +ij_javascript_extends_keyword_wrap = off +ij_javascript_extends_list_wrap = off +ij_javascript_field_prefix = _ +ij_javascript_file_name_style = relaxed +ij_javascript_finally_on_new_line = false +ij_javascript_for_brace_force = never +ij_javascript_for_statement_new_line_after_left_paren = false +ij_javascript_for_statement_right_paren_on_new_line = false +ij_javascript_for_statement_wrap = off +ij_javascript_force_quote_style = false +ij_javascript_force_semicolon_style = false +ij_javascript_function_expression_brace_style = end_of_line +ij_javascript_if_brace_force = never +ij_javascript_import_merge_members = global +ij_javascript_import_prefer_absolute_path = global +ij_javascript_import_sort_members = true +ij_javascript_import_sort_module_name = false +ij_javascript_import_use_node_resolution = true +ij_javascript_imports_wrap = on_every_item +ij_javascript_indent_case_from_switch = true +ij_javascript_indent_chained_calls = true +ij_javascript_indent_package_children = 0 +ij_javascript_jsx_attribute_value = braces +ij_javascript_keep_blank_lines_in_code = 2 +ij_javascript_keep_first_column_comment = true +ij_javascript_keep_indents_on_empty_lines = false +ij_javascript_keep_line_breaks = true +ij_javascript_keep_simple_blocks_in_one_line = false +ij_javascript_keep_simple_methods_in_one_line = false +ij_javascript_line_comment_add_space = true +ij_javascript_line_comment_at_first_column = false +ij_javascript_method_brace_style = end_of_line +ij_javascript_method_call_chain_wrap = off +ij_javascript_method_parameters_new_line_after_left_paren = false +ij_javascript_method_parameters_right_paren_on_new_line = false +ij_javascript_method_parameters_wrap = off +ij_javascript_object_literal_wrap = on_every_item +ij_javascript_parentheses_expression_new_line_after_left_paren = false +ij_javascript_parentheses_expression_right_paren_on_new_line = false +ij_javascript_place_assignment_sign_on_next_line = false +ij_javascript_prefer_as_type_cast = false +ij_javascript_prefer_explicit_types_function_expression_returns = false +ij_javascript_prefer_explicit_types_function_returns = false +ij_javascript_prefer_explicit_types_vars_fields = false +ij_javascript_prefer_parameters_wrap = false +ij_javascript_reformat_c_style_comments = false +ij_javascript_space_after_colon = true +ij_javascript_space_after_comma = true +ij_javascript_space_after_dots_in_rest_parameter = false +ij_javascript_space_after_generator_mult = true +ij_javascript_space_after_property_colon = true +ij_javascript_space_after_quest = true +ij_javascript_space_after_type_colon = true +ij_javascript_space_after_unary_not = false +ij_javascript_space_before_async_arrow_lparen = true +ij_javascript_space_before_catch_keyword = true +ij_javascript_space_before_catch_left_brace = true +ij_javascript_space_before_catch_parentheses = true +ij_javascript_space_before_class_lbrace = true +ij_javascript_space_before_class_left_brace = true +ij_javascript_space_before_colon = true +ij_javascript_space_before_comma = false +ij_javascript_space_before_do_left_brace = true +ij_javascript_space_before_else_keyword = true +ij_javascript_space_before_else_left_brace = true +ij_javascript_space_before_finally_keyword = true +ij_javascript_space_before_finally_left_brace = true +ij_javascript_space_before_for_left_brace = true +ij_javascript_space_before_for_parentheses = true +ij_javascript_space_before_for_semicolon = false +ij_javascript_space_before_function_left_parenth = true +ij_javascript_space_before_generator_mult = false +ij_javascript_space_before_if_left_brace = true +ij_javascript_space_before_if_parentheses = true +ij_javascript_space_before_method_call_parentheses = false +ij_javascript_space_before_method_left_brace = true +ij_javascript_space_before_method_parentheses = false +ij_javascript_space_before_property_colon = false +ij_javascript_space_before_quest = true +ij_javascript_space_before_switch_left_brace = true +ij_javascript_space_before_switch_parentheses = true +ij_javascript_space_before_try_left_brace = true +ij_javascript_space_before_type_colon = false +ij_javascript_space_before_unary_not = false +ij_javascript_space_before_while_keyword = true +ij_javascript_space_before_while_left_brace = true +ij_javascript_space_before_while_parentheses = true +ij_javascript_spaces_around_additive_operators = true +ij_javascript_spaces_around_arrow_function_operator = true +ij_javascript_spaces_around_assignment_operators = true +ij_javascript_spaces_around_bitwise_operators = true +ij_javascript_spaces_around_equality_operators = true +ij_javascript_spaces_around_logical_operators = true +ij_javascript_spaces_around_multiplicative_operators = true +ij_javascript_spaces_around_relational_operators = true +ij_javascript_spaces_around_shift_operators = true +ij_javascript_spaces_around_unary_operator = false +ij_javascript_spaces_within_array_initializer_brackets = false +ij_javascript_spaces_within_brackets = false +ij_javascript_spaces_within_catch_parentheses = false +ij_javascript_spaces_within_for_parentheses = false +ij_javascript_spaces_within_if_parentheses = false +ij_javascript_spaces_within_imports = false +ij_javascript_spaces_within_interpolation_expressions = false +ij_javascript_spaces_within_method_call_parentheses = false +ij_javascript_spaces_within_method_parentheses = false +ij_javascript_spaces_within_object_literal_braces = false +ij_javascript_spaces_within_object_type_braces = true +ij_javascript_spaces_within_parentheses = false +ij_javascript_spaces_within_switch_parentheses = false +ij_javascript_spaces_within_type_assertion = false +ij_javascript_spaces_within_union_types = true +ij_javascript_spaces_within_while_parentheses = false +ij_javascript_special_else_if_treatment = true +ij_javascript_ternary_operation_signs_on_next_line = false +ij_javascript_ternary_operation_wrap = off +ij_javascript_union_types_wrap = on_every_item +ij_javascript_use_chained_calls_group_indents = false +ij_javascript_use_double_quotes = true +ij_javascript_use_explicit_js_extension = auto +ij_javascript_use_path_mapping = always +ij_javascript_use_public_modifier = false +ij_javascript_use_semicolon_after_statement = true +ij_javascript_var_declaration_wrap = normal +ij_javascript_while_brace_force = never +ij_javascript_while_on_new_line = false +ij_javascript_wrap_comments = false + +[{*.ft,*.vm,*.vsl}] +ij_vtl_keep_indents_on_empty_lines = false + +[{*.gant,*.groovy,*.gy}] +ij_groovy_align_group_field_declarations = false +ij_groovy_align_multiline_array_initializer_expression = false +ij_groovy_align_multiline_assignment = false +ij_groovy_align_multiline_binary_operation = false +ij_groovy_align_multiline_chained_methods = false +ij_groovy_align_multiline_extends_list = false +ij_groovy_align_multiline_for = true +ij_groovy_align_multiline_list_or_map = true +ij_groovy_align_multiline_method_parentheses = false +ij_groovy_align_multiline_parameters = true +ij_groovy_align_multiline_parameters_in_calls = false +ij_groovy_align_multiline_resources = true +ij_groovy_align_multiline_ternary_operation = false +ij_groovy_align_multiline_throws_list = false +ij_groovy_align_named_args_in_map = true +ij_groovy_align_throws_keyword = false +ij_groovy_array_initializer_new_line_after_left_brace = false +ij_groovy_array_initializer_right_brace_on_new_line = false +ij_groovy_array_initializer_wrap = off +ij_groovy_assert_statement_wrap = off +ij_groovy_assignment_wrap = off +ij_groovy_binary_operation_wrap = off +ij_groovy_blank_lines_after_class_header = 0 +ij_groovy_blank_lines_after_imports = 1 +ij_groovy_blank_lines_after_package = 1 +ij_groovy_blank_lines_around_class = 1 +ij_groovy_blank_lines_around_field = 0 +ij_groovy_blank_lines_around_field_in_interface = 0 +ij_groovy_blank_lines_around_method = 1 +ij_groovy_blank_lines_around_method_in_interface = 1 +ij_groovy_blank_lines_before_imports = 1 +ij_groovy_blank_lines_before_method_body = 0 +ij_groovy_blank_lines_before_package = 0 +ij_groovy_block_brace_style = end_of_line +ij_groovy_block_comment_add_space = false +ij_groovy_block_comment_at_first_column = true +ij_groovy_call_parameters_new_line_after_left_paren = false +ij_groovy_call_parameters_right_paren_on_new_line = false +ij_groovy_call_parameters_wrap = off +ij_groovy_catch_on_new_line = false +ij_groovy_class_annotation_wrap = split_into_lines +ij_groovy_class_brace_style = end_of_line +ij_groovy_class_count_to_use_import_on_demand = 5 +ij_groovy_do_while_brace_force = never +ij_groovy_else_on_new_line = false +ij_groovy_enable_groovydoc_formatting = true +ij_groovy_enum_constants_wrap = off +ij_groovy_extends_keyword_wrap = off +ij_groovy_extends_list_wrap = off +ij_groovy_field_annotation_wrap = split_into_lines +ij_groovy_finally_on_new_line = false +ij_groovy_for_brace_force = never +ij_groovy_for_statement_new_line_after_left_paren = false +ij_groovy_for_statement_right_paren_on_new_line = false +ij_groovy_for_statement_wrap = off +ij_groovy_if_brace_force = never +ij_groovy_import_annotation_wrap = 2 +ij_groovy_imports_layout = *,|,javax.**,java.**,|,$* +ij_groovy_indent_case_from_switch = true +ij_groovy_indent_label_blocks = true +ij_groovy_insert_inner_class_imports = false +ij_groovy_keep_blank_lines_before_right_brace = 2 +ij_groovy_keep_blank_lines_in_code = 2 +ij_groovy_keep_blank_lines_in_declarations = 2 +ij_groovy_keep_control_statement_in_one_line = true +ij_groovy_keep_first_column_comment = true +ij_groovy_keep_indents_on_empty_lines = false +ij_groovy_keep_line_breaks = true +ij_groovy_keep_multiple_expressions_in_one_line = false +ij_groovy_keep_simple_blocks_in_one_line = false +ij_groovy_keep_simple_classes_in_one_line = true +ij_groovy_keep_simple_lambdas_in_one_line = true +ij_groovy_keep_simple_methods_in_one_line = true +ij_groovy_label_indent_absolute = false +ij_groovy_label_indent_size = 0 +ij_groovy_lambda_brace_style = end_of_line +ij_groovy_layout_static_imports_separately = true +ij_groovy_line_comment_add_space = false +ij_groovy_line_comment_add_space_on_reformat = false +ij_groovy_line_comment_at_first_column = true +ij_groovy_method_annotation_wrap = split_into_lines +ij_groovy_method_brace_style = end_of_line +ij_groovy_method_call_chain_wrap = off +ij_groovy_method_parameters_new_line_after_left_paren = false +ij_groovy_method_parameters_right_paren_on_new_line = false +ij_groovy_method_parameters_wrap = off +ij_groovy_modifier_list_wrap = false +ij_groovy_names_count_to_use_import_on_demand = 3 +ij_groovy_packages_to_use_import_on_demand = java.awt.*,javax.swing.* +ij_groovy_parameter_annotation_wrap = off +ij_groovy_parentheses_expression_new_line_after_left_paren = false +ij_groovy_parentheses_expression_right_paren_on_new_line = false +ij_groovy_prefer_parameters_wrap = false +ij_groovy_resource_list_new_line_after_left_paren = false +ij_groovy_resource_list_right_paren_on_new_line = false +ij_groovy_resource_list_wrap = off +ij_groovy_space_after_assert_separator = true +ij_groovy_space_after_colon = true +ij_groovy_space_after_comma = true +ij_groovy_space_after_comma_in_type_arguments = true +ij_groovy_space_after_for_semicolon = true +ij_groovy_space_after_quest = true +ij_groovy_space_after_type_cast = true +ij_groovy_space_before_annotation_parameter_list = false +ij_groovy_space_before_array_initializer_left_brace = false +ij_groovy_space_before_assert_separator = false +ij_groovy_space_before_catch_keyword = true +ij_groovy_space_before_catch_left_brace = true +ij_groovy_space_before_catch_parentheses = true +ij_groovy_space_before_class_left_brace = true +ij_groovy_space_before_closure_left_brace = true +ij_groovy_space_before_colon = true +ij_groovy_space_before_comma = false +ij_groovy_space_before_do_left_brace = true +ij_groovy_space_before_else_keyword = true +ij_groovy_space_before_else_left_brace = true +ij_groovy_space_before_finally_keyword = true +ij_groovy_space_before_finally_left_brace = true +ij_groovy_space_before_for_left_brace = true +ij_groovy_space_before_for_parentheses = true +ij_groovy_space_before_for_semicolon = false +ij_groovy_space_before_if_left_brace = true +ij_groovy_space_before_if_parentheses = true +ij_groovy_space_before_method_call_parentheses = false +ij_groovy_space_before_method_left_brace = true +ij_groovy_space_before_method_parentheses = false +ij_groovy_space_before_quest = true +ij_groovy_space_before_record_parentheses = false +ij_groovy_space_before_switch_left_brace = true +ij_groovy_space_before_switch_parentheses = true +ij_groovy_space_before_synchronized_left_brace = true +ij_groovy_space_before_synchronized_parentheses = true +ij_groovy_space_before_try_left_brace = true +ij_groovy_space_before_try_parentheses = true +ij_groovy_space_before_while_keyword = true +ij_groovy_space_before_while_left_brace = true +ij_groovy_space_before_while_parentheses = true +ij_groovy_space_in_named_argument = true +ij_groovy_space_in_named_argument_before_colon = false +ij_groovy_space_within_empty_array_initializer_braces = false +ij_groovy_space_within_empty_method_call_parentheses = false +ij_groovy_spaces_around_additive_operators = true +ij_groovy_spaces_around_assignment_operators = true +ij_groovy_spaces_around_bitwise_operators = true +ij_groovy_spaces_around_equality_operators = true +ij_groovy_spaces_around_lambda_arrow = true +ij_groovy_spaces_around_logical_operators = true +ij_groovy_spaces_around_multiplicative_operators = true +ij_groovy_spaces_around_regex_operators = true +ij_groovy_spaces_around_relational_operators = true +ij_groovy_spaces_around_shift_operators = true +ij_groovy_spaces_within_annotation_parentheses = false +ij_groovy_spaces_within_array_initializer_braces = false +ij_groovy_spaces_within_braces = true +ij_groovy_spaces_within_brackets = false +ij_groovy_spaces_within_cast_parentheses = false +ij_groovy_spaces_within_catch_parentheses = false +ij_groovy_spaces_within_for_parentheses = false +ij_groovy_spaces_within_gstring_injection_braces = false +ij_groovy_spaces_within_if_parentheses = false +ij_groovy_spaces_within_list_or_map = false +ij_groovy_spaces_within_method_call_parentheses = false +ij_groovy_spaces_within_method_parentheses = false +ij_groovy_spaces_within_parentheses = false +ij_groovy_spaces_within_switch_parentheses = false +ij_groovy_spaces_within_synchronized_parentheses = false +ij_groovy_spaces_within_try_parentheses = false +ij_groovy_spaces_within_tuple_expression = false +ij_groovy_spaces_within_while_parentheses = false +ij_groovy_special_else_if_treatment = true +ij_groovy_ternary_operation_wrap = off +ij_groovy_throws_keyword_wrap = off +ij_groovy_throws_list_wrap = off +ij_groovy_use_flying_geese_braces = false +ij_groovy_use_fq_class_names = false +ij_groovy_use_fq_class_names_in_javadoc = true +ij_groovy_use_relative_indents = false +ij_groovy_use_single_class_imports = true +ij_groovy_variable_annotation_wrap = off +ij_groovy_while_brace_force = never +ij_groovy_while_on_new_line = false +ij_groovy_wrap_chain_calls_after_dot = false +ij_groovy_wrap_long_lines = false + +[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}] +indent_size = 2 +ij_json_keep_blank_lines_in_code = 0 +ij_json_keep_indents_on_empty_lines = false +ij_json_keep_line_breaks = true +ij_json_space_after_colon = true +ij_json_space_after_comma = true +ij_json_space_before_colon = true +ij_json_space_before_comma = false +ij_json_spaces_within_braces = false +ij_json_spaces_within_brackets = false +ij_json_wrap_long_lines = false + +[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}] +ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3 +ij_html_align_attributes = true +ij_html_align_text = false +ij_html_attribute_wrap = normal +ij_html_block_comment_add_space = false +ij_html_block_comment_at_first_column = true +ij_html_do_not_align_children_of_min_lines = 0 +ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p +ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot +ij_html_enforce_quotes = false +ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var +ij_html_keep_blank_lines = 2 +ij_html_keep_indents_on_empty_lines = false +ij_html_keep_line_breaks = true +ij_html_keep_line_breaks_in_text = true +ij_html_keep_whitespaces = false +ij_html_keep_whitespaces_inside = span,pre,textarea +ij_html_line_comment_at_first_column = true +ij_html_new_line_after_last_attribute = never +ij_html_new_line_before_first_attribute = never +ij_html_quote_style = double +ij_html_remove_new_line_before_tags = br +ij_html_space_after_tag_name = false +ij_html_space_around_equality_in_attribute = false +ij_html_space_inside_empty_tag = false +ij_html_text_wrap = normal + +[{*.jsf,*.jsp,*.jspf,*.tag,*.tagf,*.xjsp}] +ij_jsp_jsp_prefer_comma_separated_import_list = false +ij_jsp_keep_indents_on_empty_lines = false + +[{*.jspx,*.tagx}] +ij_jspx_keep_indents_on_empty_lines = false + +[{*.kt,*.kts}] +ij_kotlin_align_in_columns_case_branch = false +ij_kotlin_align_multiline_binary_operation = false +ij_kotlin_align_multiline_extends_list = false +ij_kotlin_align_multiline_method_parentheses = false +ij_kotlin_align_multiline_parameters = true +ij_kotlin_align_multiline_parameters_in_calls = false +ij_kotlin_allow_trailing_comma = false +ij_kotlin_allow_trailing_comma_on_call_site = false +ij_kotlin_assignment_wrap = off +ij_kotlin_blank_lines_after_class_header = 0 +ij_kotlin_blank_lines_around_block_when_branches = 0 +ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1 +ij_kotlin_block_comment_add_space = false +ij_kotlin_block_comment_at_first_column = true +ij_kotlin_call_parameters_new_line_after_left_paren = false +ij_kotlin_call_parameters_right_paren_on_new_line = false +ij_kotlin_call_parameters_wrap = off +ij_kotlin_catch_on_new_line = false +ij_kotlin_class_annotation_wrap = split_into_lines +ij_kotlin_continuation_indent_for_chained_calls = true +ij_kotlin_continuation_indent_for_expression_bodies = true +ij_kotlin_continuation_indent_in_argument_lists = true +ij_kotlin_continuation_indent_in_elvis = true +ij_kotlin_continuation_indent_in_if_conditions = true +ij_kotlin_continuation_indent_in_parameter_lists = true +ij_kotlin_continuation_indent_in_supertype_lists = true +ij_kotlin_else_on_new_line = false +ij_kotlin_enum_constants_wrap = off +ij_kotlin_extends_list_wrap = off +ij_kotlin_field_annotation_wrap = split_into_lines +ij_kotlin_finally_on_new_line = false +ij_kotlin_if_rparen_on_new_line = false +ij_kotlin_import_nested_classes = false +ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^ +ij_kotlin_insert_whitespaces_in_simple_one_line_method = true +ij_kotlin_keep_blank_lines_before_right_brace = 2 +ij_kotlin_keep_blank_lines_in_code = 2 +ij_kotlin_keep_blank_lines_in_declarations = 2 +ij_kotlin_keep_first_column_comment = true +ij_kotlin_keep_indents_on_empty_lines = false +ij_kotlin_keep_line_breaks = true +ij_kotlin_lbrace_on_next_line = false +ij_kotlin_line_comment_add_space = false +ij_kotlin_line_comment_add_space_on_reformat = false +ij_kotlin_line_comment_at_first_column = true +ij_kotlin_method_annotation_wrap = split_into_lines +ij_kotlin_method_call_chain_wrap = off +ij_kotlin_method_parameters_new_line_after_left_paren = false +ij_kotlin_method_parameters_right_paren_on_new_line = false +ij_kotlin_method_parameters_wrap = off +ij_kotlin_name_count_to_use_star_import = 5 +ij_kotlin_name_count_to_use_star_import_for_members = 3 +ij_kotlin_packages_to_use_import_on_demand = java.util.*,kotlinx.android.synthetic.**,io.ktor.** +ij_kotlin_parameter_annotation_wrap = off +ij_kotlin_space_after_comma = true +ij_kotlin_space_after_extend_colon = true +ij_kotlin_space_after_type_colon = true +ij_kotlin_space_before_catch_parentheses = true +ij_kotlin_space_before_comma = false +ij_kotlin_space_before_extend_colon = true +ij_kotlin_space_before_for_parentheses = true +ij_kotlin_space_before_if_parentheses = true +ij_kotlin_space_before_lambda_arrow = true +ij_kotlin_space_before_type_colon = false +ij_kotlin_space_before_when_parentheses = true +ij_kotlin_space_before_while_parentheses = true +ij_kotlin_spaces_around_additive_operators = true +ij_kotlin_spaces_around_assignment_operators = true +ij_kotlin_spaces_around_equality_operators = true +ij_kotlin_spaces_around_function_type_arrow = true +ij_kotlin_spaces_around_logical_operators = true +ij_kotlin_spaces_around_multiplicative_operators = true +ij_kotlin_spaces_around_range = false +ij_kotlin_spaces_around_relational_operators = true +ij_kotlin_spaces_around_unary_operator = false +ij_kotlin_spaces_around_when_arrow = true +ij_kotlin_variable_annotation_wrap = off +ij_kotlin_while_on_new_line = false +ij_kotlin_wrap_elvis_expressions = 1 +ij_kotlin_wrap_expression_body_functions = 0 +ij_kotlin_wrap_first_method_in_call_chain = false + +[{*.markdown,*.md}] +ij_markdown_force_one_space_after_blockquote_symbol = true +ij_markdown_force_one_space_after_header_symbol = true +ij_markdown_force_one_space_after_list_bullet = true +ij_markdown_force_one_space_between_words = true +ij_markdown_insert_quote_arrows_on_wrap = true +ij_markdown_keep_indents_on_empty_lines = false +ij_markdown_keep_line_breaks_inside_text_blocks = true +ij_markdown_max_lines_around_block_elements = 1 +ij_markdown_max_lines_around_header = 1 +ij_markdown_max_lines_between_paragraphs = 1 +ij_markdown_min_lines_around_block_elements = 1 +ij_markdown_min_lines_around_header = 1 +ij_markdown_min_lines_between_paragraphs = 1 +ij_markdown_wrap_text_if_long = true +ij_markdown_wrap_text_inside_blockquotes = true + +[{*.pb,*.textproto}] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_prototext_keep_blank_lines_in_code = 2 +ij_prototext_keep_indents_on_empty_lines = false +ij_prototext_keep_line_breaks = true +ij_prototext_space_after_colon = true +ij_prototext_space_after_comma = true +ij_prototext_space_before_colon = false +ij_prototext_space_before_comma = false +ij_prototext_spaces_within_braces = true +ij_prototext_spaces_within_brackets = false + +[{*.properties,spring.handlers,spring.schemas}] +ij_properties_align_group_field_declarations = false +ij_properties_keep_blank_lines = false +ij_properties_key_value_delimiter = equals +ij_properties_spaces_around_key_value_delimiter = false + +[{*.qute.html,*.qute.json,*.qute.txt,*.qute.yaml,*.qute.yml}] +ij_qute_keep_indents_on_empty_lines = false + +[{*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,poetry.lock}] +ij_toml_keep_indents_on_empty_lines = false + +[{*.yaml,*.yml}] +indent_size = 2 +ij_yaml_align_values_properties = do_not_align +ij_yaml_autoinsert_sequence_marker = true +ij_yaml_block_mapping_on_new_line = false +ij_yaml_indent_sequence_value = true +ij_yaml_keep_indents_on_empty_lines = false +ij_yaml_keep_line_breaks = true +ij_yaml_sequence_on_new_line = false +ij_yaml_space_before_colon = false +ij_yaml_spaces_within_braces = true +ij_yaml_spaces_within_brackets = true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..9271e9a6e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +* text=auto + +# Cassettes +src/test/cassettes/**/* -diff +src/test/cassettes/**/* linguist-generated + +# Docs +docs/**/* -diff +docs/**/* linguist-generated diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..e390f3f5b --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,7 @@ +## These are the standard rules for all EasyPost public repositories. +## + +* @EasyPost/dev-tools @EasyPost/easypost-public-maintainers + +# The devtools team owns the codeowners file, this is for auditing purposes +.github/CODEOWNERS @easypost/dev-tools diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..2f3ff2198 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,81 @@ +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: [ "triage" ] +body: + - type: markdown + attributes: + value: | + Thank you for taking the time to report an issue in this repository. Please fill out the form below. + - type: input + id: software-version + attributes: + label: Software Version + # change this description for the specific repo + description: | + What version of our software are you running? + TIP: [Available versions](https://github.com/EasyPost/easypost-java/releases) + validations: + required: true + - type: input + id: language-version + attributes: + label: Language Version + # change this description for the specific language of the repo + description: | + What language version and/or framework are you using? + TIP: [How to find your Java version](https://stackoverflow.com/questions/5103121/how-to-find-the-jvm-version-from-a-program) + validations: + required: true + - type: input + id: os + attributes: + label: Operating System + description: What operating system are you running the software on? + validations: + required: true + - type: textarea + id: behavior + attributes: + label: What happened? + description: | + Please describe what happened in reproducible steps. + Include how often you see this issue, and any relevant links (i.e. GitHub issue, Stack Overflow, etc.). + value: | + 1. + 2. + 3. + ... + validations: + required: true + - type: textarea + id: expected-behavior + attributes: + label: What was expected? + description: Please describe what was expected to happen instead. + validations: + required: true + - type: textarea + id: sample-code + attributes: + label: Sample Code + description: | + Please provide any sample code that demonstrates the behavior. + This will be automatically formatted into the appropriate language, so no need for backticks. + **Do not include any private information such as API keys or passwords.** + # change this render to the appropriate language: https://github.com/github/linguist/blob/master/lib/linguist/languages.yml + render: java + validations: + required: false + - type: textarea + id: logs + attributes: + label: Relevant logs + description: | + Please copy and paste any relevant log output. + This will be automatically formatted into shell output, so no need for backticks. + If you have screenshots instead, please paste them below. + **Do not include any private information such as API keys or passwords.** + render: sh + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..684c7a903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,37 @@ +name: Feature Request +description: Request a new feature +title: "[Feat]: " +labels: [ "triage" ] +body: + - type: markdown + attributes: + value: | + Thank you for taking the time to request a new feature. + Please note, all feature requests are subject to review and approval. + We welcome all suggestions and ideas, but we cannot guarantee when or if we will implement them. + + We also welcome pull requests, if you would like to implement the feature yourself. + Doing so will likely accelerate the process of implementing the requested feature. + - type: checkboxes + id: searched + attributes: + label: Feature Request Is New + # change issue link below for the specific repo + description: | + Before we begin, please confirm that the requested feature does not already exist or has not [already been requested](https://github.com/EasyPost/easypost-java/issues). + options: + - label: I have verified that the requested feature does not already exist or has not already been requested. + required: true + - type: textarea + id: description + attributes: + label: Description of the feature + description: | + Please provide a detailed description of the feature, including: + - What the feature is + - What value it adds to the application + - How it should be implemented (i.e. pseudo-code, or a high-level description of the user experience) + - Any other relevant information + validations: + required: true + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..0978ab12b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,22 @@ +# Description + + + +# Testing + + + +# Pull Request Type + +Please select the option(s) that are relevant to this PR. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2af6dc511..0a03926db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,21 +2,102 @@ name: CI on: push: - branches: [ master ] + branches: [master] pull_request: ~ + workflow_dispatch: ~ jobs: build: runs-on: ubuntu-latest strategy: matrix: - javaversion: ['8', '9', '10', '11'] + javaversion: + ['8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v3 + - uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + cache: 'maven' + - name: Install dependencies + run: just install + - name: Build Library + run: just build - name: Set up Java ${{ matrix.javaversion }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v5 with: + distribution: 'zulu' java-version: ${{ matrix.javaversion }} - - name: Build with Maven - run: mvn --batch-mode install -Dgpg.skip=true -DskipTests=true - + cache: 'maven' + - name: Run test with Java ${{ matrix.javaversion }} + run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just test-ci + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v3 + - uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + cache: 'maven' + - name: Install dependencies + run: just install + - name: Test coverage + run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage + - name: Load Rust cache + if: github.ref == 'refs/heads/master' + uses: Swatinem/rust-cache@v2 + - name: Install grcov + if: github.ref == 'refs/heads/master' + run: cargo install grcov --version 0.8.13 + - name: Convert coverage report + if: github.ref == 'refs/heads/master' + run: grcov target/site/jacoco/jacoco.xml --source-dir ./ --ignore "target/*" > coverage.lcov + - name: Coveralls + if: github.ref == 'refs/heads/master' + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: './coverage.lcov' + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v3 + - uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + cache: 'maven' + - name: Install checkstyle and style guide + run: just install-checkstyle + - name: Lint + run: just lint + - name: Upload Test results + uses: actions/upload-artifact@master + with: + name: DependencyCheck report + path: ${{github.workspace}}/target/dependency-check-report.html + docs: + if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: extractions/setup-just@v3 + - uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + cache: 'maven' + - name: Install Dependencies + run: just install + - name: Generate Docs + run: just docs + - name: Deploy docs + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..62401a45f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,56 @@ +# This workflow will build a Java project with Maven and publish it to Maven Central Repository +# ref: https://github.com/actions/setup-java/blob/v3.11.0/docs/advanced-usage.md#Publishing-using-Apache-Maven + +# Secrets required: +# - MAVEN_USERNAME: Username for Maven Central Repository +# - MAVEN_CENTRAL_TOKEN: Token/password for Maven Central Repository +# - MAVEN_GPG_PRIVATE_KEY: GPG private key to sign the artifacts (string) +# - MAVEN_GPG_PASSPHRASE: Passphrase for the GPG private key + +name: Publish library to Maven Central Repository + +on: + release: + types: [created] + secrets: + MAVEN_USERNAME: + required: true + MAVEN_CENTRAL_TOKEN: + required: true + MAVEN_GPG_PRIVATE_KEY: + required: true + MAVEN_GPG_PASSPHRASE: + required: true + workflow_dispatch: ~ + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: extractions/setup-just@v3 + - uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: '25' # Always use the most recent LTS JDK for building + server-id: 'ossrh' + # define environmental variable names + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Clean, build and publish to Apache Maven Central + run: just install-styleguide publish pass=${{ secrets.MAVEN_GPG_PASSPHRASE }} + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + - name: Upload output files to release + uses: AButler/upload-release-assets@v3.0.1 + with: + files: 'target/*.jar;target/*.pom;target/*.asc' + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 9de87a73a..4d58b46cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,22 @@ -.DS_Store .AppleDouble -.LSOverride -Icon -._* -.Spotlight-V100 -.Trashes - .classpath +.DS_Store +.env +.idea/ +.LSOverride .project .settings -target - -.idea/ -src/main/main.iml -src/test/test.iml - +.Spotlight-V100 +.Trashes +.vscode *.class +*.iml +*.jar +*.lcov +docs +Icon settings.xml +src/scratch +target +/easypost_java_style.xml +/style_suppressions.xml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..7cb0e1b7e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "examples"] + path = examples + url = https://github.com/EasyPost/examples diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c8149f587..000000000 --- a/.travis.yml +++ /dev/null @@ -1,2 +0,0 @@ -language: java -install: mvn install --quiet -DskipTests=true -Dgpg.skip=true diff --git a/CHANGELOG.md b/CHANGELOG.md index 028e4c525..378a2fc65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,299 +1,611 @@ # CHANGELOG +## v8.6.0 (2026-02-03) -## NEXT RELEASE +- Adds the following functions usable by child and referral customer users: + - `apiKey.create` + - `apiKey.delete` + - `apiKey.enable` + - `apiKey.disable` +- Adds a `tracker.delete` function -* Removes `items` and `containers` which have not been supported for some time -* Corrects references of `contact@easypost.com` to `support@easypost.com` +## v8.5.1 (2026-01-08) +- Corrects `StatelessRateDeserializer` and `WebhookDeserializer` to treat all camelCase fields like all other models to properly deserialize JSON fields containing underscors -## 4.0.4 2020-10-29 +## v8.5.0 (2025-12-09) -* Actually bump User-Agent (which hadn't been bumped since 4.0.0) +- Adds the following functions: + - `fedexRegistration.registerAddress` + - `fedexRegistration.requestPin` + - `fedexRegistration.validatePin` + - `fedexRegistration.submitInvoice` +- Adds `details` property of a `Rate` objec +## v8.4.1 (2025-12-01) -## 4.0.3 2020-10-26 +- Adds missing `apiKeys` field to `BaseUser` +- Removes unecessary `SerializedName` entries in `StatelessRate` -* Change `PUT` requests to be properly-encoded -* Handle null previous_attributes +## v8.4.0 (2025-11-24) +- Adds the following functions: + - `embeddable.createSession` + - `customerPortal.createAccountLink` -## 4.0.2 2020-03-30 +## v8.3.0 (2025-11-10) -* Merged pull request #49 -* Added EvenTest file -* Fixed test cases on EasyPostTest (testPickup, testShipmentWithPostageLabelWithOptions ) -* Fixed intermittent WebHook callback event containing "previous_attributes": null +- Adds support for `UspsShipAccount` +- Adds `tracker.retrieveBatch` function +- Adds `verify_carrier` address param +## v8.2.0 (2025-06-18) -## 4.0.1 2018-08-28 +- Adds the following functions + - `shipment.createAndBuyLuma` + - `shipment.buyLuma` + - `luma.getPromise` -* Add labelFile for postage_label_inline option +## v8.1.0 (2025-05-29) +- Adds `reference` to Claims -## 4.0.0 2018-03-15 +## v8.0.1 (2025-05-27) -* Added additional fields to Error object used in Address verification -* Added delivery details to Address verification -* Changed message field of ShipmentMessage to support non-string values -* Fixed currency field of Rate to handle null -* Fixed Report params to include start_date and end_date in the top-level JSON, as expected by the reports endpoint +- Corrects the endpoint used for creating/updating UPS accounts +## v8.0.0 (2025-04-28) -## 3.4.1 2018-03-09 +See our [Upgrade Guide](UPGRADE_GUIDE.md#upgrading-from-7x-to-80) for more details. -* Added createdAt, updatedAt and fees fields on all top-level objects -* Added batchId to Shipment objects +- Adds `WebhookCustomHeader` model, allowing `custom_headers` to be passed when creating/updating a webhook +- Adds the following functions to assist ReferralCustomers add credit cards and bank accounts: + - `betaReferralCustomer.createCreditCardClientSecret` + - `betaReferralCustomer.createBankAccountClientSecret` + - `referralCustomer.addCreditCardFromStripe` + - `referralCustomer.addBankAccountFromStripe` +- Adds missing tracker props +- Adds `tracking_codes` param to tracker index endpoint +- Routes `AmazonShippingAccount` to the correct endpoint +- Corrects payload wrapping for updating a webhook +- Fixes error parsing + - Allows for alternative format of `errors` field (previously we deserialized the `errors` field into a list of `Error` objects; however, sometimes the errors are simply a list of strings. This change make the `errors` field a list of `Object` allowing for either the new `FieldError` object or a list of strings. Users will need to check for the type of error returned and handle appropriately) + - Removed the unused `Error` model + - Added an explicit `AddressVerificationFieldError` model + - The `BetaPaymentRefund` now uses a list of `FieldError` instead of `Error` for the `errors` field +- Removes deprecated functions + - `paymentMethod.all` (use `billing.retrievePaymentMethods` instead) + - `user.apiKeys` (use `apiKey.retrieveApiKeysForUser` instead) +- Replaces deprecated functions + - `shipment.lowestSmartRate` (3rd param expects a valid `SmartRateAccuracy`) + - `utilities.findLowestSmartRate` (3rd param expects a valid `SmartRateAccuracy`) +- Renames + - `SmartrateAccuracy` is now `SmartRateAccuracy` + - `SmartrateCollection` is now `SmartRateCollection` + - `shipment.smartrates` is now `shipment.smartRates` + - `TimeInTransit.getBySmartrateAccuracy` is now `TimeInTransit.getSmartRateAccuracy` +- Bumps dependencies +## v7.4.4 (2025-01-03) -## 3.4.0 2017-12-07 +- Fixes how params are passed to the API when buying a pickup and providing a pickup rate (closes #340) + - Removes the unusable buy a pickup overload where no params are specified as `carrier` and `service` are required paramaters when buying a pickup +- Removes the deprecated `create_list` tracker endpoint function as it is no longer available via API -* Updated version of junit from 4.1.10 to 4.1.12 -* Updated version of maven-compiler-plugin from 1.5 to 1.8 -* Added tests for new shipment option payment +## v7.4.3 (2024-09-16) +- Remove the custom DateDeserializer that contained a parsing issue. This change closes the related GitHub issue [#333](https://github.com/EasyPost/easypost-java/issues/333) -## 3.3.5 2017-05-23 +## v7.4.2 (2024-08-09) -* Added orderId field to Shipments -* Allow Reports to be retrieved without passing a type +- Fix pagination parameters for `getNextPage` in `User` service +## v7.4.1 (2024-07-24) -## 3.3.4 2017-03-10 +- Fix bug where response hooks were not being called if an API request failed -* Updated X-EasyPost-Client-User-Agent to X-Client-User-Agent -* Added additional values to CarrierDetail -* Added statusDetail field to Trackers and TrackingDetails +## v7.4.0 (2024-07-24) +- Add new `Claim` service for filing claims on EasyPost shipments and insurances -## 3.3.3 2017-02-14 +## v7.3.0 (2024-07-16) -* Added newRates method to Orders to refresh rates +- Adds new `shipment.recommendShipDate`, `smartrate.recommendShipDate`, and `smartrate.estimateDeliveryDate` functions +- Routes `UpsAccount`, `UpsMailInnovationsAccount`, and `UpsSurepostAccount` create/update requests to the new `/ups_oauth_registrations` endpoint + - Starting `2024-08-05`, UPS accounts will require a new payload to register or update. See [UPS OAuth 2.0 Update](https://support.easypost.com/hc/en-us/articles/26635027512717-UPS-OAuth-2-0-Update?utm_medium=email&_hsenc=p2ANqtz-96MmFtWICOzy9sKRbbcZSiMovZSrY3MSX1_bgY9N3f9yLVfWQdLhjAGq-SmNcOnDIS6GYhZ0OApjDBrGkKyLLMx1z6_TFOVp6-wllhEFQINrkuRuc&_hsmi=313130292&utm_content=313130292&utm_source=hs_email) for more details +## v7.2.1 (2024-04-12) -## 3.3.2 2017-01-24 +- Fix `Fields` serialization bug causing carrier account operations to fail -* Allow Webhook update and index to be called with empty params +## v7.2.0 (2024-04-10) +- Adds `refund` function in Insurance service for requesting a refund for a standalone insurance +- Fix payment method funding and deletion failures due to undetermined payment method type +- Fix `toString` method for all EasyPost models -## 3.3.1 2017-01-19 +## v7.1.1 (2024-03-21) -* Fixed ScanForm create +- Fix `EasyPostTimeInTransitData` class and `easypostTimeInTransitData` property of `EstimatedDeliveryDate` class being publicly inaccessible +## v7.1.0 (2024-01-08) -## 3.3.0 2017-01-17 +- Adds `allChildren` function in User service to get a paginated list of child users +- Adds `getNextPage` function in User service to get next paginated list of child users -* Added basic CRUD methods for Webhooks +## v7.0.1 (2023-12-08) +- Adds the `object` field to all models; previously, most models were missing this field. -## 3.2.1 2017-01-09 +## v7.0.0 (2023-12-06) -* Fixed bug in Maven test dependencies +See our [Upgrade Guide](UPGRADE_GUIDE.md#upgrading-from-6x-to-70) for more details. +- Removes `withCarbonOffset` parameter from `create`, `buy`, and `regenerateRates` functions of the Shipment service as EasyPost now offers Carbon Neutral shipments by default for free +- Removes the undocumented `createAndBuy` function from the Batch service. The proper usage is to create a batch first and buy it separately +- Changes return type of `all()` in webhook service from `WebhookCollection` to `a list of webhooks` +- `BetaCarrierMetadata` service has been removed. Please use `CarrierMetadata` instead. -## 3.2.0 2017-01-04 +## v6.9.1 (2023-11-16) -* Changed Shipment and Order options from being a Map to Map to support new non-string options +- Fixes a bug where address verification errors were not being properly deserialized +## v6.9.0 (2023-10-11) -## 3.1.0 2016-12-14 +- Deprecates `user.apiKeys` which will be removed in a future release, please use the new `apiKey.all` and `apiKey.retrieveApiKeysForUser` functions instead instead +- Fixes various build warnings -* Added ability to create, retrieve, and index shipment, tracker and payment_log reports +## v6.8.1 (2023-09-05) +- Fix endpoint for creating a FedEx Smartpost carrier account -## 3.0.5 2016-11-21 +## v6.8.0 (2023-07-28) -* Added delete() to Users (for children only) +- Adds new `RequestHook` and `ResponseHook` classes. (un)subscribe to them with the new `subscribeToRequestHook`, `subscribeToResponseHook`, `unsubscribeFromRequestHook`, or `unsubscribeFromResponseHook` methods of an `EasyPostClient` +- Maps 400 status codes to the new `BadRequestError` class +## v6.7.0 (2023-06-06) -## 3.0.4 2016-10-12 +- Retrieving carrier metadata is now generally available via `client.carrierMetadata.retrieve` +- Bump all dependencies -* Added getbatchId() and other methods to ScanForms +## v6.6.1 (2023-05-09) +- Test suite tweaked so EasyVCR is no longer a production dependency -## 3.0.2 2016-08-30 +## v6.6.0 (2023-05-02) -* Added getCreatedAt() and getUpdatedAt() methods for Tracker objects +- Adds `retrieveEstimatedDeliveryDate` function to the Shipment class +## v6.5.0 (2023-04-18) -## 3.0.1 2016-08-19 +- Adds beta `retrieveCarrierMetadata` function +- Fixes the type for `requestBody` from Map to String for Payload class +- Add `retrieveCarrierMetadata` method to retrieve carrier metadata for carriers -* Removed some CRUD methods that are not (and never were) valid +## v6.4.0 (2023-04-04) +- Adds `getNextPage` function to each service which retrieves the next page of a collection when the `has_more` key is present in the response (eg: `client.address.getNextPage(addressCollection)`) +- Adds missing Event `status` property -## 3.0.0 2016-07-25 +## v6.3.1 (2023-03-22) -* Updated version of GSON from 2.2.4 to 2.7 to allow looser parsing of DateTime formats +- Handle edge cases when deseralizing error JSON, closes Github issue [#239](https://github.com/EasyPost/easypost-java/issues/239) +## v6.3.0 (2023-02-21) -## 2.2.7 2016-07-25 +- Adds beta `retrieveStatelessRates` function to get stateless rates +- Adds `getLowestStatelessRate` function to filter the lowest stateless rate -* Added standalone insurance objects +## v6.2.0 (2023-01-18) +- Adds `all` function to `Pickup` to retrieve all pickups +- Adds `retrieveAllPayloads` and `retrievePayload` to retrieve all payloads or a single event payload -## 2.2.6 2016-07-22 +## v6.1.0 (2023-01-11) -* Allow the connection's read timeout to be set with EasyPost.readTimeout +- Adds new beta billing functionality for ReferralCustomer users + - `addPaymentMethod` can add a pre-existing Stripe bank account or credit card to your EasyPost account + - `refundByAmount` refunds your wallet by a dollar amount + - `refundByPaymentLog` refunds you wallet by a PaymentLog ID +## v6.0.0 (2023-01-05) -## 2.2.5 2016-07-08 +See our [Upgrade Guide](UPGRADE_GUIDE.md#upgrading-from-5x-to-60) for more details. -* Allow shipment_id to be null on rates +Includes all the changes from `v6.0.0-rc1` listed below in addition to the following: +- All constants are now defined in the top-level `Constants` class (`com.easypost.Constants`) + - Users who are utilizing the constants for exception message parsing should account for the new namespace +- Added support for creating/registering carrier accounts that require custom workflows (e.g. FedEx, UPS) +- Swapped the parameters for the following functions, making `id` the first argument + - `Shipment.generateForm()` + - `EndShipper.update()` + - `CarrierAccount.update()` +- Fixed a typo, `ServiceUnavailablError` is now `ServiceUnavailableError` +- Fixed a typo: `Smartrate` is now `SmartRate`, `apikeys` is now `apiKey`, `scanform` is now `scanForm` +- Moved `validateWebook`, `findLowestSmartrate`, and `getLowestSmartRate` from Services to Utilities since it does not required an EasyPost client object +- Added a root level `APIException` class for all HTTP exceptions -## 2.2.4 2016-03-09 +## v6.0.0-rc1 (2022-11-30) -* Bump version for deployment reasons +### Breaking Changes +- Library is now thread-safe + - Initialize an `EasyPostClient` object with an API key. Optionally set connection and readtime params + - All methods (i.e. `create`, `retrieve`, `all`) exist in services, accessed via property of the client (eg: `client.shipment.create()`) + - E.g. Static method -> `Shipment shipment = client.address.create(params)` + - E.g. Instance methods are now static -> `Shipment boughtShipment = client.shipment.buy(shipmentID, lowestRate)` + - All functions are now taking object ID instead of an object, which means the functions are returning the response value directly instead of updating the current object + - E.g. `Shipment boughtShipment = client.shipment.buy(shipmentID, lowestRate)` +- Improves error exception handling + - Specific error types for each category of error + - API error message may be an array rather than a string. Arrays will be concatenated (by comma) and returned as a string. +- Removes `createAndVerifyWithCarrier` function +- Removes `verifyWithCarrier` function +- Removes `getUpdate` and `setUpdate` from Tracker class +- Removes all beta features and corrsponding unit tests +- Removes `serviceCode` from `Rate` class since this value is internal use only +- Removes invalid function `User.create()` since creating a child-user requires a name +- Removes deprecated class `CreditCard` and its associated classes `PrimaryPaymentMethod`, `SecondaryPaymentMethod`, and `BaseCreditCard`, please use alternative `Billing` class +- Removes all the setters of each object +- Removes the `refresh()` function in all classes, please use `retrieve()` function instead +- Removes invalid functions that allow users to make an API request without providing required parameters +- Changes the type of Insurance `Amount` from Float to String +- Changes the type `hasMore` in ReferralCustomerCollection from `boolean` to `Boolean` +- Renames some getters + - Pickup class: `getPickoutRates()` -> `getPickupRates()` + - PaymentMethod class: `getPrimaryPaymentMethodObject()` -> `getPrimaryPaymentMethod()` + - PaymentMethod class: `getSecondaryPaymentMethodObject()` -> `getSecondaryPaymentMethod()` +- Converts return type from a boolean to void when we receive an empty response body from the API + - `fundWallet()` and `deletePaymentMethod()` in Billing class + - `createList()` in Tracker class + - `updateEmail()` in ReferralCustomer class +- Changes the type `result` of Event from `EasyPostResource` to `Map` -## 2.2.3 2016-06-27 -* Updated POM.xml to fit Maven better and support the correct plugins -* Removed a flaky text +### Bug Fixes +- Adds two missing attributes in the Event class: `pendingUrls` and `completedUrls` +- AppEngine default timeout is now the same as connection timeout -## 2.2.2 2016-03-09 +## v5.10.0 (2022-09-21) -* Updated PickupRate to properly include the carrier field +- Adds support to pass an `EndShipper ID` when buying a shipment +- Removes the unusable overload shipment `buy` functions that did not contain a rate parameter +- Add White Label support: + - Create a referral customer + - Update a referral customer's email address + - List all referral customers + - Add a credit card to a referral customer's account + +## v5.9.0 (2022-08-25) + +- Moves EndShipper out of beta into the general library namespace +- Removes the unusable `ParcelCollection` and `all` function of the Parcel object +## v5.8.1 (2022-08-03) + +- Fixes a bug where an erroneous API call to retrieve smartrates would be made behind the scenes whenever a shipment object was updated locally from the API (such as when regenerating rates) due to the deprecated function name being called `getSmartrates` and the library assuming this was a getter and attempting to use it to update the shipment data + +## v5.8.0 (2022-08-02) + +- Adds Carbon Offset support + - Adds the ability to create a shipment with carbon offset + - Adds the ability to buy a shipment with carbon offset + - Adds the ability to one-call-buy a shipment with carbon offset + - Adds the ability to re-rate a shipment with carbon offset +- Adds `validateWebhook` function that returns your webhook or raises an error if there is a webhook secret mismatch + +## v5.7.0 (2022-07-18) + +- Adds ability to generate a shipment form via `generate_form()` function + +## v5.6.0 (2022-07-11) + +- Adds `Billing.retrievePaymentMethods()`, `Billing.fundWallet()`, and `Billing.deletePaymentMethod()` functions +- Deprecates some existing payment method and credit card functions and features (repleaced by new Billing functions): + - Deprecates `CreditCard.fund()` and `CreditCard.delete()` functions + - Deprecates `PaymentMethod.all()` function + - Deprecates certain `PaymentMethod` object functions +- Some `getX` functions have been deprecated and renamed to simply `X` to avoid confusion with proper getter/setter + functions. + - `getSmartrates()` -> `smartrates()` + - `getLowestSmartRate()` -> `findLowestSmartrate()` +- Adds OS specific details to the user-agent header + +## v5.5.0 (2022-06-21) + +- Adds `billingType` attribute to `Rate` and `CarrierAccount` classes. +- Adds missing attributes to the `CarrierAcccount` object (closes #145) + +## v5.4.0 (2022-06-03) + +- Adds `PaymentMethod.all()`, `CreditCard.fund()`, and `CreditCard.delete()` functions. +- Fixes a bug that did not merge local and remote objects correctly on update (eg: User, Referral) -## 2.2.1 2016-03-02 +## v5.3.0 (2022-05-19) -* Updated Order Messages to be of the new, more descriptive format +- Adds the `EndShipper` Beta class with `create`, `retrieve`, `all`, and `update` functions +- Adds support for `columns` and `additional_columns` on Report creation +- Adds `declaraction` attribute in CustomsInfo class +- Adds `AddressVerifications` class +- Adds a `lowestRate()` function to Orders and Pickups +- Adds a `Shipment.getLowestSmartrate()` function and a `shipment.lowestSmartrate()` function +- Adds beta Referral class for White Label API with these new functions: `create()`, `updateEmail()`, `all()`, and `addCreditCard()` +- Adds `CreditCard` class for `addCreditCard()` function return type +- All SmartRate-related functions now return lists of Smartrate objects rather than lists of Rate objects +- Remove the dead `message` conditional check in `Address.createAndVerify()` +## v5.2.0 (2022-02-25) -## 2.2.0 2016-02-25 +- Adds a getter and setter for `eel_pfc` on the `CustomsInfo` object +- Adds a getter and setter for `id` on the `Brand` object +- Fixes a bug that didn't allow Refunds to be created +- Adds a complete test suite and upgrade JUnit4 to JUnit5 +- Fixes the `AddressCollection` to return a list of `Address` objects instead of `Batch` objects -* Added "confirmation" field to ScanForm object, along with appropriate accessor methods -* Update Address verification errors array +## v5.1.0 (2022-02-09) +- Adds support to one-call buy a Shipment by passing a `service` and `carrierAccounts` key +- Adds support to retrieve carrier types via `CarrierType.all()` +- Adds support to one-call buy an Order by passing a `service` and `carrierAccounts` key +- Adds support to update the user's brand via `User.updateBrand()` +- Allow user to override default API timeouts via getters and setters +- Bump all plugins and remove dead `oss-parent` plugin +- Various other small improvements and bug fixes -## 2.1.9 2016-02-08 +## v5.0.0 (2022-01-14) -* Added ability to create new top-level users without API KEY +See our [Upgrade Guide](UPGRADE_GUIDE.md#upgrading-from-4x-to-50) for more details. +- Bump minimum Java version from 1.5 to 8 +- Changed PUT/POST request bodies from url-form encoded to JSON encoded +- Added support for `SmartRate` +- Added support for `Tax Identifiers` +- Added `Checkstyle` as a plugin and linted the project +- Added new `rerate` shipment function +- Bumped project dependencies +- Include Java version in User-Agent header +- Remove `items` and `containers` which have not been supported for some time +- Corrects references of `contact@easypost.com` to `support@easypost.com` +- Updates the connection timeout to 30 seconds from 20 and the request timeout to 60 from 40 -## 2.1.8 2016-01-26 +## v4.0.4 (2020-10-29) -* Added a Form attribute - submittedElectronically. +- Actually bump User-Agent (which hadn't been bumped since 4.0.0) +## v4.0.3 (2020-10-26) -## 2.1.7 2016-01-19 +- Change `PUT` requests to be properly-encoded +- Handle null previous_attributes -* Fixed some types on the User object so that they match what is returned by the API (Number -> String). -* Added support for the new "verify" and "verify_strict" parameters for Address creation/validation. +## v4.0.2 (2020-03-30) +- Merged pull request #49 +- Added EvenTest file +- Fixed test cases on EasyPostTest (testPickup, testShipmentWithPostageLabelWithOptions ) +- Fixed intermittent WebHook callback event containing "previous_attributes": null -## 2.1.6 2015-12-21 +## v4.0.1 (2018-08-28) -* Fixed Shipment Insure method so that it correctly uses http POST. +- Add labelFile for postage_label_inline option +## v4.0.0 (2018-03-15) -## 2.1.5 2015-11-19 +- Added additional fields to Error object used in Address verification +- Added delivery details to Address verification +- Changed message field of ShipmentMessage to support non-string values +- Fixed currency field of Rate to handle null +- Fixed Report params to include start_date and end_date in the top-level JSON, as expected by the reports endpoint -* Added createList method to Tracker class +## v3.4.1 (2018-03-09) +- Added createdAt, updatedAt and fees fields on all top-level objects +- Added batchId to Shipment objects -## 2.1.4 2015-09-24 +## v3.4.0 (2017-12-07) -* Added CarrierDetail object to tracker model. +- Updated version of junit from 4.1.10 to 4.1.12 +- Updated version of maven-compiler-plugin from 1.5 to 1.8 +- Added tests for new shipment option payment +## v3.3.5 (2017-05-23) -## 2.1.3 2015-07-31 +- Added orderId field to Shipments +- Allow Reports to be retrieved without passing a type -* Added Rate.listRate and Rate.listCurrency. +## v3.3.4 (2017-03-10) +- Updated X-EasyPost-Client-User-Agent to X-Client-User-Agent +- Added additional values to CarrierDetail +- Added statusDetail field to Trackers and TrackingDetails -## 2.1.2 2015-07-08 +## v3.3.3 (2017-02-14) -* Added Carrier field to the tracker model. +- Added newRates method to Orders to refresh rates +## v3.3.2 (2017-01-24) -## 2.1.1 2015-06-19 +- Allow Webhook update and index to be called with empty params -* Added Form model and Shipment.forms. +## v3.3.1 (2017-01-19) +- Fixed ScanForm create -## 2.1.0 2015-04-15 +## v3.3.0 (2017-01-17) -* Added User model, and filled out CarrierAccount to be able to interact with -both via the API. +- Added basic CRUD methods for Webhooks +## v3.2.1 (2017-01-09) -## 2.0.14 2015-04-08 +- Fixed bug in Maven test dependencies -* Updated Tracker model to have weight, signedBy and estDeliveryDate fields +## v3.2.0 (2017-01-04) +- Changed Shipment and Order options from being a Map to Map to support new non-string options -## 2.0.13 2015-04-07 +## v3.1.0 (2016-12-14) -* Fixed Address createAndVerify method -* Added Address verifyWithCarrier and createAndVerifyWithCarrier methods +- Added ability to create, retrieve, and index shipment, tracker and payment_log reports +## v3.0.5 (2016-11-21) -## 2.0.12 2015-03-03 +- Added delete() to Users (for children only) -* Added Pickup classes and pickup create, buy, cancel methods +## v3.0.4 (2016-10-12) +- Added getbatchId() and other methods to ScanForms -##= 2.0.11 2015-03-03 +## v3.0.2 (2016-08-30) -* Orders now update themselves after a buy call. +- Added getCreatedAt() and getUpdatedAt() methods for Tracker objects +## v3.0.1 (2016-08-19) -== 2.0.10 2015-01-27 +- Removed some CRUD methods that are not (and never were) valid -* Added Address.residential attribute, and Batch.buy function +## v3.0.0 (2016-07-25) +- Updated version of GSON from 2.2.4 to 2.7 to allow looser parsing of DateTime formats -## 2.0.9 2014-12-22 +## v2.2.7 (2016-07-25) -* Added a number of new Rate attributes and Batch.numShipments, Batch.reference, ScanForm.status +- Added standalone insurance objects +## v2.2.6 (2016-07-22) -## 2.0.8 2014-12-18 +- Allow the connection's read timeout to be set with EasyPost.readTimeout -* Added ShipmentMessage type for Shipment.messages +## v2.2.5 (2016-07-08) +- Allow shipment_id to be null on rates -## 2.0.7 2014-11-04 +## v2.2.4 (2016-03-09) -* Added Tracker to shipment buy response -* Added Tracking Locations to Tracking Details -* Enhanced Tests +- Bump version for deployment reasons +## v2.2.3 (2016-06-27) -## 2.0.6 2014-07-28 +- Updated POM.xml to fit Maven better and support the correct plugins +- Removed a flaky text -* Added Container, Item, Order resources. -* Added Batch.createScanForm function for generating manifests from a batch. -* Refactored and added a lot of new attributes for objects across the board. +## v2.2.2 (2016-03-09) +- Updated PickupRate to properly include the carrier field -## 2.0.5 2013-12-11 +## v2.2.1 (2016-03-02) -* Bug fix. Made Batch.status public and removed the conflicting getStatus method. +- Updated Order Messages to be of the new, more descriptive format +## v2.2.0 (2016-02-25) -## 2.0.4 2013-10-14 +- Added "confirmation" field to ScanForm object, along with appropriate accessor methods +- Update Address verification errors array -* Added Event resource for webhook digestion. -* Changed Batch.getStatus to Batch.getBatchStatus to avoid collisions with Tracker.getStatus in Event deserialization. +## v2.1.9 (2016-02-08) +- Added ability to create new top-level users without API KEY -## 2.0.3 2013-08-28 +## v2.1.8 (2016-01-26) -* Bug fix: Fixed handleAPIError to return proper exception message. +- Added a Form attribute - submittedElectronically. +## v2.1.7 (2016-01-19) -## 2.0.2 2013-08-02 +- Fixed some types on the User object so that they match what is returned by the API (Number -> String). +- Added support for the new "verify" and "verify_strict" parameters for Address creation/validation. -* API Addition: Tracker resource added. Trackers can be used to register any tracking code with EasyPost webhooks. -* Attribute Addition: Added new BatchStatus attribute, and additional label format attributes to PostageLabel. +## v2.1.6 (2015-12-21) +- Fixed Shipment Insure method so that it correctly uses http POST. -## 2.0.1 2013-07-05 +## v2.1.5 (2015-11-19) -* Added unique carrier/service combination serviceCodes to Rate objects. -* Added function to Address to all creating and verifying at the same time. -* Add label function to Shipment to request specific label file_formats (pdf, epl2, zpl). -* Add insure function to Shipment. Add insurance to any shipment in one call! +- Added createList method to Tracker class + +## v2.1.4 (2015-09-24) + +- Added CarrierDetail object to tracker model. + +## v2.1.3 (2015-07-31) + +- Added Rate.listRate and Rate.listCurrency. + +## v2.1.2 (2015-07-08) + +- Added Carrier field to the tracker model. + +## v2.1.1 (2015-06-19) + +- Added Form model and Shipment.forms. + +## v2.1.0 (2015-04-15) + +- Added User model, and filled out CarrierAccount to be able to interact with + both via the API. + +## v2.0.14 (2015-04-08) + +- Updated Tracker model to have weight, signedBy and estDeliveryDate fields + +## v2.0.13 (2015-04-07) + +- Fixed Address createAndVerify method +- Added Address verifyWithCarrier and createAndVerifyWithCarrier methods + +## v2.0.12 (2015-03-03) + +- Added Pickup classes and pickup create, buy, cancel methods + +## v2.0.11 (2015-03-03) + +- Orders now update themselves after a buy call. + +## v2.0.10 (2015-01-27) + +- Added Address.residential attribute, and Batch.buy function + +## v2.0.9 (2014-12-22) + +- Added a number of new Rate attributes and Batch.numShipments, Batch.reference, ScanForm.status + +## v2.0.8 (2014-12-18) + +- Added ShipmentMessage type for Shipment.messages + +## v2.0.7 (2014-11-04) + +- Added Tracker to shipment buy response +- Added Tracking Locations to Tracking Details +- Enhanced Tests + +## v2.0.6 (2014-07-28) + +- Added Container, Item, Order resources. +- Added Batch.createScanForm function for generating manifests from a batch. +- Refactored and added a lot of new attributes for objects across the board. + +## v2.0.5 (2013-12-11) + +- Bug fix. Made Batch.status public and removed the conflicting getStatus method. + +## v2.0.4 (2013-10-14) + +- Added Event resource for webhook digestion. +- Changed Batch.getStatus to Batch.getBatchStatus to avoid collisions with Tracker.getStatus in Event deserialization. + +## v2.0.3 (2013-08-28) + +- Bug fix: Fixed handleAPIError to return proper exception message. + +## v2.0.2 (2013-08-02) + +- API Addition: Tracker resource added. Trackers can be used to register any tracking code with EasyPost webhooks. +- Attribute Addition: Added new BatchStatus attribute, and additional label format attributes to PostageLabel. + +## v2.0.1 (2013-07-05) + +- Added unique carrier/service combination serviceCodes to Rate objects. +- Added function to Address to all creating and verifying at the same time. +- Add label function to Shipment to request specific label file_formats (pdf, epl2, zpl). +- Add insure function to Shipment. Add insurance to any shipment in one call! diff --git a/README.md b/README.md index 5455e4e74..98a5ceefb 100644 --- a/README.md +++ b/README.md @@ -1,142 +1,183 @@ # EasyPost Java Client Library -EasyPost is a simple shipping API. You can sign up for an account at https://easypost.com +[![CI](https://github.com/EasyPost/easypost-java/workflows/CI/badge.svg)](https://github.com/EasyPost/easypost-java/actions?query=workflow%3ACI) +[![Coverage Status](https://coveralls.io/repos/github/EasyPost/easypost-java/badge.svg?branch=master)](https://coveralls.io/github/EasyPost/easypost-java?branch=master) +[![Maven Central](https://img.shields.io/maven-central/v/com.easypost/easypost-api-client?label=Maven%20Central)](https://central.sonatype.dev/search?q=easypost-api-client) -## Requirements +EasyPost, the simple shipping solution. You can sign up for an account at . -* Java 1.5 and later. -* [Google Gson](http://code.google.com/p/google-gson/) +## Install -## Installation +### Maven -```sh -mvn package +Add this to your project's POM: + +```xml + + com.easypost + easypost-api-client + 8.6.0 + ``` -or build the jar from src! +### Gradle -## Example +Add this to your project's build file: -```java +```groovy +implementation "com.easypost:easypost-api-client:8.6.0" +``` -import java.util.HashMap; -import java.util.Map; -import java.util.List; -import java.util.ArrayList; +**NOTE:** [Google Gson](http://code.google.com/p/google-gson/) is required. + +## Usage + +A simple create & buy shipment example: + +```java +package shipments; import com.easypost.EasyPost; import com.easypost.exception.EasyPostException; -import com.easypost.model.Address; -import com.easypost.model.Parcel; -import com.easypost.model.CustomsItem; -import com.easypost.model.CustomsInfo; import com.easypost.model.Shipment; +import com.easypost.service.EasyPostClient; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -public class Readme { - - public static void main(String[] args) { - EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; - - Map fromAddressMap = new HashMap(); - fromAddressMap.put("name", "Simpler Postage Inc"); - fromAddressMap.put("street1", "388 Townsend St"); - fromAddressMap.put("street2", "Apt 20"); - fromAddressMap.put("city", "San Francisco"); - fromAddressMap.put("state", "CA"); - fromAddressMap.put("zip", "94107"); - fromAddressMap.put("phone", "415-456-7890"); - - Map toAddressMap = new HashMap(); - toAddressMap.put("name", "Sawyer Bateman"); - toAddressMap.put("street1", "1A Larkspur Cres"); - toAddressMap.put("street2", ""); - toAddressMap.put("city", "St. Albert"); - toAddressMap.put("state", "AB"); - toAddressMap.put("zip", "T8N2M4"); - toAddressMap.put("phone", "780-483-2746"); - toAddressMap.put("country", "CA"); - - Map parcelMap = new HashMap(); - parcelMap.put("weight", 22.9); - parcelMap.put("height", 12.1); - parcelMap.put("width", 8); - parcelMap.put("length", 19.8); - - Map customsItem1Map = new HashMap(); - customsItem1Map.put("description", "EasyPost T-shirts"); - customsItem1Map.put("quantity", 2); - customsItem1Map.put("value", 23.56); - customsItem1Map.put("weight", 18.8); - customsItem1Map.put("origin_country", "us"); - customsItem1Map.put("hs_tariff_number", "123456"); - - Map customsItem2Map = new HashMap(); - customsItem2Map.put("description", "EasyPost Stickers"); - customsItem2Map.put("quantity", 11); - customsItem2Map.put("value", 8.98); - customsItem2Map.put("weight", 3.2); - customsItem2Map.put("origin_country", "us"); - customsItem2Map.put("hs_tariff_number", "654321"); - - try { - Address fromAddress = Address.create(fromAddressMap); - Address toAddress = Address.create(toAddressMap); - Parcel parcel = Parcel.create(parcelMap); - - // Address verified = to_address.verify(); - - // customs - Map customsInfoMap = new HashMap(); - customsInfoMap.put("integrated_form_type", "form_2976"); - customsInfoMap.put("customs_certify", true); - customsInfoMap.put("customs_signer", "Dr. Pepper"); - customsInfoMap.put("contents_type", "gift"); - customsInfoMap.put("eel_pfc", "NOEEI 30.37(a)"); - customsInfoMap.put("non_delivery_option", "return"); - customsInfoMap.put("restriction_type", "none"); - CustomsItem customsItem1 = CustomsItem.create(customsItem1Map); - CustomsItem customsItem2 = CustomsItem.create(customsItem2Map); - List customsItemsList = new ArrayList(); - customsItemsList.add(customsItem1); - customsItemsList.add(customsItem2); - customsInfoMap.put("customs_items", customsItemsList); - CustomsInfo customsInfo = CustomsInfo.create(customsInfoMap); - - // create shipment - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", toAddress); - shipmentMap.put("from_address", fromAddress); - shipmentMap.put("parcel", parcel); - shipmentMap.put("customs_info", customsInfo); - - Shipment shipment = Shipment.create(shipmentMap); - - // buy postage - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - List buyServices = new ArrayList(); - buyServices.add("PriorityMailInternational"); - - shipment = shipment.buy(shipment.lowestRate(buyCarriers, buyServices)); - - System.out.println(shipment.prettyPrint()); - - } catch (EasyPostException e) { - e.printStackTrace(); - } - } +public class CreateShipment { + public static void main(String[] args) throws EasyPostException { + EasyPostClient client = new EasyPostClient(System.getenv("EASYPOST_API_KEY")); + + Map fromAddressMap = new HashMap(); + fromAddressMap.put("company", "EasyPost"); + fromAddressMap.put("street1", "417 MONTGOMERY ST"); + fromAddressMap.put("street2", "FLOOR 5"); + fromAddressMap.put("city", "SAN FRANCISCO"); + fromAddressMap.put("state", "CA"); + fromAddressMap.put("country", "US"); + fromAddressMap.put("zip", "94104"); + fromAddressMap.put("phone", "415-123-4567"); + + Map toAddressMap = new HashMap(); + toAddressMap.put("name", "Dr. Steve Brule"); + toAddressMap.put("street1", "179 N Harbor Dr"); + toAddressMap.put("city", "Redondo Beach"); + toAddressMap.put("state", "CA"); + toAddressMap.put("country", "US"); + toAddressMap.put("zip", "90277"); + toAddressMap.put("phone", "310-808-5243"); + + Map parcelMap = new HashMap(); + parcelMap.put("weight", 22.9); + parcelMap.put("height", 12.1); + parcelMap.put("width", 8); + parcelMap.put("length", 19.8); + + Map shipmentMap = new HashMap(); + shipmentMap.put("from_address", fromAddressMap); + shipmentMap.put("to_address", toAddressMap); + shipmentMap.put("parcel", parcelMap); + + Shipment shipment = client.shipment.create(shipmentMap); + + Shipment boughtShipment = client.shipment.buy(shipment.getId(), shipment.lowestRate()); + + System.out.println(boughtShipment.prettyPrint()); + } } +``` + +## HTTP Hooks + +Users can subscribe to HTTP requests and responses via the `RequestHook` and `ResponseHook` objects. To do so, pass a function to the `subscribeToRequestHook` or `subscribeToResponseHook` methods of an `EasyPostClient` object: + +```java + EasyPostClient client = new EasyPostClient(System.getenv("EASYPOST_API_KEY")); + + // For request hook custom function, make sure you have RequestHookResponses in the parameter + public static Object requestHookFunction(RequestHookResponses data) { + // Pass your code here, the information about the request/response is available within the data parameter. + return true; + } + + client.subscribeToRequestHook(requestHookFunction); // subscribe to request hook by passing your custom function + client.unsubscribeToRequestHook(requestHookFunction); // unsubscribe from request hook + // For response hook custom function, make sure you have ResponseHookResponses in the parameter + public static Object responseHookFunction(ResponseHookResponses data) { + // Pass your code here, the information about the request/response is available within the data parameter. + return true; + } + + client.subscribeToResponseHook(responseHookFunction); // subscribe to response hook by passing your custom function + client.unsubscribeToResponseHook(responseHookFunction); // unsubscribe from response hook ``` ## Documentation -Up-to-date documentation at: https://easypost.com/docs +API documentation can be found at: . + +Library documentation can be found on the web at: or by building them locally via the `just docs` command. + +Upgrading major versions of this project? Refer to the [Upgrade Guide](UPGRADE_GUIDE.md). + +## Support + +New features and bug fixes are released on the latest major release of this library. If you are on an older major release of this library, we recommend upgrading to the most recent release to take advantage of new features, bug fixes, and security patches. Older versions of this library will continue to work and be available as long as the API version they are tied to remains active; however, they will not receive updates and are considered EOL. + +For additional support, see our [org-wide support policy](https://github.com/EasyPost/.github/blob/main/SUPPORT.md). ## Development ### Tests ```bash -mvn test -B +# Install dependencies +just install + +# Build project +just build + +# Lint project +just lint + +# Run tests +EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just build test +EASYPOST_TEST_API_KEY=123... EASYPOST_PROD_API_KEY=123... just coverage + +# Run security analysis +just scan + +# Generate library documentation +just docs + +# Update submodules +just update-examples-submodule ``` + +### Testing + +The test suite in this project was specifically built to produce consistent results on every run, regardless of when they run or who is running them. + +This project uses [EasyVCR](https://github.com/EasyPost/easyvcr-java) to record and replay HTTP requests and responses via "cassettes". When the suite is run, the HTTP requests and responses for each test function will be saved to a cassette if they do not exist already and replayed from this saved file if they do, which saves the need to make live API calls on every test run. + +**Sensitive Data:** We've made every attempt to include scrubbers for sensitive data when recording cassettes so that PII or sensitive info does not persist in version control; however, please ensure when recording or re-recording cassettes that prior to committing your changes, no PII or sensitive information gets persisted by inspecting the cassette. + +**Making Changes:** If you make an addition to this project, the request/response will get recorded automatically for you. When making changes to this project, you'll need to re-record the associated cassette to force a new live API call for that test which will then record the request/response used on the next run. + +**Test Data:** The test suite has been populated with various helpful fixtures that are available for use, each completely independent from a particular user **with the exception of the USPS carrier account ID** (see [Unit Test API Keys](#unit-test-api-keys) for more information) which has a fallback value of our internal testing user's ID. Some fixtures use hard-coded dates that may need to be incremented if cassettes get re-recorded (such as reports or pickups). + +#### Unit Test API Keys + +The following are required on every test run: + +- `EASYPOST_TEST_API_KEY` +- `EASYPOST_PROD_API_KEY` + +Some tests may require an EasyPost user with a particular set of enabled features such as a `Partner` user when creating referrals. We have attempted to call out these functions in their respective docstrings. The following are required when you need to re-record cassettes for applicable tests: + +- `USPS_CARRIER_ACCOUNT_ID` (eg: one-call buying a shipment for non-EasyPost employees) +- `PARTNER_USER_PROD_API_KEY` (eg: creating a referral user) +- `REFERRAL_CUSTOMER_PROD_API_KEY` (eg: adding a credit card to a referral user) diff --git a/UPGRADE_GUIDE.md b/UPGRADE_GUIDE.md new file mode 100644 index 000000000..22efd4799 --- /dev/null +++ b/UPGRADE_GUIDE.md @@ -0,0 +1,272 @@ +# Upgrade Guide + +Use the following guide to assist in the upgrade process of the `easypost-java` library between major versions. + +- [Upgrading from 7.x to 8.x](#upgrading-from-7x-to-80) +- [Upgrading from 6.x to 7.x](#upgrading-from-6x-to-70) +- [Upgrading from 5.x to 6.0](#upgrading-from-5x-to-60) +- [Upgrading from 4.x to 5.0](#upgrading-from-4x-to-50) + +## Upgrading from 7.x to 8.0 + +### 8.0 High Impact Changes + +- [Error Parsing](#80-error-parsing) + +### 8.0 Medium Impact Changes + +- [Deprecations](#80-deprecations) + +## 8.0 Error Parsing + +*Likelihood of Impact: **High*** + +The `errors` key of an error response can return either a list of `FieldError` objects or a list of strings. The error parsing has been expanded to include both formats. As such, you will now need to check for the format of the `errors` field and handle the errors appropriately for the type that is returned. + +The `Error` model has been removed since it is unused and we directly assign properties of an error response to the `ApiError` type. + +The `BetaPaymentRefund` now uses a list of `FieldError` instead of `Error` for the `errors` field. + +See the `CHANGELOG` for more details. + +## 8.0 Deprecations + +*Likelihood of Impact: **Medium*** + +The following functions have changed: + +- Removed deprecated functions + - `paymentMethod.all` (use `billing.retrievePaymentMethods` instead) + - `user.apiKeys` (use `apiKey.retrieveApiKeysForUser` instead) +- Changed deprecated functions + - `shipment.lowestSmartRate` (3rd param expects a valid `SmartRateAccuracy`) + - `utilities.findLowestSmartRate` (3rd param expects a valid `SmartRateAccuracy`) +- Renames + - `SmartrateAccuracy` is now `SmartRateAccuracy` + - `SmartrateCollection` is now `SmartRateCollection` + - `shipment.smartrates` is now `shipment.smartRates` + - `TimeInTransit.getBySmartrateAccuracy` is now `TimeInTransit.getSmartRateAccuracy` + +## Upgrading from 6.x to 7.0 + +**NOTICE:** v7 is deprecated. + +### 7.0 High Impact Changes + +- [Carbon Offset Removed](#70-carbon-offset-removed) + +### 7.0 Low Impact Changes + +- [createAndBuy() Batch Function Removed](#70-createandbuy-batch-function-removed) +- [Change return type of all() function in webhook service](#70-change-return-type-of-all-function-in-webhook-service) + +### 7.0 Carbon Offset Removed + +EasyPost now offers Carbon Neutral shipments by default for free! Because of this, there is no longer a need to specify if you want to offset the carbon footprint of a shipment. The `withCarbonOffset` parameter of the `create`, `buy`, and `regenerateRates` shipment functions have been removed as a result, as well as the overload functions that have `withCarbonOffset` parameter. This is a high-impact change for those using `EndShippers` as the function interfaces have changed. You will need to inspect the callsites to create and buy shipments to ensure that the EndShipper parameter is being passed in the correct place now that the `withCarbonOffset` parameter has been removed. + +### 7.0 createAndBuy Batch Function Removed + +The `createAndBuy` Batch endpoint has been deprecated and removed from the library. The correct procedure is to first create a batch and then purchase it with two separate API calls. + +### 7.0 Change return type of all function in webhook service + +The return type of `all` function in webhook service has been changed from `WebhookCollection` to `a list of webhooks`, the reason of this change is this endpoint returns a unpaginated list of webhooks. Therefore, there is no need to have `WebhookCollection` class which wraps the list of webhooks. + +## Upgrading from 5.x to 6.0 + +**NOTICE:** v6 is deprecated. + +### 6.0 High Impact Changes + +- [Client Instance](#60-client-instance) +- [Error Types](#60-error-types) +- [Empty Response Function Return Types](#60-empty-response-function-return-types) +- [Services and Resources](#60-services-and-resources) + +### 6.0 Medium Impact Changes + +- [Removal of Setters](#60-removal-of-setters) +- [Rename Some Getters](#60-rename-some-getters) + +### 6.0 Low Impact Changes + +- [Type Changes](#60-type-changes) + +## 6.0 Client Instance + +*Likelihood of Impact: **High*** + +The library is now designed around the idea of a `EasyPostClient`. Users will initialize an `EasyPostClient` instance with their API key and then use that instance to make API calls. + +This change allows for multiple clients to be instantiated with different API keys which allows this library to be safely used in a multi-threaded environment. + +```java +// Old +EasyPost.apiKey = System.getenv("EASYPOST_API_KEY"); // global API key + +// New +EasyPostClient client1 = new EasyPostClient("EASYPOST_API_KEY_1"); // per-client API key +EasyPostClient client2 = new EasyPostClient("EASYPOST_API_KEY_2"); // per-client API key +``` + +All functions are now accessed via the `EasyPostClient` instance. For example, to create a shipment: + +```java +// Old +EasyPost.apiKey = System.getenv("EASYPOST_API_KEY"); +Shipment shipment = Shipment.create(shipmentMap); + +// New +EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY_1"); +Shipment shipment = client.shipment.create(shipmentMap); +``` + +## 6.0 Error Types + +*Likelihood of Impact: **High*** + +Error handling has been overhauled and a number of specific exception types have been introduced. + +All exceptions inherit from `EasyPost.Exception.EasyPostException` (which extends `Java Exception` class). Users can catch this exception type to handle all errors thrown by the library. + +Subclasses of `EasyPostException` are grouped into two categories: + +- `EasyPost.Exception.API` for errors returned by the API. Subclasses of this exception type are: + - `ExternalApiError` - thrown when an issue occurs with an external API (e.g. Stripe) + - `ForbiddenError` - thrown when you don't have permission to access this API resource + - `GatewayTimeoutError` - thrown when the API gateway times out (504 status code) + - `InternalServerError` - thrown when an internal server error occurs (500 status code) + - `InvalidRequestError` - thrown when the API received an invalid request (422 status code) + - `MethodNotAllowedError` - thrown when the API receives a request with an invalid HTTP method ( + 405 status code) + - `NotFoundError` - thrown when the API receives a request for a resource that does not exist ( + 404 status code) + - `PaymentError` - thrown when a payment error occurs (402 status code) + - `ProxyError` - thrown when the library is unable to connect to the API via a proxy + - `RateLimitError` - thrown when the API rate limit is exceeded (429 status code) + - `RedirectError` - thrown when the http status is between 300 and 308. + - `ServiceUnavailableError` - thrown when the API is unavailable (503 status code) + - `TimeoutError` - thrown when the API request times out (408 status code) + - `UnauthorizedError` - thrown when the API receives an unauthorized request (401 or 403 status + code) + - `UnknownApiError` - thrown when an unknown API error occurs (unexpected 4xx status code) +- `EasyPost.Exception.General` for Generic error returned by the client library. Subclasses of this exception type are: + - `FilteringError` - thrown when an error occurs during filtering (e.g. calculating lowest rate) + - `InvalidObjectError` - thrown when an invalid object is being used + - `InvalidParameterError` - thrown when an invalid parameter is being used + - `MissingPropertyError` - thrown when a required property is missing (e.g. `Id` for most objects) + - `SignatureVerificationError` - thrown when the signature for a webhook is invalid + +Any exception thrown by the EasyPost library will be one of the above types. + +Any `EasyPost.Exception.API` exception will have the following properties: + +- `String Code` - the HTTP status code returned by the API call (e.g. 404) +- `String Message` - the error message returned by the API (e.g. "PARAMETER.INVALID") +- `List Errors` - a list of errors returned by the API (e.g. "Invalid parameter: to_address") + +Users can better anticipate exception information through utilities in the `EasyPost.Exception.Constants` file. + +## 6.0 Empty Response Function Return Types + +*Likelihood of Impact: **High*** + +The following functions return an empty body from the API have been changed to return void. + +- `fundWallet()` and `deletePaymentMethod()` in Billing class +- `createList()` in Tracker class +- `updateEmail()` in ReferralCustomer class + +## 6.0 Services and Resources + +*Likelihood of Impact: **High*** + +Static and instance-based methods have been divided into separate services and resources, methods that have API interactions are in services now. + +For example: + +- The static method `Shipment.buy()` is now accessible in the Shipment service via `client.shipment.buy("shp_...")`. +- The instance method `myShipment.lowestRate()` is still accessible only via a Shipment instance because there is no API interaction. +- The instance method of `refresh()` has been removed because you can no longer use an object to make a HTTP request. + +Instances of an object cannot be initialized directly. Instead, use the service to create the instance via a `create`, `retrieve`, or `all` API call. + +## 6.0 Removal of Setters + +*Likelihood of Impact: **Medium*** + +Objects no longer have setters. The use case of the setter is extremely low, but if you need to use the setter for a specific reason, try to use `reflection` in Java. + +## 6.0 Rename Some Getters + +*Likelihood of Impact: **Medium*** + +The following getters have been renamed: + +- Pickup class: `getPickoutRates()` -> `getPickupRates()` +- PaymentMethod class: `getPrimaryPaymentMethodObject()` -> `getPrimaryPaymentMethod()` +- PaymentMethod class: `getSecondaryPaymentMethodObject()` -> `getSecondaryPaymentMethod()` + +## 6.0 Type Changes + +*Likelihood of Impact: **Low*** + +The following properties have changed types: + +- `result` of Event from `EasyPostResource` to `Map` +- `amount` of Insurance from `Float` to `String` + +## Upgrading from 4.x to 5.0 + +**NOTICE:** v5 is deprecated. + +[v5 Docs](https://github.com/EasyPost/examples/tree/master/official/docs/java/v5) + +### 5.0 High Impact Changes + +- [Updating Dependencies](#50-updating-dependencies) +- [JSON Encoded Bodies](#50-json-encoded-bodies) + +### 5.0 Medium Impact Changes + +- [Default Timeouts for HTTP Requests](#50-default-timeouts-for-http-requests) + +### 5.0 Low Impact Changes + +- [Removal of Item and Container Objects](#50-removal-of-item-and-container-objects) + +## 5.0 Updating Dependencies + +Likelihood of Impact: High + +**Java 8 Required** + +easypost-java now requires Java 8 or greater. + +**Dependencies** + +All dependencies had minor version bumps. + +## 5.0 JSON Encoded Bodies + +Likelihood of Impact: High + +All `POST` and `PUT` request bodies are now JSON encoded instead of form-encoded. You may see subtle inconsistencies to how certain data types were previously sent to the API. We have taken steps to mitigate and test against these edge cases. + +## 5.0 Default Timeouts for HTTP Requests + +Likelihood of Impact: Medium + +Default timeouts for all HTTP requests are now set to 30 seconds for connection and 60 seconds for requests. If you require longer timeouts, you can set them by overriding the defaults: + +```java +// Timeouts are in milliseconds +EasyPostResource.setConnectTimeoutMilliseconds(30000); +EasyPostResource.setReadTimeoutMilliseconds(60000); +``` + +## 5.0 Removal of Item and Container Objects + +Likelihood of Impact: Low + +The `Item` and `Container` objects were removed as they have not been supported for some time. diff --git a/VERSION b/VERSION index 176890eaf..acd405b1d 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1 @@ -4.0.4 - +8.6.0 diff --git a/examples b/examples new file mode 160000 index 000000000..739f96c80 --- /dev/null +++ b/examples @@ -0,0 +1 @@ +Subproject commit 739f96c80fa211060e0a0b8c13e7371c9a09d66f diff --git a/justfile b/justfile new file mode 100644 index 000000000..591f8d820 --- /dev/null +++ b/justfile @@ -0,0 +1,68 @@ +## Builds the project for development +build: + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true + +## Cleans the project +clean: + mvn clean + +## Test (and build) the project to generate a coverage report +coverage: + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report + +## Check if project follows CheckStyle rules (must run install-checkstyle first) +checkstyle: + java -jar checkstyle.jar src -c examples/style_guides/java/easypost_java_style.xml -d + +## Generates library documentation +docs: + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true + cp -R target/reports/apidocs/ ./docs/ + +## Install the Checkstyle tool (Unix only) +install-checkstyle: install-styleguide + curl -LJs https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.3.1/checkstyle-10.3.1-all.jar -o checkstyle.jar + +## Install style guides +install-styleguide: init-examples-submodule + sh examples/symlink_directory_files.sh examples/style_guides/java . + +## Initialize the examples submodule +init-examples-submodule: + git submodule init + git submodule update + +## Install requirements +install: install-checkstyle + +## Lints the project +lint: checkstyle + +## Publish a release of the project (will build the project via the `mvn deploy` command) +# pass= - The GPG password to sign the release +publish pass: + mvn clean deploy -Dgpg.passphrase={{pass}} + +## Build the project as a dry run to publishing (will build the project via the `mvn install` command) +# pass= - The GPG password to sign the release +publish-dry pass: + mvn clean install -Dgpg.passphrase={{pass}} + +## Cuts a release for the project on GitHub (requires GitHub CLI) +# tag = The associated tag title of the release +# target = Target branch or full commit SHA +release tag target: + gh release create {{tag}} target/*.jar target/*.asc target/*.pom --target {{target}} + +## Test the project +test: + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true + +## Test the project on CI (does not rebuild the project) +test-ci: + mvn surefire:test + +## Update the examples submodule +update-examples-submodule: + git submodule init + git submodule update --remote diff --git a/pom.xml b/pom.xml index 1c73b449a..643345c3b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,12 @@ - + 4.0.0 com.easypost easypost-api-client - 4.0.4 + 8.6.0 jar com.easypost:easypost-api-client @@ -35,23 +36,55 @@ + + org.mockito + mockito-inline + + 4.11.0 + test + com.google.code.gson gson - 2.7 + 2.12.1 + compile + + + com.google.errorprone + error_prone_core + 2.36.0 + provided - junit - junit - 4.13.1 + org.junit.jupiter + junit-jupiter + 5.11.4 test org.hamcrest hamcrest - 2.2 + 3.0 + test + + + org.jetbrains + annotations + 26.0.2 + compile + + + com.easypost + easyvcr + 0.5.2 test + + org.projectlombok + lombok + 1.18.42 + provided + @@ -59,23 +92,21 @@ https://easypost.com - - org.sonatype.oss - oss-parent - 7 - - ossrh - https://oss.sonatype.org/content/repositories/snapshots + https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2 + https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2 - + + UTF-8 + UTF-8 + 8 + @@ -86,10 +117,65 @@ + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.0 + + + junit.jupiter.execution.order.random.seed=99 + + + + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + + **/model/** + + + + + + prepare-agent + + + + report + prepare-package + + report + + + + jacoco-check + + check + + + + + BUNDLE + + + LINE + COVEREDRATIO + 0.87 + + + + + + + + org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -104,8 +190,10 @@ maven-javadoc-plugin 8 + -html + true - 2.9.1 + 3.11.2 attach-javadocs @@ -118,7 +206,14 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.2.7 + + + + --pinentry-mode + loopback + + sign-artifacts @@ -132,27 +227,57 @@ org.apache.maven.plugins maven-compiler-plugin - 3.5.1 + 3.13.0 - 1.8 - 1.8 + 8 + UTF-8 + true + + -XDcompilePolicy=simple + -Xplugin:ErrorProne + --should-stop=ifError=FLOW + -Xlint:-options + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + com.google.errorprone + error_prone_core + 2.36.0 + + + org.projectlombok + lombok + 1.18.42 + + + - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - ossrh - https://oss.sonatype.org/ - true - + org.sonatype.plugins + nexus-staging-maven-plugin + 1.7.0 + true + + ossrh + https://ossrh-staging-api.central.sonatype.com + true + org.codehaus.mojo templating-maven-plugin - 1.0.0 + 3.0.0 filtering-java-templates @@ -162,6 +287,55 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.6.0 + + ${basedir}/easypost_java_style.xml + UTF-8 + true + true + + + + com.puppycrawl.tools + checkstyle + + 9.3 + + + + + + validate + validate + + check + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.5.0 + + + enforce-java + + enforce + + + + + [1.8.0,) + + + + + + diff --git a/src/main/java-templates/com/easypost/EasyPost.java b/src/main/java-templates/com/easypost/EasyPost.java index 3f6cc4682..ffd985099 100644 --- a/src/main/java-templates/com/easypost/EasyPost.java +++ b/src/main/java-templates/com/easypost/EasyPost.java @@ -1,9 +1,42 @@ package com.easypost; +import javax.net.ssl.HttpsURLConnection; +import java.util.function.Function; + +/** + * Hello weary traveler, welcome to the EasyPost Java client library. + *

+ * This file exists as a template for the Templating Maven Plugin (https://www.mojohaus.org/templating-maven-plugin/) + * If you notice the VERSION = ${project.version} below, that's an example of a template variable. + *

+ * In Maven, you can set variables inside the pom.xml file + * (https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#available-variables) + *

+ * The Templating Maven Plugin, at compile time, will extract these variables and add them into the source code. + *

+ * Specifically here, VERSION = ${project.version} will be replaced with, i.e. VERSION = 1.0.0 when compiling the code. + * NOTE: The VERSION will not populate if built with Gradle. + *

+ * The placement of this file is important. + * The Templating Maven Plugin will look for any template files in this specific `java-templates` directory. + * As a result, you can not remove this file. + * (https://www.hascode.com/2013/09/filtering-source-files-using-the-templating-maven-plugin/) + *

+ * Most of the other variables in this file are not template variables. + * Instead, we simply use this file as a catch-all for all global variables. + *

+ * If you ever run across a section of code where your IDE says it cannot find, i.e. `EasyPost.apiKey`, + * it's likely because this file has not been compiled yet. + * Simply run `make build` to compile this code and your IDE will be able to find the variable. + */ + public abstract class EasyPost { - public static String API_BASE = "https://api.easypost.com/v2"; - public static final String VERSION = "${project.version}"; - public static String apiKey; - public static String apiVersion; - public static int readTimeout; + public static final String VERSION = "${project.version}"; + + /** + * Set a VCR to be used for all HTTP requests. + *

+ * NOTE: This is meant for unit testing purposes only. Do not use in production. + */ + public static Function _vcrUrlFunction = null; } diff --git a/src/main/java/com/easypost/Constants.java b/src/main/java/com/easypost/Constants.java new file mode 100644 index 000000000..cbd00f208 --- /dev/null +++ b/src/main/java/com/easypost/Constants.java @@ -0,0 +1,94 @@ +package com.easypost; + +import java.util.HashMap; +import java.util.List; + +import com.easypost.exception.APIException; +import com.easypost.http.HashMapSerializer; +import com.easypost.model.AddressVerification; +import com.easypost.model.AddressVerificationDeserializer; +import com.easypost.model.ErrorDeserializer; +import com.easypost.model.SmartRateCollection; +import com.easypost.model.SmartRateCollectionDeserializer; +import com.easypost.model.StatelessRate; +import com.easypost.model.StatelessRateDeserializer; +import com.easypost.model.Webhook; +import com.easypost.model.WebhookDeserializer; +import com.google.common.collect.ImmutableList; +import com.google.gson.FieldNamingPolicy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public abstract class Constants { + + public static final String EASYPOST_SUPPORT_EMAIL = "support@easypost.com"; + + public abstract static class ErrorMessages { + public static final String EXTERNAL_API_CALL_FAILED = + "Could not send card details to %s, please try again later"; + public static final String ENCODED_ERROR = "Encode error for %s"; + public static final String INVALID_API_KEY_TYPE = "Invalid API key type."; + public static final String INVALID_PARAMETER = "Invalid parameter: %s."; + public static final String INVALID_PAYMENT = + "The chosen payment method is not a credit card. Please try again."; + public static final String INVALID_WEBHOOK_SIGNATURE = "Webhook does not contain a valid HMAC signature."; + public static final String MISSING_REQUIRED_PARAMETER = "Missing required parameter: %s."; + public static final String NO_OBJECT_FOUND = "No %s found."; + public static final String NO_PAYMENT_METHODS = + "No payment methods are set up. Please add a payment method and try again."; + public static final String API_DID_NOT_RETURN_ERROR_DETAILS = "API did not return error details."; + public static final String WEBHOOK_DOES_NOT_MATCH = + "Webhook received did not originate from EasyPost or had a webhook secret mismatch."; + + public static final String NO_MORE_PAGES_TO_RETRIEVE = "There are no more pages to retrieve."; + } + + public abstract static class ErrorCodes { + public static final int REDIRECT_CODE_BEGIN = 300; + public static final int REDIRECT_CODE_END = 308; + public static final int BAD_REQUEST_ERROR = 400; + public static final int UNAUTHORIZED_ERROR = 401; + public static final int PAYMENT_ERROR = 402; + public static final int FORBIDDEN_ERROR = 403; + public static final int NOT_FOUND_ERROR = 404; + public static final int METHOD_NOT_ALLOWED_ERROR = 405; + public static final int TIMEOUT_ERROR = 408; + public static final int INVALID_REQUEST_ERROR = 422; + public static final int RATE_LIMIT_ERROR = 429; + public static final int INTERNAL_SERVER_ERROR = 500; + public static final int SERVICE_UNAVAILABLE_ERROR = 503; + public static final int GATEWAY_TIMEOUT_ERROR = 504; + } + + public abstract static class CarrierAccountTypes { + public static final List CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOW = ImmutableList.of( + "FedexAccount", "FedexSmartpostAccount"); + + public static final List CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH = ImmutableList.of( + "AmazonShippingAccount", "UpsAccount", "UpsMailInnovationsAccount", "UpsSurepostAccount", + "UspsShipAccount"); + } + + public abstract static class Http { + public static final String API_BASE = "https://api.easypost.com"; + public static final String CHARSET = "UTF-8"; + public static final int DEFAULT_CONNECT_TIMEOUT_MILLISECONDS = 30000; + public static final int DEFAULT_READ_TIMEOUT_MILLISECONDS = 60000; + + public static final Gson GSON = new GsonBuilder() + // Standard model deserializer + .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) + // Core (de)serializers + .registerTypeAdapter(HashMap.class, new HashMapSerializer()) + .registerTypeAdapter(APIException.class, new ErrorDeserializer()) + // Model custom deserializers + .registerTypeAdapter(AddressVerification.class, new AddressVerificationDeserializer()) + .registerTypeAdapter(SmartRateCollection.class, new SmartRateCollectionDeserializer()) + .registerTypeAdapter(StatelessRate[].class, new StatelessRateDeserializer()) + .registerTypeAdapter(Webhook[].class, new WebhookDeserializer()) + .create(); + + public static final Gson PRETTY_PRINT_GSON = new GsonBuilder().setPrettyPrinting().serializeNulls() + .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create(); + } +} diff --git a/src/main/java/com/easypost/app/BatchExample.java b/src/main/java/com/easypost/app/BatchExample.java deleted file mode 100644 index 07e211f4d..000000000 --- a/src/main/java/com/easypost/app/BatchExample.java +++ /dev/null @@ -1,160 +0,0 @@ -import java.util.HashMap; -import java.util.Map; -import java.util.List; -import java.util.ArrayList; - -import java.lang.InterruptedException; - -import com.easypost.EasyPost; -import com.easypost.exception.EasyPostException; -import com.easypost.model.Address; -import com.easypost.model.Parcel; -import com.easypost.model.CustomsItem; -import com.easypost.model.CustomsInfo; -import com.easypost.model.Shipment; -import com.easypost.model.Batch; - -public class BatchExample { - - public static void main(String[] args) throws InterruptedException { - EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; - - try { - Map fromAddressMap = new HashMap(); - fromAddressMap.put("name", "Simpler Postage Inc"); - fromAddressMap.put("street1", "388 Townsend St"); - fromAddressMap.put("street2", "Apt 20"); - fromAddressMap.put("city", "San Francisco"); - fromAddressMap.put("state", "CA"); - fromAddressMap.put("zip", "94107"); - fromAddressMap.put("phone", "415-456-7890"); - Address fromAddress = Address.create(fromAddressMap); - - Map parcelMap = new HashMap(); - parcelMap.put("weight", 22.9); - parcelMap.put("height", 12.1); - parcelMap.put("width", 8); - parcelMap.put("length", 19.8); - Parcel parcel = Parcel.create(parcelMap); - - // Customs info - this is required for international destinations - Map customsItem1Map = new HashMap(); - customsItem1Map.put("description", "EasyPost T-shirts"); - customsItem1Map.put("quantity", 2); - customsItem1Map.put("value", 23.56); - customsItem1Map.put("weight", 18.8); - customsItem1Map.put("origin_country", "us"); - customsItem1Map.put("hs_tariff_number", "610910"); - - Map customsItem2Map = new HashMap(); - customsItem2Map.put("description", "EasyPost Stickers"); - customsItem2Map.put("quantity", 11); - customsItem2Map.put("value", 8.98); - customsItem2Map.put("weight", 3.2); - customsItem2Map.put("origin_country", "us"); - customsItem2Map.put("hs_tariff_number", "654321"); - - Map customsInfoMap = new HashMap(); - customsInfoMap.put("customs_certify", true); - customsInfoMap.put("customs_signer", "Dr. Pepper"); - customsInfoMap.put("contents_type", "gift"); - customsInfoMap.put("eel_pfc", "NOEEI 30.37(a)"); - customsInfoMap.put("non_delivery_option", "return"); - customsInfoMap.put("restriction_type", "none"); - CustomsItem customsItem1 = CustomsItem.create(customsItem1Map); - CustomsItem customsItem2 = CustomsItem.create(customsItem2Map); - List customsItemsList = new ArrayList(); - customsItemsList.add(customsItem1); - customsItemsList.add(customsItem2); - customsInfoMap.put("customs_items", customsItemsList); - CustomsInfo customsInfo = CustomsInfo.create(customsInfoMap); - - // this will be coming from your database or other input source - // hard coding it here for demonstration purposes only - List> orders = new ArrayList>(); - Map sampleOrder = new HashMap(); - sampleOrder.put("name", "Sawyer Bateman"); - sampleOrder.put("street1", "1A Larkspur Cres"); - sampleOrder.put("street2", ""); - sampleOrder.put("city", "St. Albert"); - sampleOrder.put("state", "AB"); - sampleOrder.put("zip", "T8N2M4"); - sampleOrder.put("phone", "780-483-2746"); - sampleOrder.put("country", "CA"); - sampleOrder.put("reference", "reference_number_123456"); - orders.add(sampleOrder); - - // loop over your orders and add a shipment for each - List> shipments = new ArrayList>(); - Map shipment = new HashMap(); - Map toAddressMap = new HashMap(); - for(Map order : orders) { - toAddressMap.put("name", order.get("name")); - toAddressMap.put("street1", order.get("street1")); - toAddressMap.put("street2", order.get("street2")); - toAddressMap.put("city", order.get("city")); - toAddressMap.put("state", order.get("state")); - toAddressMap.put("zip", order.get("zip")); - toAddressMap.put("phone", order.get("phone")); - toAddressMap.put("country", order.get("country")); - - shipment.put("to_address", toAddressMap); - shipment.put("from_address", fromAddress); - shipment.put("parcel", parcel); - shipment.put("customs_info", customsInfo); - shipment.put("reference", order.get("reference")); - - shipments.add(shipment); - } - - // create batch - Map batchMap = new HashMap(); - batchMap.put("shipment", shipments); - Batch batch = Batch.create(batchMap); - - // ** below this point should be a seperate script so that batch creation isn't duplicated - // ** store batch.id and use it in a new script with Batch.retrieve("{BATCH_ID}"); - - // loop through each shipment in the batch, purchasing the lowest rate for each - for (Shipment createdShipment : batch.getShipments()) { - // shipments in a new batch do not yet have rates, fetch them before purchasing - createdShipment = createdShipment.newRates(); - - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - // List buyServices = new ArrayList(); - // buyServices.add("FirstClassPackageServiceInternational"); - createdShipment.buy(createdShipment.lowestRate(buyCarriers)); - } - - // request a batch label of type pdf (other options are epl2 or zpl) - batch = batch.refresh(); - if (batch.status.getPostagePurchased() == batch.getShipments().size()) { - Map labelMap = new HashMap(); - labelMap.put("file_format", "pdf"); - - batch.label(labelMap); - } else { - // something went wrong, one of the shipments wasn't purchased successfully in the above loop - // probably wouldn't ever happen, shipment.buy above would throw an error - System.out.println("Uh oh"); - } - - // batch label creation is asyncronous; wait for it to be done before continuing - while(true) { - batch = batch.refresh(); - - if (batch.getLabelUrl() != null) { - break; - } - - Thread.sleep(8000); - } - - System.out.println(batch.prettyPrint()); - - } catch (EasyPostException e) { - e.printStackTrace(); - } - } -} diff --git a/src/main/java/com/easypost/app/BatchManifestExample.java b/src/main/java/com/easypost/app/BatchManifestExample.java deleted file mode 100644 index 38b25a6a2..000000000 --- a/src/main/java/com/easypost/app/BatchManifestExample.java +++ /dev/null @@ -1,84 +0,0 @@ -import java.util.HashMap; -import java.util.Map; -import java.util.List; -import java.util.ArrayList; - -import java.lang.InterruptedException; - -import com.easypost.EasyPost; -import com.easypost.exception.EasyPostException; -import com.easypost.model.Address; -import com.easypost.model.Parcel; -import com.easypost.model.Shipment; -import com.easypost.model.Batch; - -public class BatchManifestExample { - - public static void main(String[] args) throws InterruptedException { - EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; - - try { - Map addressMap = new HashMap(); - addressMap.put("name", "Simpler Postage Inc"); - addressMap.put("street1", "164 Townsend St"); - addressMap.put("street2", "Unit 1"); - addressMap.put("city", "San Francisco"); - addressMap.put("state", "CA"); - addressMap.put("zip", "94107"); - addressMap.put("phone", "415-456-7890"); - - Map parcelMap = new HashMap(); - parcelMap.put("weight", 22.9); - parcelMap.put("height", 12.1); - parcelMap.put("width", 8); - parcelMap.put("length", 19.8); - - // create two shipments - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", addressMap); - shipmentMap.put("from_address", addressMap); - shipmentMap.put("parcel", parcelMap); - Shipment shipment1 = Shipment.create(shipmentMap); - Shipment shipment2 = Shipment.create(shipmentMap); - - // create batch - Batch batch = Batch.create(); - - // wait until batch is created asynchronously - while(true) { - batch = batch.refresh(); - - if (batch.getState() == "created") { - break; - } - - Thread.sleep(3000); - } - - // add shipments to batch - List shipments = new ArrayList(); - shipments.add(shipment1); - shipments.add(shipment2); - batch.addShipments(shipments); - - // create manifest - batch.createScanForm(); - - // batch label creation is asyncronou - while(true) { - batch = batch.refresh(); - - if (batch.getScanForm() != null) { - break; - } - - Thread.sleep(8000); - } - - System.out.println(batch.prettyPrint()); - - } catch (EasyPostException e) { - e.printStackTrace(); - } - } -} diff --git a/src/main/java/com/easypost/app/Readme.java b/src/main/java/com/easypost/app/Readme.java deleted file mode 100644 index 1f5ebdaa0..000000000 --- a/src/main/java/com/easypost/app/Readme.java +++ /dev/null @@ -1,121 +0,0 @@ -// java -cp "target/easypost-java-2.0.4.jar:target/gson-2.2.4.jar" Readme - -import java.util.HashMap; -import java.util.Map; -import java.util.List; -import java.util.ArrayList; - -import com.easypost.EasyPost; -import com.easypost.exception.EasyPostException; -import com.easypost.model.Address; -import com.easypost.model.Parcel; -import com.easypost.model.CustomsItem; -import com.easypost.model.CustomsInfo; -import com.easypost.model.Shipment; - -public class Readme { - - public static void main(String[] args) { - EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; - - Map fromAddressMap = new HashMap(); - fromAddressMap.put("name", "Simpler Postage Inc"); - fromAddressMap.put("street1", "388 Townsend St"); - fromAddressMap.put("street2", "Apt 20"); - fromAddressMap.put("city", "San Francisco"); - fromAddressMap.put("state", "CA"); - fromAddressMap.put("zip", "94107"); - fromAddressMap.put("phone", "415-456-7890"); - - Map toAddressMap = new HashMap(); - toAddressMap.put("name", "Sawyer Bateman"); - toAddressMap.put("street1", "1A Larkspur Cres"); - toAddressMap.put("street2", ""); - toAddressMap.put("city", "St. Albert"); - toAddressMap.put("state", "AB"); - toAddressMap.put("zip", "T8N2M4"); - toAddressMap.put("phone", "780-483-2746"); - toAddressMap.put("country", "CA"); - - Map parcelMap = new HashMap(); - parcelMap.put("weight", 22.9); - parcelMap.put("height", 12.1); - parcelMap.put("width", 8); - parcelMap.put("length", 19.8); - - Map customsItem1Map = new HashMap(); - customsItem1Map.put("description", "EasyPost T-shirts"); - customsItem1Map.put("quantity", 2); - customsItem1Map.put("value", 23.56); - customsItem1Map.put("weight", 18.8); - customsItem1Map.put("origin_country", "us"); - customsItem1Map.put("hs_tariff_number", "123456"); - - Map customsItem2Map = new HashMap(); - customsItem2Map.put("description", "EasyPost Stickers"); - customsItem2Map.put("quantity", 11); - customsItem2Map.put("value", 8.98); - customsItem2Map.put("weight", 3.2); - customsItem2Map.put("origin_country", "us"); - customsItem2Map.put("hs_tariff_number", "654321"); - - try { - Address fromAddress = Address.create(fromAddressMap); - Address toAddress = Address.create(toAddressMap); - Parcel parcel = Parcel.create(parcelMap); - - - try { - Address verified = toAddress.verify(); - } catch (EasyPostException e) { - System.out.println(e.getMessage()); - } - - // customs - Map customsInfoMap = new HashMap(); - customsInfoMap.put("integrated_form_type", "form_2976"); - customsInfoMap.put("customs_certify", true); - customsInfoMap.put("customs_signer", "Dr. Pepper"); - customsInfoMap.put("contents_type", "gift"); - customsInfoMap.put("eel_pfc", "NOEEI 30.37(a)"); - customsInfoMap.put("non_delivery_option", "return"); - customsInfoMap.put("restriction_type", "none"); - CustomsItem customsItem1 = CustomsItem.create(customsItem1Map); - CustomsItem customsItem2 = CustomsItem.create(customsItem2Map); - List customsItemsList = new ArrayList(); - customsItemsList.add(customsItem1); - customsItemsList.add(customsItem2); - customsInfoMap.put("customs_items", customsItemsList); - CustomsInfo customsInfo = CustomsInfo.create(customsInfoMap); - - // create shipment - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", toAddress); - shipmentMap.put("from_address", fromAddress); - shipmentMap.put("parcel", parcel); - shipmentMap.put("customs_info", customsInfo); - - Shipment shipment = Shipment.create(shipmentMap); - - // buy postage - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - List buyServices = new ArrayList(); - buyServices.add("Priority"); - // List buyServiceCodes = new ArrayList(); - // buyServiceCodes.add("fedex.fedex_ground"); - - Map buyMap = new HashMap(); - buyMap.put("rate", shipment.lowestRate(buyCarriers, buyServices)); - buyMap.put("insurance", 249.99); - - // shipment = shipment.buy(shipment.lowestRate(buyCarriers, buyServices)); - shipment = shipment.buy(buyMap); - - System.out.println(shipment.prettyPrint()); - - } catch (EasyPostException e) { - e.printStackTrace(); - } - } -} diff --git a/src/main/java/com/easypost/app/SmartPostExample.java b/src/main/java/com/easypost/app/SmartPostExample.java deleted file mode 100644 index ed6b2216e..000000000 --- a/src/main/java/com/easypost/app/SmartPostExample.java +++ /dev/null @@ -1,85 +0,0 @@ -// java -cp "target/easypost-java-2.0.2.jar:target/gson-2.2.2.jar" SmartPostExample - -import java.util.HashMap; -import java.util.Map; -import java.util.List; -import java.util.ArrayList; - -import com.easypost.EasyPost; -import com.easypost.exception.EasyPostException; -import com.easypost.model.Address; -import com.easypost.model.Parcel; -import com.easypost.model.Shipment; - -public class SmartPostExample { - - public static void main(String[] args) { - EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; - - Map fromAddressMap = new HashMap(); - fromAddressMap.put("name", "Simpler Postage Inc"); - fromAddressMap.put("street1", "388 Townsend St"); - fromAddressMap.put("street2", "Apt 20"); - fromAddressMap.put("city", "San Francisco"); - fromAddressMap.put("state", "CA"); - fromAddressMap.put("zip", "94107"); - fromAddressMap.put("phone", "415-456-7890"); - - Map toAddressMap = new HashMap(); - toAddressMap.put("name", "Sawyer Bateman"); - toAddressMap.put("street1", "63 Ellis Street"); - toAddressMap.put("street2", ""); - toAddressMap.put("city", "San Francisco"); - toAddressMap.put("state", "CA"); - toAddressMap.put("zip", "94102"); - toAddressMap.put("phone", "415-482-2937"); - toAddressMap.put("country", "US"); - - Map parcelMap = new HashMap(); - parcelMap.put("weight", 20); - parcelMap.put("length", 6); - parcelMap.put("width", 8); - parcelMap.put("height", 1); - - try { - Address fromAddress = Address.create(fromAddressMap); - Address toAddress = Address.create(toAddressMap); - Parcel parcel = Parcel.create(parcelMap); - - // Address verified = to_address.verify(); - - // create shipment - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", toAddress); - shipmentMap.put("from_address", fromAddress); - shipmentMap.put("parcel", parcel); - - Map shipmentOptions = new HashMap(); - shipmentOptions.put("smartpost_hub", 5552); - shipmentOptions.put("smartpost_manifest", "123456789"); - shipmentMap.put("options", shipmentOptions); - - Shipment shipment = Shipment.create(shipmentMap); - - // buy postage - List buyServiceCodes = new ArrayList(); - buyServiceCodes.add("fedex.smart_post"); - - Map buyMap = new HashMap(); - buyMap.put("rate", shipment.lowestRate(buyServiceCodes)); - buyMap.put("insurance", 249.99); - - // shipment = shipment.buy(shipment.lowestRate(buyCarriers, buyServices)); - shipment = shipment.buy(buyMap); - - Map labelMap = new HashMap(); - labelMap.put("file_format", "pdf"); - shipment = shipment.label(labelMap); - - System.out.println(shipment.prettyPrint()); - - } catch (EasyPostException e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/main/java/com/easypost/app/Webhook.java b/src/main/java/com/easypost/app/Webhook.java deleted file mode 100644 index bc5b21675..000000000 --- a/src/main/java/com/easypost/app/Webhook.java +++ /dev/null @@ -1,36 +0,0 @@ -// java -cp "target/easypost-java-2.0.4.jar:target/gson-2.2.2.jar" Webhook - -import java.util.HashMap; -import java.util.Map; -import java.util.List; -import java.util.ArrayList; - -import com.easypost.EasyPost; -import com.easypost.exception.EasyPostException; -import com.easypost.model.Address; -import com.easypost.model.Parcel; -import com.easypost.model.CustomsItem; -import com.easypost.model.CustomsInfo; -import com.easypost.model.Shipment; -import com.easypost.model.Event; -import com.easypost.model.Tracker; -import com.easypost.net.EasyPostResource; - -public class Webhook { - - public static void main(String[] args) { - EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; - - try { - Event event = Event.retrieve("evt_ZzMEqURE"); - EasyPostResource tracker = event.getResult(); - - System.out.println(event.getDescription()); - System.out.println(tracker.getStatus()); - System.out.println(tracker.prettyPrint()); - - } catch (EasyPostException e) { - e.printStackTrace(); - } - } -} diff --git a/src/main/java/com/easypost/exception/API/BadRequestError.java b/src/main/java/com/easypost/exception/API/BadRequestError.java new file mode 100644 index 000000000..becea3047 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/BadRequestError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class BadRequestError extends APIException { + /** + * BadRequestError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public BadRequestError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/EncodingError.java b/src/main/java/com/easypost/exception/API/EncodingError.java new file mode 100644 index 000000000..772b1daae --- /dev/null +++ b/src/main/java/com/easypost/exception/API/EncodingError.java @@ -0,0 +1,24 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +public class EncodingError extends APIException { + /** + * EncodingError constructor. + * + * @param message the exception message + */ + public EncodingError(final String message) { + super(message); + } + + /** + * EncodingError constructor with nested exception. + * + * @param message the exception message + * @param e the nested exception + */ + public EncodingError(final String message, Throwable e) { + super(message, e); + } +} diff --git a/src/main/java/com/easypost/exception/API/ExternalApiError.java b/src/main/java/com/easypost/exception/API/ExternalApiError.java new file mode 100644 index 000000000..1b39c7450 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/ExternalApiError.java @@ -0,0 +1,14 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +public class ExternalApiError extends APIException { + /** + * ExternalApiError constructor. + * + * @param message the exception message + */ + public ExternalApiError(final String message) { + super(message); + } +} diff --git a/src/main/java/com/easypost/exception/API/ForbiddenError.java b/src/main/java/com/easypost/exception/API/ForbiddenError.java new file mode 100644 index 000000000..bb6165365 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/ForbiddenError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class ForbiddenError extends APIException { + /** + * ForbiddenError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public ForbiddenError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/GatewayTimeoutError.java b/src/main/java/com/easypost/exception/API/GatewayTimeoutError.java new file mode 100644 index 000000000..3592e218e --- /dev/null +++ b/src/main/java/com/easypost/exception/API/GatewayTimeoutError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class GatewayTimeoutError extends APIException { + /** + * GatewayTimeoutError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public GatewayTimeoutError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/HttpError.java b/src/main/java/com/easypost/exception/API/HttpError.java new file mode 100644 index 000000000..bbb5a5bdb --- /dev/null +++ b/src/main/java/com/easypost/exception/API/HttpError.java @@ -0,0 +1,24 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +public class HttpError extends APIException { + /** + * HttpError constructor. + * + * @param message the exception message + */ + public HttpError(final String message) { + super(message); + } + + /** + * HttpError constructor with nested exception. + * + * @param message the exception message + * @param e the nested exception + */ + public HttpError(final String message, Throwable e) { + super(message, e); + } +} diff --git a/src/main/java/com/easypost/exception/API/InternalServerError.java b/src/main/java/com/easypost/exception/API/InternalServerError.java new file mode 100644 index 000000000..a8b6e0769 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/InternalServerError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class InternalServerError extends APIException { + /** + * InternalServerError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public InternalServerError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/InvalidRequestError.java b/src/main/java/com/easypost/exception/API/InvalidRequestError.java new file mode 100644 index 000000000..69b770831 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/InvalidRequestError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class InvalidRequestError extends APIException { + /** + * InvalidRequestError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public InvalidRequestError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/JsonError.java b/src/main/java/com/easypost/exception/API/JsonError.java new file mode 100644 index 000000000..f33821654 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/JsonError.java @@ -0,0 +1,24 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +public class JsonError extends APIException { + /** + * JsonError constructor. + * + * @param message the exception message + */ + public JsonError(final String message) { + super(message); + } + + /** + * JsonError constructor with nested exception. + * + * @param message the exception message + * @param e the nested exception + */ + public JsonError(final String message, Throwable e) { + super(message, e); + } +} diff --git a/src/main/java/com/easypost/exception/API/MethodNotAllowedError.java b/src/main/java/com/easypost/exception/API/MethodNotAllowedError.java new file mode 100644 index 000000000..a72b643eb --- /dev/null +++ b/src/main/java/com/easypost/exception/API/MethodNotAllowedError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class MethodNotAllowedError extends APIException { + /** + * MethodNotAllowedError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public MethodNotAllowedError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/NotFoundError.java b/src/main/java/com/easypost/exception/API/NotFoundError.java new file mode 100644 index 000000000..7722d2693 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/NotFoundError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class NotFoundError extends APIException { + /** + * NotFoundError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public NotFoundError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/PaymentError.java b/src/main/java/com/easypost/exception/API/PaymentError.java new file mode 100644 index 000000000..0ee85bfb0 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/PaymentError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class PaymentError extends APIException { + /** + * PaymentError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public PaymentError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/RateLimitError.java b/src/main/java/com/easypost/exception/API/RateLimitError.java new file mode 100644 index 000000000..4e3d67c6a --- /dev/null +++ b/src/main/java/com/easypost/exception/API/RateLimitError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class RateLimitError extends APIException { + /** + * RateLimitError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public RateLimitError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/RedirectError.java b/src/main/java/com/easypost/exception/API/RedirectError.java new file mode 100644 index 000000000..7de23bf51 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/RedirectError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class RedirectError extends APIException { + /** + * RedirectError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public RedirectError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/ServiceUnavailableError.java b/src/main/java/com/easypost/exception/API/ServiceUnavailableError.java new file mode 100644 index 000000000..fe13a6e23 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/ServiceUnavailableError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class ServiceUnavailableError extends APIException { + /** + * ServiceUnavailablError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public ServiceUnavailableError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/TimeoutError.java b/src/main/java/com/easypost/exception/API/TimeoutError.java new file mode 100644 index 000000000..239966ad5 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/TimeoutError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class TimeoutError extends APIException { + /** + * TimeoutError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public TimeoutError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/UnauthorizedError.java b/src/main/java/com/easypost/exception/API/UnauthorizedError.java new file mode 100644 index 000000000..9fcee9262 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/UnauthorizedError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class UnauthorizedError extends APIException { + /** + * UnauthorizedError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public UnauthorizedError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/UnknownApiError.java b/src/main/java/com/easypost/exception/API/UnknownApiError.java new file mode 100644 index 000000000..6a1796b12 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/UnknownApiError.java @@ -0,0 +1,19 @@ +package com.easypost.exception.API; + +import com.easypost.exception.APIException; + +import java.util.List; + +public class UnknownApiError extends APIException { + /** + * UnknownApiError constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public UnknownApiError(final String message, final String code, List errors, final int statusCode) { + super(message, code, errors, statusCode); + } +} diff --git a/src/main/java/com/easypost/exception/API/package-info.java b/src/main/java/com/easypost/exception/API/package-info.java new file mode 100644 index 000000000..5f8f797e7 --- /dev/null +++ b/src/main/java/com/easypost/exception/API/package-info.java @@ -0,0 +1,9 @@ +/** + * Custom API exception classes for the EasyPost API. + * + * @author EasyPost developers + * @version 6.0 + * @see EasyPost API documentation + * @since 6.0 + */ +package com.easypost.exception.API; diff --git a/src/main/java/com/easypost/exception/APIException.java b/src/main/java/com/easypost/exception/APIException.java new file mode 100644 index 000000000..991a783c1 --- /dev/null +++ b/src/main/java/com/easypost/exception/APIException.java @@ -0,0 +1,108 @@ +package com.easypost.exception; + +import java.util.List; + +public class APIException extends EasyPostException { + private static final long serialVersionUID = 1L; + private final String code; + private final Integer statusCode; + private final String message; + private final List errors; + + /** + * APIException constructor. + * + * @param message the exception message + */ + public APIException(final String message) { + this(message, null, null, null, null); + } + + /** + * APIException constructor. + * + * @param message the exception message + * @param ex the exception cause + */ + public APIException(final String message, final Throwable ex) { + this(message, null, null, null, ex); + } + + /** + * APIException constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + */ + public APIException(final String message, final String code, final List errors) { + this(message, code, errors, null, null); + } + + /** + * APIException constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + */ + public APIException(final String message, final String code, final List errors, final Integer statusCode) { + this(message, code, errors, statusCode, null); + } + + /** + * APIException constructor. + * + * @param message the exception message + * @param code the exception code + * @param errors the errors array + * @param statusCode the exception status code + * @param ex the exception cause + */ + public APIException(final String message, final String code, final List errors, + final Integer statusCode, final Throwable ex) { + super(message); + this.message = message; + this.code = code; + this.errors = errors; + this.statusCode = statusCode; + } + + /** + * Get status code of the error object. + * + * @return statusCode the status code of the error object + */ + public Integer getStatusCode() { + return statusCode; + } + + /** + * Get code of the error object. + * + * @return code the code of the error object + */ + public String getCode() { + return code; + } + + /** + * Get message of the error object. + * + * @return message the message of the error object + */ + @Override + public String getMessage() { + return message; + } + + /** + * Get errors array of the exception. + * + * @return errors of the exception + */ + public List getErrors() { + return errors; + } +} diff --git a/src/main/java/com/easypost/exception/EasyPostException.java b/src/main/java/com/easypost/exception/EasyPostException.java index 675cf7264..2e396ad41 100644 --- a/src/main/java/com/easypost/exception/EasyPostException.java +++ b/src/main/java/com/easypost/exception/EasyPostException.java @@ -1,26 +1,14 @@ package com.easypost.exception; public class EasyPostException extends Exception { - - private static final long serialVersionUID = 1L; - private final String param; - - public EasyPostException(String message) { - super(message, null); - this.param = null; - } - - public EasyPostException(String message, Throwable e) { - super(message, e); - this.param = null; - } - - public EasyPostException(String message, String param, Throwable e) { - super(message, e); - this.param = param; - } - - public String getParam() { - return param; - } + private static final long serialVersionUID = 1L; + + /** + * EasyPostException constructor. + * + * @param message the exception message + */ + public EasyPostException(final String message) { + super(message); + } } diff --git a/src/main/java/com/easypost/exception/General/EndOfPaginationError.java b/src/main/java/com/easypost/exception/General/EndOfPaginationError.java new file mode 100644 index 000000000..2adbb98df --- /dev/null +++ b/src/main/java/com/easypost/exception/General/EndOfPaginationError.java @@ -0,0 +1,13 @@ +package com.easypost.exception.General; + +import com.easypost.Constants; +import com.easypost.exception.EasyPostException; + +public class EndOfPaginationError extends EasyPostException { + /** + * EndOfPaginationError constructor. + */ + public EndOfPaginationError() { + super(Constants.ErrorMessages.NO_MORE_PAGES_TO_RETRIEVE); + } +} diff --git a/src/main/java/com/easypost/exception/General/FilteringError.java b/src/main/java/com/easypost/exception/General/FilteringError.java new file mode 100644 index 000000000..a65580034 --- /dev/null +++ b/src/main/java/com/easypost/exception/General/FilteringError.java @@ -0,0 +1,14 @@ +package com.easypost.exception.General; + +import com.easypost.exception.EasyPostException; + +public class FilteringError extends EasyPostException { + /** + * FilteringError constructor. + * + * @param message the exception message + */ + public FilteringError(final String message) { + super(message); + } +} diff --git a/src/main/java/com/easypost/exception/General/InvalidObjectError.java b/src/main/java/com/easypost/exception/General/InvalidObjectError.java new file mode 100644 index 000000000..641e4f63b --- /dev/null +++ b/src/main/java/com/easypost/exception/General/InvalidObjectError.java @@ -0,0 +1,14 @@ +package com.easypost.exception.General; + +import com.easypost.exception.EasyPostException; + +public class InvalidObjectError extends EasyPostException { + /** + * InvalidObjectError constructor. + * + * @param message the exception message + */ + public InvalidObjectError(final String message) { + super(message); + } +} diff --git a/src/main/java/com/easypost/exception/General/InvalidParameterError.java b/src/main/java/com/easypost/exception/General/InvalidParameterError.java new file mode 100644 index 000000000..96674e81f --- /dev/null +++ b/src/main/java/com/easypost/exception/General/InvalidParameterError.java @@ -0,0 +1,15 @@ +package com.easypost.exception.General; + +import com.easypost.Constants; +import com.easypost.exception.EasyPostException; + +public class InvalidParameterError extends EasyPostException{ + /** + * InvalidParameterError constructor. + * + * @param parameterName the name of the invalid parameter + */ + public InvalidParameterError(final String parameterName) { + super(String.format(Constants.ErrorMessages.INVALID_PARAMETER, parameterName)); + } +} diff --git a/src/main/java/com/easypost/exception/General/MissingParameterError.java b/src/main/java/com/easypost/exception/General/MissingParameterError.java new file mode 100644 index 000000000..86786cfb7 --- /dev/null +++ b/src/main/java/com/easypost/exception/General/MissingParameterError.java @@ -0,0 +1,15 @@ +package com.easypost.exception.General; + +import com.easypost.Constants; +import com.easypost.exception.EasyPostException; + +public class MissingParameterError extends EasyPostException { + /** + * MissingParameterError constructor. + * + * @param parameterName the name of the missing parameter + */ + public MissingParameterError(final String parameterName) { + super(String.format(Constants.ErrorMessages.MISSING_REQUIRED_PARAMETER, parameterName)); + } +} diff --git a/src/main/java/com/easypost/exception/General/SignatureVerificationError.java b/src/main/java/com/easypost/exception/General/SignatureVerificationError.java new file mode 100644 index 000000000..c5c337839 --- /dev/null +++ b/src/main/java/com/easypost/exception/General/SignatureVerificationError.java @@ -0,0 +1,14 @@ +package com.easypost.exception.General; + +import com.easypost.exception.EasyPostException; + +public class SignatureVerificationError extends EasyPostException { + /** + * SignatureVerificationError constructor. + * + * @param message the exception message + */ + public SignatureVerificationError(final String message) { + super(message); + } +} diff --git a/src/main/java/com/easypost/exception/General/package-info.java b/src/main/java/com/easypost/exception/General/package-info.java new file mode 100644 index 000000000..d4c38a519 --- /dev/null +++ b/src/main/java/com/easypost/exception/General/package-info.java @@ -0,0 +1,9 @@ +/** + * Custom general exception classes for the EasyPost API. + * + * @author EasyPost developers + * @version 6.0 + * @see EasyPost API documentation + * @since 6.0 + */ +package com.easypost.exception.General; diff --git a/src/main/java/com/easypost/exception/package-info.java b/src/main/java/com/easypost/exception/package-info.java new file mode 100644 index 000000000..009612fdc --- /dev/null +++ b/src/main/java/com/easypost/exception/package-info.java @@ -0,0 +1,9 @@ +/** + * Custom exception classes for the EasyPost API. + * + * @author EasyPost developers + * @version 1.0 + * @see EasyPost API documentation + * @since 1.0 + */ +package com.easypost.exception; diff --git a/src/main/java/com/easypost/hooks/RequestHook.java b/src/main/java/com/easypost/hooks/RequestHook.java new file mode 100644 index 000000000..1b5cafedf --- /dev/null +++ b/src/main/java/com/easypost/hooks/RequestHook.java @@ -0,0 +1,36 @@ +package com.easypost.hooks; + +import java.util.function.Function; +import java.util.ArrayList; +import java.util.List; + +public class RequestHook { + private List> eventHandlers = new ArrayList<>(); + + /** + * Add a function to the list of event handlers. + * @param handler The event handler function to be added. + */ + public void addEventHandler(Function handler) { + eventHandlers.add(handler); + } + + /** + * Remove a function to the list of event handlers. + * @param handler The event handler function to be removed. + */ + public void removeEventHandler(Function handler) { + eventHandlers.remove(handler); + } + + /** + * Execute all the functions from the event handlers. + * @param datas The datas from the hooks. + */ + public void executeEventHandler(RequestHookResponses datas) { + for (Function eventHandler : eventHandlers) { + @SuppressWarnings("unused") + Object result = eventHandler.apply(datas); + } + } +} diff --git a/src/main/java/com/easypost/hooks/RequestHookResponses.java b/src/main/java/com/easypost/hooks/RequestHookResponses.java new file mode 100644 index 000000000..966408ad2 --- /dev/null +++ b/src/main/java/com/easypost/hooks/RequestHookResponses.java @@ -0,0 +1,38 @@ +package com.easypost.hooks; + +import java.util.Map; + +import com.google.gson.JsonObject; + +import lombok.Getter; +import lombok.Setter; + +@Setter @Getter +public class RequestHookResponses { + private Map headers; + private String method; + private String path; + private JsonObject requestBody; + private String requestTimestamp; + private String requestUuid; + + /** + * RequestHookResponses constructor. + * + * @param headers The headers of the request. + * @param method The HTTP method of the request. + * @param path The path of the request. + * @param requestBody The JSON object representing the request body. + * @param requestTimestamp The timestamp of the request. + * @param requestUuid The UUID of the request. + */ + public RequestHookResponses(Map headers, String method, String path, JsonObject requestBody, + String requestTimestamp, String requestUuid) { + this.headers = headers; + this.method = method; + this.path = path; + this.requestBody = requestBody; + this.requestTimestamp = requestTimestamp; + this.requestUuid = requestUuid; + } +} diff --git a/src/main/java/com/easypost/hooks/ResponseHook.java b/src/main/java/com/easypost/hooks/ResponseHook.java new file mode 100644 index 000000000..47d0452c6 --- /dev/null +++ b/src/main/java/com/easypost/hooks/ResponseHook.java @@ -0,0 +1,36 @@ +package com.easypost.hooks; + +import java.util.function.Function; +import java.util.ArrayList; +import java.util.List; + +public class ResponseHook { + private List> eventHandlers = new ArrayList<>(); + + /** + * Add a function to the list of event handlers. + * @param handler The event handler function to be added. + */ + public void addEventHandler(Function handler) { + eventHandlers.add(handler); + } + + /** + * Remove a function to the list of event handlers. + * @param handler The event handler function to be removed. + */ + public void removeEventHandler(Function handler) { + eventHandlers.remove(handler); + } + + /** + * Execute all the functions from the event handlers. + * @param datas The datas from the hooks. + */ + public void executeEventHandler(ResponseHookResponses datas) { + for (Function eventHandler : eventHandlers) { + @SuppressWarnings("unused") + Object result = eventHandler.apply(datas); + } + } +} diff --git a/src/main/java/com/easypost/hooks/ResponseHookResponses.java b/src/main/java/com/easypost/hooks/ResponseHookResponses.java new file mode 100644 index 000000000..8c4e65a65 --- /dev/null +++ b/src/main/java/com/easypost/hooks/ResponseHookResponses.java @@ -0,0 +1,42 @@ +package com.easypost.hooks; + +import java.util.Map; + +import lombok.Getter; +import lombok.Setter; + +@Setter @Getter +public class ResponseHookResponses { + private int httpStatus; + private Map headers; + private String method; + private String path; + private String responseBody; + private String responseTimestamp; + private String requestTimestamp; + private String requestUuid; + + /** + * ResponseHookResponses constructor. + * + * @param httpStatus The HTTP status code of the response. + * @param headers The headers of the response. + * @param method The HTTP method of the request. + * @param path The path of the request. + * @param responseBody The response body as a string. + * @param responseTimestamp The timestamp of the response. + * @param requestTimestamp The timestamp of the corresponding request. + * @param requestUuid The UUID of the corresponding request. + */ + public ResponseHookResponses(int httpStatus, Map headers, String method, String path, + String responseBody, String responseTimestamp, String requestTimestamp, String requestUuid) { + this.httpStatus = httpStatus; + this.headers = headers; + this.method = method; + this.path = path; + this.responseBody = responseBody; + this.responseTimestamp = responseTimestamp; + this.requestTimestamp = requestTimestamp; + this.requestUuid = requestUuid; + } +} diff --git a/src/main/java/com/easypost/hooks/package-info.java b/src/main/java/com/easypost/hooks/package-info.java new file mode 100644 index 000000000..17ee3aca4 --- /dev/null +++ b/src/main/java/com/easypost/hooks/package-info.java @@ -0,0 +1,9 @@ +/** + * Custom hook classes for the EasyPost API. + * + * @author EasyPost developers + * @version 1.0 + * @see EasyPost API documentation + * @since 1.0 + */ +package com.easypost.hooks; diff --git a/src/main/java/com/easypost/http/EasyPostResponse.java b/src/main/java/com/easypost/http/EasyPostResponse.java new file mode 100644 index 000000000..b1864924f --- /dev/null +++ b/src/main/java/com/easypost/http/EasyPostResponse.java @@ -0,0 +1,20 @@ +package com.easypost.http; + +import lombok.Getter; + +@Getter +public class EasyPostResponse { + private int responseCode; + private String responseBody; + + /** + * Constructor. + * + * @param responseCode HTTP response code + * @param responseBody HTTP response body + */ + public EasyPostResponse(final int responseCode, final String responseBody) { + this.responseCode = responseCode; + this.responseBody = responseBody; + } +} diff --git a/src/main/java/com/easypost/http/HashMapSerializer.java b/src/main/java/com/easypost/http/HashMapSerializer.java new file mode 100644 index 000000000..473193f3b --- /dev/null +++ b/src/main/java/com/easypost/http/HashMapSerializer.java @@ -0,0 +1,87 @@ +package com.easypost.http; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +/* + * This class overrides how HashMaps are serialized to JSON by the Gson library. + * + * Effectively every JSON body for every HTTP call will flow through this serializer. + */ +public final class HashMapSerializer implements JsonSerializer> { + + /** + * Clean a hash map. + * @param hashMap the hash map to scrub + * @return the scrubbed hash map + */ + @SuppressWarnings ("unchecked") + private HashMap cleanHashMap(HashMap hashMap) { + HashMap newHashMap = new HashMap<>(); + for (Map.Entry entry : hashMap.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + + if (value instanceof HashMap) { + value = cleanHashMap((HashMap) value); + } else if (value instanceof ArrayList) { + value = cleanArrayList((ArrayList) value); + } + + newHashMap.put(key, value); + } + return newHashMap; + } + + /** + * Clean an array list. + * @param arrayList the array list to scrub + * @return the scrubbed array list + */ + @SuppressWarnings ("unchecked") + private ArrayList cleanArrayList(ArrayList arrayList) { + ArrayList newArrayList = new ArrayList<>(); + for (Object object : arrayList) { + + if (object instanceof HashMap) { + object = cleanHashMap((HashMap) object); + } else if (object instanceof ArrayList) { + object = cleanArrayList((ArrayList) object); + } + + newArrayList.add(object); + } + return newArrayList; + } + + @Override + public JsonElement serialize(HashMap src, Type typeOfSrc, JsonSerializationContext context) { + JsonObject jsonObject = new JsonObject(); + + Gson gson = new Gson(); + + HashMap cleanedHashMap = cleanHashMap(src); + + for (Map.Entry entry : cleanedHashMap.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + + if (value == null) { + // don't serialize nulls + continue; + } + + jsonObject.add(key, gson.toJsonTree(value)); + } + + return jsonObject; + } +} diff --git a/src/main/java/com/easypost/http/Requestor.java b/src/main/java/com/easypost/http/Requestor.java new file mode 100644 index 000000000..5c3592e7f --- /dev/null +++ b/src/main/java/com/easypost/http/Requestor.java @@ -0,0 +1,770 @@ +package com.easypost.http; + +import com.easypost.Constants; +import com.easypost.EasyPost; +import com.easypost.exception.APIException; +import com.easypost.exception.API.BadRequestError; +import com.easypost.exception.API.EncodingError; +import com.easypost.exception.API.ForbiddenError; +import com.easypost.exception.API.GatewayTimeoutError; +import com.easypost.exception.API.HttpError; +import com.easypost.exception.API.InternalServerError; +import com.easypost.exception.API.InvalidRequestError; +import com.easypost.exception.API.JsonError; +import com.easypost.exception.API.MethodNotAllowedError; +import com.easypost.exception.API.NotFoundError; +import com.easypost.exception.API.PaymentError; +import com.easypost.exception.API.RateLimitError; +import com.easypost.exception.API.RedirectError; +import com.easypost.exception.API.ServiceUnavailableError; +import com.easypost.exception.API.TimeoutError; +import com.easypost.exception.API.UnauthorizedError; +import com.easypost.exception.API.UnknownApiError; +import com.easypost.exception.General.MissingParameterError; +import com.easypost.hooks.RequestHookResponses; +import com.easypost.hooks.ResponseHookResponses; +import com.easypost.model.EasyPostResource; +import com.easypost.service.EasyPostClient; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import lombok.Generated; + +import javax.net.ssl.HttpsURLConnection; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; +import java.net.URLStreamHandler; +import java.nio.charset.Charset; +import java.time.Instant; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Scanner; +import java.util.UUID; + +public abstract class Requestor { + public enum RequestMethod { + GET, + POST, + DELETE, + PUT + } + + private static final String DNS_CACHE_TTL_PROPERTY_NAME = "networkaddress.cache.ttl"; + private static final String CUSTOM_URL_STREAM_HANDLER_PROPERTY_NAME = "com.easypost.net.customURLStreamHandler"; + + private static String urlEncodePair(final String key, final String value) throws UnsupportedEncodingException { + return String.format("%s=%s", URLEncoder.encode(key, Constants.Http.CHARSET), + URLEncoder.encode(value, Constants.Http.CHARSET)); + } + + /** + * Set the header of the HTTP request. + * + * @param apiKey API of this HTTP request. + * @return HTTP header + * @throws MissingParameterError When the request fails. + */ + private static Map generateHeaders(String apiKey) throws MissingParameterError { + Map headers = new HashMap(); + headers.put("Accept-Charset", Constants.Http.CHARSET); + headers.put("User-Agent", + String.format("EasyPost/v2 JavaClient/%s Java/%s OS/%s OSVersion/%s OSArch/%s " + "Implementation/%s", + EasyPost.VERSION, System.getProperty("java.version"), + convertSpaceToHyphen(System.getProperty("os.name")), System.getProperty("os.version"), + convertSpaceToHyphen(System.getProperty("os.arch")), + convertSpaceToHyphen(System.getProperties().getProperty("java.vm.name")))); + + headers.put("Authorization", String.format("Bearer %s", apiKey)); + + return headers; + } + + /** + * Convert space to hyphen. + * + * @param string Input string. + * @return String that has hyphen instead of space. + */ + private static String convertSpaceToHyphen(String string) { + return string.replace(' ', '-'); + } + + /** + * Create connection to EasyPost API endpoint. + * + * @param url URL of the HTTP request. + * @param client EasyPostClient object. + * @param method Method of the API request. + * @return HttpsURLConnection + * @throws IOException If the connection cannot be opened. + * @throws MissingParameterError If the connection headers cannot be generated. + */ + private static javax.net.ssl.HttpsURLConnection createEasyPostConnection(final String url, + final EasyPostClient client, + final String method) + throws IOException, MissingParameterError { + HttpsURLConnection conn = null; + String customURLStreamHandlerClassName = System.getProperty(CUSTOM_URL_STREAM_HANDLER_PROPERTY_NAME, null); + if (customURLStreamHandlerClassName != null) { + // instantiate the custom handler provided + try { + @SuppressWarnings("unchecked") + Class clazz = (Class) Class + .forName(customURLStreamHandlerClassName); + Constructor constructor = clazz.getConstructor(); + URLStreamHandler customHandler = constructor.newInstance(); + URL urlObj = new URL(null, url, customHandler); + conn = (javax.net.ssl.HttpsURLConnection) urlObj.openConnection(); + } catch (ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalArgumentException + | InstantiationException | IllegalAccessException | InvocationTargetException e) { + throw new IOException(e); + } + } else if (EasyPost._vcrUrlFunction != null) { + conn = EasyPost._vcrUrlFunction.apply(url); + } else { + URL urlObj = new URL(null, url); + conn = (javax.net.ssl.HttpsURLConnection) urlObj.openConnection(); + } + conn.setConnectTimeout(client.getConnectionTimeoutMilliseconds()); + conn.setRequestMethod(method); + conn.setReadTimeout(client.getReadTimeoutMilliseconds()); + + conn.setUseCaches(false); + for (Map.Entry header : generateHeaders(client.getApiKey()).entrySet()) { + conn.setRequestProperty(header.getKey(), header.getValue()); + } + + return conn; + } + + /** + * Set the property to the HttpsURLConnection for Post and Put methods. + * + * @param conn EasyPost HttpsURLConnection + * @param body Input body + * @return HttpsURLConnection + * @throws IOException When the request fails. + */ + private static javax.net.ssl.HttpsURLConnection writeBody(final javax.net.ssl.HttpsURLConnection conn, + final JsonObject body) throws IOException { + if (body != null) { + conn.setDoOutput(true); + conn.setRequestProperty("Content-Type", "application/json"); + OutputStream output = null; + try { + output = conn.getOutputStream(); + String jsonString = body.toString(); + output.write(jsonString.getBytes(Constants.Http.CHARSET)); + } finally { + if (output != null) { + output.close(); + } + } + } + return conn; + } + + /** + * Create GET HTTP request connection. + * + * @param url URL of the HTTP request. + * @param query Query of the HTTP request. + * @param client EasyPostClient object. + * @return HttpsURLConnection object. + * @throws IOException If the connection cannot be opened. + * @throws MissingParameterError If the connection headers cannot be generated. + */ + private static javax.net.ssl.HttpsURLConnection createGetConnection(final String url, final String query, + final EasyPostClient client) + throws IOException, MissingParameterError { + String getURL = url; + if (query != null) { + getURL = String.format("%s?%s", url, query); + } + return createEasyPostConnection(getURL, client, "GET"); + } + + /** + * Create POST HTTP request connection. + * + * @param url URL of the HTTP request. + * @param body Body of the HTTP request. + * @param client EasyPostClient object. + * @return HttpsURLConnection object. + * @throws IOException If the connection cannot be opened. + * @throws MissingParameterError If the connection headers cannot be generated. + */ + private static javax.net.ssl.HttpsURLConnection createPostConnection(final String url, final JsonObject body, + final EasyPostClient client) + throws IOException, MissingParameterError { + javax.net.ssl.HttpsURLConnection conn = createEasyPostConnection(url, client, "POST"); + conn = writeBody(conn, body); + return conn; + } + + /** + * Create DELETE HTTP request connection. + * + * @param url URL of the HTTP request. + * @param query Query of the HTTP request. + * @param client EasyPostClient object. + * @return HttpsURLConnection object. + * @throws IOException If the connection cannot be opened. + * @throws MissingParameterError If the connection headers cannot be generated. + */ + private static javax.net.ssl.HttpsURLConnection createDeleteConnection(final String url, final String query, + final EasyPostClient client) + throws IOException, MissingParameterError { + String deleteUrl = url; + if (query != null) { + deleteUrl = String.format("%s?%s", url, query); + } + return createEasyPostConnection(deleteUrl, client, "DELETE"); + } + + /** + * Create PUT HTTP request connection. + * + * @param url URL of the HTTP request. + * @param body Body of the HTTP request. + * @param client EasyPostClient object. + * @return HttpsURLConnection object. + * @throws IOException If the connection cannot be opened. + * @throws MissingParameterError If the connection headers cannot be generated. + */ + private static javax.net.ssl.HttpsURLConnection createPutConnection(final String url, final JsonObject body, + final EasyPostClient client) + throws IOException, MissingParameterError { + javax.net.ssl.HttpsURLConnection conn = createEasyPostConnection(url, client, "PUT"); + conn = writeBody(conn, body); + return conn; + } + + /** + * Create body for the HTTP request. + * + * @param params Map of parameter for the HTTP request body. + * @return JsonObject of the Map object. + */ + private static JsonObject createBody(final Map params) { + // this is a hack to fix a broken concept: + // https://github.com/google/gson/issues/1080 + // noinspection rawtypes,unchecked + JsonElement jsonElement = Constants.Http.GSON.toJsonTree(new HashMap<>(params)); + JsonObject jsonObject = jsonElement.getAsJsonObject(); + return jsonObject; + } + + /** + * Create query for the HTTP request. + * + * @param params Map of parameter for the HTTP request body. + * @return Query string of the Map object. + * @throws UnsupportedEncodingException When the request fails. + */ + private static String createQuery(final Map params) throws UnsupportedEncodingException { + Map flatParams = flattenParams(params); + StringBuilder queryStringBuilder = new StringBuilder(); + for (Map.Entry entry : flatParams.entrySet()) { + queryStringBuilder.append("&"); + queryStringBuilder.append(urlEncodePair(entry.getKey(), entry.getValue())); + } + if (queryStringBuilder.length() > 0) { + queryStringBuilder.deleteCharAt(0); + } + return queryStringBuilder.toString(); + } + + private static Map flattenParams(final Map params) { + if (params == null) { + return new HashMap(); + } + Map flatParams = new HashMap(); + for (Map.Entry entry : params.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + if (value instanceof Map) { + Map flatNestedMap = new HashMap(); + Map nestedMap = (Map) value; + for (Map.Entry nestedEntry : nestedMap.entrySet()) { + flatNestedMap.put(String.format("%s[%s]", key, nestedEntry.getKey()), nestedEntry.getValue()); + } + flatParams.putAll(flattenParams(flatNestedMap)); + } else if (value instanceof List) { + Map flatNestedMap = new HashMap(); + List nestedList = (List) value; + for (int i = 0; i < nestedList.size(); i++) { + flatNestedMap.put(String.format("%s[%s]", key, i), nestedList.get(i)); + flatParams.putAll(flattenParams(flatNestedMap)); + } + } else if (value instanceof EasyPostResource) { + flatParams.put(String.format("%s[%s]", key, "id"), value.toString()); + + } else if (value != null) { + flatParams.put(key, value.toString()); + } + } + + return flatParams; + } + + /** + * Get response body from the InputStream. + * + * @param responseStream The InputStream from the response body. + * @return InputStream in string value. + * @throws IOException When the request fails. + */ + private static String getResponseBody(final InputStream responseStream) throws IOException { + if (responseStream.available() == 0) { + // Return empty string if the InputSteam is empty to avoid exceptions. + return ""; + } + + @SuppressWarnings("resource") + String rBody = new Scanner(responseStream, Constants.Http.CHARSET).useDelimiter("\\A").next(); + responseStream.close(); + return rBody; + } + + /** + * Make URL connection request based on the API method. + * + * @param method API method. + * @param url URL of the HTTP request. + * @param query Query string of the HTTP request. + * @param body Body of the HTTP request. + * @param client EasyPostClient object + * @return EasyPostResponse object. + * @throws HttpError if the HTTP connection cannot be made. + */ + private static EasyPostResponse makeURLConnectionRequest(final RequestMethod method, final String url, + final String query, final JsonObject body, + final EasyPostClient client) throws HttpError { + javax.net.ssl.HttpsURLConnection conn = null; + try { + switch (method) { + case GET: + conn = createGetConnection(url, query, client); + break; + case POST: + conn = createPostConnection(url, body, client); + break; + case PUT: + conn = createPutConnection(url, body, client); + break; + case DELETE: + conn = createDeleteConnection(url, query, client); + break; + default: + throw new HttpError( + String.format("Unrecognized HTTP method %s. Please contact EasyPost at %s.", method, + Constants.EASYPOST_SUPPORT_EMAIL)); + } + conn.connect(); // This line is crucial for getting VCR to work + // (triggers internal pre-request processing needed for VCR) + int rCode = conn.getResponseCode(); // sends the request + String rBody = null; + if (rCode == HttpURLConnection.HTTP_NO_CONTENT) { + rBody = ""; + } else if (rCode >= HttpURLConnection.HTTP_OK && rCode < HttpURLConnection.HTTP_MULT_CHOICE) { + rBody = getResponseBody(conn.getInputStream()); + } else { + rBody = getResponseBody(conn.getErrorStream()); + } + return new EasyPostResponse(rCode, rBody); + } catch (MissingParameterError e) { + throw new HttpError(String.format( + "Could not build EasyPost API request. If this problem persists, please contact us at %s.", + Constants.EASYPOST_SUPPORT_EMAIL)); + } catch (IOException e) { + throw new HttpError(String.format("Could not connect to EasyPost (%s). " + + "Please check your internet connection and try again. If this problem persists," + + "please contact us at %s.", client.getApiBase(), Constants.EASYPOST_SUPPORT_EMAIL), e); + } finally { + if (conn != null) { + conn.disconnect(); + } + } + } + + /** + * Send an HTTP request to EasyPost. + * + * @param Any class. + * @param method The method of the API request. + * @param endpoint The endpoint of the API request. + * @param params The params of the API request. + * @param clazz The class of the object for deserialization + * @param client The EasyPostClient object. + * @return A clazz-type object. + * @throws HttpError when the HTTP connection cannot be made. + * @throws EncodingError when the request query cannot be encoded. + * @throws JsonError when the request body cannot be encoded. + * @throws RedirectError when the request is redirected. + * @throws UnauthorizedError when the request is unauthorized. + * @throws ForbiddenError when the request is forbidden. + * @throws PaymentError when the request requires payment. + * @throws NotFoundError when the request endpoint is not found. + * @throws MethodNotAllowedError when the request method is not allowed. + * @throws MissingParameterError when the request client doesn't have API key. + * @throws TimeoutError when the request times out. + * @throws BadRequestError when the request is bad. + * @throws InvalidRequestError when the request is invalid. + * @throws RateLimitError when the request exceeds the rate limit. + * @throws InternalServerError when the request fails due to an internal + * server error. + * @throws ServiceUnavailableError when the request fails due to a service + * unavailability. + * @throws GatewayTimeoutError when the request fails due to a gateway + * timeout. + * @throws UnknownApiError when the request fails due to an unknown API + * error. + */ + public static T request(final RequestMethod method, final String endpoint, final Map params, + final Class clazz, final EasyPostClient client) + throws GatewayTimeoutError, RateLimitError, BadRequestError, InvalidRequestError, NotFoundError, + TimeoutError, EncodingError, + UnauthorizedError, MethodNotAllowedError, InternalServerError, UnknownApiError, ServiceUnavailableError, + ForbiddenError, JsonError, HttpError, RedirectError, PaymentError, MissingParameterError { + String apiVersion = client.getApiVersion(); + return request(method, endpoint, params, clazz, client, apiVersion); + } + + /** + * Send an HTTP request to EasyPost. + * + * @param Any class. + * @param method The method of the API request. + * @param endpoint The endpoint of the API request. + * @param params The params of the API request. + * @param clazz The class of the object for deserialization + * @param client The EasyPostClient object. + * @param apiVersion The API version to use for this request. + * @return A clazz-type object. + * @throws HttpError when the HTTP connection cannot be made. + * @throws EncodingError when the request query cannot be encoded. + * @throws JsonError when the request body cannot be encoded. + * @throws RedirectError when the request is redirected. + * @throws UnauthorizedError when the request is unauthorized. + * @throws ForbiddenError when the request is forbidden. + * @throws PaymentError when the request requires payment. + * @throws NotFoundError when the request endpoint is not found. + * @throws MethodNotAllowedError when the request method is not allowed. + * @throws MissingParameterError when the request client doesn't have API key. + * @throws TimeoutError when the request times out. + * @throws BadRequestError when the request is bad. + * @throws InvalidRequestError when the request is invalid. + * @throws RateLimitError when the request exceeds the rate limit. + * @throws InternalServerError when the request fails due to an internal + * server error. + * @throws ServiceUnavailableError when the request fails due to a service + * unavailability. + * @throws GatewayTimeoutError when the request fails due to a gateway + * timeout. + * @throws UnknownApiError when the request fails due to an unknown API + * error. + */ + public static T request(final RequestMethod method, final String endpoint, final Map params, + final Class clazz, final EasyPostClient client, final String apiVersion) + throws EncodingError, JsonError, RedirectError, UnauthorizedError, ForbiddenError, PaymentError, + NotFoundError, MethodNotAllowedError, TimeoutError, BadRequestError, InvalidRequestError, RateLimitError, + InternalServerError, ServiceUnavailableError, GatewayTimeoutError, UnknownApiError, HttpError, + MissingParameterError { + String originalDNSCacheTTL = null; + boolean allowedToSetTTL = true; + String url = client.getApiBase() + "/" + apiVersion + "/" + endpoint; + + try { + originalDNSCacheTTL = java.security.Security.getProperty(DNS_CACHE_TTL_PROPERTY_NAME); + // disable DNS cache + java.security.Security.setProperty(DNS_CACHE_TTL_PROPERTY_NAME, "0"); + } catch (SecurityException se) { + allowedToSetTTL = false; + } + + try { + return httpRequest(method, url, params, clazz, client); + } finally { + if (allowedToSetTTL) { + if (originalDNSCacheTTL == null) { + // value unspecified by implementation + java.security.Security.setProperty(DNS_CACHE_TTL_PROPERTY_NAME, "-1"); // cache forever + } else { + java.security.Security.setProperty(DNS_CACHE_TTL_PROPERTY_NAME, originalDNSCacheTTL); + } + } + } + } + + /** + * Send an HTTP request to EasyPost. + * + * @param Any class. + * @param method The method of the API request. + * @param url The URL of the API request. + * @param params The params of the API request. + * @param clazz The class of the object for deserialization + * @param client The EasyPostClient object. + * @return A clazz-type object. + * @throws EncodingError when the request query cannot be encoded. + * @throws JsonError when the request body cannot be encoded. + * @throws RedirectError when the request is redirected. + * @throws UnauthorizedError when the request is unauthorized. + * @throws ForbiddenError when the request is forbidden. + * @throws PaymentError when the request requires payment. + * @throws NotFoundError when the request endpoint is not found. + * @throws MethodNotAllowedError when the request method is not allowed. + * @throws MissingParameterError when the request client doesn't have API key. + * @throws TimeoutError when the request times out. + * @throws BadRequestError when the request is bad. + * @throws InvalidRequestError when the request is invalid. + * @throws RateLimitError when the request exceeds the rate limit. + * @throws InternalServerError when the request fails due to an internal + * server error. + * @throws ServiceUnavailableError when the request fails due to a service + * unavailability. + * @throws GatewayTimeoutError when the request fails due to a gateway + * timeout. + * @throws UnknownApiError when the request fails due to an unknown API + * error. + */ + @SuppressWarnings("checkstyle:methodname") + private static T httpRequest(final RequestMethod method, final String url, final Map params, + final Class clazz, final EasyPostClient client) + throws EncodingError, JsonError, RedirectError, UnauthorizedError, ForbiddenError, PaymentError, + NotFoundError, MethodNotAllowedError, TimeoutError, BadRequestError, InvalidRequestError, RateLimitError, + InternalServerError, ServiceUnavailableError, GatewayTimeoutError, UnknownApiError, HttpError, + MissingParameterError { + String query = null; + JsonObject body = null; + if (params != null) { + switch (method) { + case GET: + case DELETE: + try { + query = createQuery(params); + } catch (UnsupportedEncodingException e) { + throw new EncodingError( + String.format("Unable to encode parameters to %s. Please email %s for assistance.", + Constants.Http.CHARSET, Constants.EASYPOST_SUPPORT_EMAIL), + e); + } + break; + case POST: + case PUT: + try { + body = createBody(params); + } catch (Exception e) { + throw new JsonError(String.format( + "Unable to create JSON body from parameters. Please email %s for assistance.", + Constants.EASYPOST_SUPPORT_EMAIL), e); + } + break; + default: + break; + } + } + Instant requestTimestamp = Instant.now(); + UUID requestUuid = UUID.randomUUID(); + Map headers = generateHeaders(client.getApiKey()); + + RequestHookResponses requestResponse = new RequestHookResponses(headers, method.toString(), url, body, + requestTimestamp.toString(), requestUuid.toString()); + + client.getRequestHooks().executeEventHandler(requestResponse); + + EasyPostResponse response; + try { + // HTTPSURLConnection verifies SSL cert by default + response = makeURLConnectionRequest(method, url, query, body, client); + } catch (ClassCastException ce) { + // appengine + String appEngineEnv = System.getProperty("com.google.appengine.runtime.environment", null); + if (appEngineEnv != null) { + response = makeAppEngineRequest(method, url, query, body, client); + } else { + throw ce; + } + } + int rCode = response.getResponseCode(); + String rBody = response.getResponseBody(); + + ResponseHookResponses responseHookResponses = new ResponseHookResponses(rCode, headers, method.toString(), url, + rBody, Instant.now().toString(), requestTimestamp.toString(), requestUuid.toString()); + client.getResponseHooks().executeEventHandler(responseHookResponses); + + if (rCode < HttpURLConnection.HTTP_OK || rCode >= HttpURLConnection.HTTP_MULT_CHOICE) { + handleAPIError(rBody, rCode); + } + + return Constants.Http.GSON.fromJson(rBody, clazz); + } + + /** + * Handles API error based on the error status code. + * + * @param rBody Body of the error message. + * @param rCode Status code of the error message. + * @throws RedirectError when the request is redirected. + * @throws UnauthorizedError when the request is unauthorized. + * @throws ForbiddenError when the request is forbidden. + * @throws PaymentError when the request requires payment. + * @throws NotFoundError when the request endpoint is not found. + * @throws MethodNotAllowedError when the request method is not allowed. + * @throws TimeoutError when the request times out. + * @throws BadRequestError when the request is bad. + * @throws InvalidRequestError when the request is invalid. + * @throws RateLimitError when the request exceeds the rate limit. + * @throws InternalServerError when the request fails due to an internal + * server error. + * @throws ServiceUnavailableError when the request fails due to a service + * unavailability. + * @throws GatewayTimeoutError when the request fails due to a gateway + * timeout. + * @throws UnknownApiError when the request fails due to an unknown API + * error. + */ + protected static void handleAPIError(String rBody, final int rCode) + throws RedirectError, UnauthorizedError, ForbiddenError, PaymentError, NotFoundError, MethodNotAllowedError, + TimeoutError, BadRequestError, InvalidRequestError, RateLimitError, InternalServerError, + ServiceUnavailableError, + GatewayTimeoutError, UnknownApiError { + if (rBody == null || rBody.length() == 0) { + rBody = "{}"; + } + APIException error = Constants.Http.GSON.fromJson(rBody, APIException.class); + String errorMessage = error.getMessage(); + String errorCode = error.getCode(); + List errors = error.getErrors(); + + if (rCode >= Constants.ErrorCodes.REDIRECT_CODE_BEGIN && rCode <= Constants.ErrorCodes.REDIRECT_CODE_END) { + throw new RedirectError(errorMessage, errorCode, errors, rCode); + } + + switch (rCode) { + case Constants.ErrorCodes.UNAUTHORIZED_ERROR: + throw new UnauthorizedError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.FORBIDDEN_ERROR: + throw new ForbiddenError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.PAYMENT_ERROR: + throw new PaymentError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.NOT_FOUND_ERROR: + throw new NotFoundError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.METHOD_NOT_ALLOWED_ERROR: + throw new MethodNotAllowedError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.TIMEOUT_ERROR: + throw new TimeoutError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.BAD_REQUEST_ERROR: + throw new BadRequestError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.INVALID_REQUEST_ERROR: + throw new InvalidRequestError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.RATE_LIMIT_ERROR: + throw new RateLimitError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.INTERNAL_SERVER_ERROR: + throw new InternalServerError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.SERVICE_UNAVAILABLE_ERROR: + throw new ServiceUnavailableError(errorMessage, errorCode, errors, rCode); + case Constants.ErrorCodes.GATEWAY_TIMEOUT_ERROR: + throw new GatewayTimeoutError(errorMessage, errorCode, errors, rCode); + default: + throw new UnknownApiError(errorMessage, errorCode, errors, rCode); + } + } + + /** + * Make a request using Google's App Engine library. + * + * @param method The HTTP method. + * @param url The URL to make the request to. + * @param query The query string. + * @param body The request body. + * @param client The EasyPost client. + * @return The response from the API. + * @throws HttpError when the request process fails. + */ + @Generated // Exclude from the jacoco test coverage + private static EasyPostResponse makeAppEngineRequest(final RequestMethod method, String url, final String query, + final JsonObject body, final EasyPostClient client) + throws HttpError { + String unknownErrorMessage = String.format( + "Sorry, an unknown error occurred while trying to use the Google App Engine runtime." + + "Please email %s for assistance.", + Constants.EASYPOST_SUPPORT_EMAIL); + try { + if ((method == RequestMethod.GET || method == RequestMethod.DELETE) && query != null) { + url = String.format("%s?%s", url, query); + } + URL fetchURL = new URL(url); + + Class requestMethodClass = Class.forName("com.google.appengine.api.urlfetch.HTTPMethod"); + Object httpMethod = requestMethodClass.getDeclaredField(method.name()).get(null); + + Class fetchOptionsBuilderClass = Class.forName("com.google.appengine.api.urlfetch.FetchOptions$Builder"); + Object fetchOptions = null; + try { + fetchOptions = fetchOptionsBuilderClass.getDeclaredMethod("validateCertificate").invoke(null); + } catch (NoSuchMethodException e) { + System.err.printf( + "Warning: this App Engine SDK version does not allow verification of SSL certificates;" + + "this exposes you to a MITM attack. Please upgrade your App Engine SDK to >=1.5.0. " + + "If you have questions, email %s.%n", + Constants.EASYPOST_SUPPORT_EMAIL); + fetchOptions = fetchOptionsBuilderClass.getDeclaredMethod("withDefaults").invoke(null); + } + + Class fetchOptionsClass = Class.forName("com.google.appengine.api.urlfetch.FetchOptions"); + + // Heroku times out after 30s, so leave some time for the API to return a + // response + fetchOptionsClass.getDeclaredMethod("setDeadline", java.lang.Double.class) + .invoke(fetchOptions, client.getConnectionTimeoutMilliseconds()); + + Class requestClass = Class.forName("com.google.appengine.api.urlfetch.HTTPRequest"); + + Object request = requestClass.getDeclaredConstructor(URL.class, requestMethodClass, fetchOptionsClass) + .newInstance(fetchURL, httpMethod, fetchOptions); + + if ((method == RequestMethod.POST || method == RequestMethod.PUT) && body != null) { + String bodyString = body.toString(); + requestClass.getDeclaredMethod("setPayload", byte[].class) + .invoke(request, bodyString.getBytes(Charset.defaultCharset())); + } + + for (Map.Entry header : generateHeaders(client.getApiKey()).entrySet()) { + Class httpHeaderClass = Class.forName("com.google.appengine.api.urlfetch.HTTPHeader"); + Object reqHeader = httpHeaderClass.getDeclaredConstructor(String.class, String.class) + .newInstance(header.getKey(), header.getValue()); + requestClass.getDeclaredMethod("setHeader", httpHeaderClass).invoke(request, reqHeader); + } + + Class urlFetchFactoryClass = Class.forName("com.google.appengine.api.urlfetch.URLFetchServiceFactory"); + Object urlFetchService = urlFetchFactoryClass.getDeclaredMethod("getURLFetchService").invoke(null); + + Method fetchMethod = urlFetchService.getClass().getDeclaredMethod("fetch", requestClass); + fetchMethod.setAccessible(true); + Object response = fetchMethod.invoke(urlFetchService, request); + + int responseCode = (Integer) response.getClass().getDeclaredMethod("getResponseCode").invoke(response); + String responseBody = new String( + (byte[]) response.getClass().getDeclaredMethod("getContent").invoke(response), + Constants.Http.CHARSET); + + return new EasyPostResponse(responseCode, responseBody); + + } catch (InvocationTargetException | MalformedURLException | SecurityException | NoSuchFieldException + | NoSuchMethodException | ClassNotFoundException | IllegalArgumentException | IllegalAccessException + | InstantiationException | MissingParameterError | UnsupportedEncodingException e) { + throw new HttpError(unknownErrorMessage, e); + } + } +} diff --git a/src/main/java/com/easypost/http/package-info.java b/src/main/java/com/easypost/http/package-info.java new file mode 100644 index 000000000..c6868a1ad --- /dev/null +++ b/src/main/java/com/easypost/http/package-info.java @@ -0,0 +1,9 @@ +/** + * Classes for handling requests and responses to the EasyPost API. + * + * @author EasyPost developers + * @version 1.0 + * @see EasyPost API + * @since 1.0 + */ +package com.easypost.http; diff --git a/src/main/java/com/easypost/model/Address.java b/src/main/java/com/easypost/model/Address.java index feffb0d73..8fe810e50 100644 --- a/src/main/java/com/easypost/model/Address.java +++ b/src/main/java/com/easypost/model/Address.java @@ -1,258 +1,12 @@ package com.easypost.model; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Address extends EasyPostResource { - public String id; - String mode; - String name; - String company; - String street1; - String street2; - String zip; - String city; - String state; - String country; - String phone; - String email; - String message; - String carrierFacility; - String federalTaxId; - Boolean residential; - Map verifications; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } - - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - public String getCompany() { - return company; - } - public void setCompany(String company) { - this.company = company; - } - - public String getStreet1() { - return street1; - } - public void setStreet1(String street1) { - this.street1 = street1; - } - - public String getStreet2() { - return street2; - } - public void setStreet2(String street2) { - this.street2 = street2; - } - - public String getZip() { - return zip; - } - public void setZip(String zip) { - this.zip = zip; - } - - public String getCity() { - return city; - } - public void setCity(String city) { - this.city = city; - } - - public String getState() { - return state; - } - public void setState(String state) { - this.state = state; - } - - public String getCountry() { - return country; - } - public void setCountry(String country) { - this.country = country; - } - - public String getPhone() { - return phone; - } - public void setPhone(String phone) { - this.phone = phone; - } - - public String getEmail() { - return email; - } - public void setEmail(String email) { - this.email = email; - } - - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - public String getCarrierFacility() { - return carrierFacility; - } - public void setCarrierFacility(String carrierFacility) { - this.carrierFacility = carrierFacility; - } - - public String getFederalTaxId() { - return federalTaxId; - } - public void setFederalTaxId(String federalTaxId) { - this.federalTaxId = federalTaxId; - } - - public Boolean getResidential() { - return residential; - } - public void setResidential(Boolean residential) { - this.residential = residential; - } - - public Map getVerifications() { return verifications; } - public void setVerifications(Map verifications) { this.verifications = verifications; } - - // create - public static Address create(Map params) throws EasyPostException { - return create(params, null); - } - public static Address create(Map params, String apiKey) throws EasyPostException { - String url = classURL(Address.class); - - List verifyList = (List) params.remove("verify"); - List verifyStrictList = (List) params.remove("verify_strict"); - - if ((verifyList != null && verifyList.size() >= 1) || (verifyStrictList != null && verifyStrictList.size() >= 1)) { - url += "?"; - - if (verifyList != null && verifyList.size() >= 1) { - for (String verification : verifyList) { - url += "verify[]=" + verification + "&"; - } - } - - if (verifyStrictList != null && verifyStrictList.size() >= 1) { - for (String strictVerification : verifyStrictList) { - url += "verify_strict[]=" + strictVerification + "&"; - } - } - } - - Map wrappedParams = new HashMap(); - wrappedParams.put("address", params); - - return request(RequestMethod.POST, url, wrappedParams, Address.class, apiKey); - } - - // retrieve - public static Address retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Address retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Address.class, id), null, Address.class, apiKey); - } - - // all - public static AddressCollection all(Map params) throws EasyPostException { - return all(params, null); - } - public static AddressCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(Address.class), params, AddressCollection.class, apiKey); - } - - // createAndVerify - public static Address createAndVerify(Map params) throws EasyPostException { - return createAndVerify(params, null); - } - public static Address createAndVerify(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("address", params); - - AddressVerifyResponse response; - response = request(RequestMethod.POST, String.format("%s/create_and_verify", classURL(Address.class)), wrappedParams, AddressVerifyResponse.class, apiKey); - - if (response.message != null) { - response.address.message = response.message; - } - return response.address; - } - - // createAndVerifyWithCarrier - public static Address createAndVerifyWithCarrier(Map params, String carrier) throws EasyPostException { - return createAndVerifyWithCarrier(params, carrier, null); - } - public static Address createAndVerifyWithCarrier(Map params, String carrier, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("address", params); - wrappedParams.put("carrier", carrier); - - AddressVerifyResponse response; - response = request(RequestMethod.POST, String.format("%s/create_and_verify", classURL(Address.class)), wrappedParams, AddressVerifyResponse.class, apiKey); - - if (response.message != null) { - response.address.message = response.message; - } - return response.address; - } - - // verify - public Address verify() throws EasyPostException { - return this.verify(null); - } - public Address verify(String apiKey) throws EasyPostException { - AddressVerifyResponse response; - response = request(RequestMethod.GET, String.format("%s/verify", instanceURL(Address.class, this.getId())), null, AddressVerifyResponse.class, apiKey); - - if (response.message != null) { - response.address.message = response.message; - } - return response.address; - } - - // verifyWithCarrier - public Address verifyWithCarrier(String carrier) throws EasyPostException { - return this.verifyWithCarrier(carrier, null); - } - public Address verifyWithCarrier(String carrier, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("carrier", carrier); - - AddressVerifyResponse response; - response = request(RequestMethod.GET, String.format("%s/verify", instanceURL(Address.class, this.getId())), null, AddressVerifyResponse.class, apiKey); - - if (response.message != null) { - response.address.message = response.message; - } - return response.address; - } - +import lombok.Getter; + +@Getter +public final class Address extends BaseAddress { + private String message; + private String carrierFacility; + private String federalTaxId; + private Boolean residential; + private AddressVerifications verifications; } diff --git a/src/main/java/com/easypost/model/AddressCollection.java b/src/main/java/com/easypost/model/AddressCollection.java index 96816ee17..0073ef07b 100644 --- a/src/main/java/com/easypost/model/AddressCollection.java +++ b/src/main/java/com/easypost/model/AddressCollection.java @@ -1,22 +1,25 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; +import java.util.Map; -public class AddressCollection extends EasyPostResource { - List addresses; - Boolean hasMore; +import lombok.Getter; - public List getAddresses() { - return addresses; - } - public void setAddresses(List addresses) { - this.addresses = addresses; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } +@Getter +public final class AddressCollection extends PaginatedCollection
{ + private List
addresses; + + @Override + protected Map buildNextPageParameters(List
addresses, Integer pageSize) { + String lastId = addresses.get(addresses.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; + } } diff --git a/src/main/java/com/easypost/model/AddressDetail.java b/src/main/java/com/easypost/model/AddressDetail.java index a4730448f..42bc84cd2 100644 --- a/src/main/java/com/easypost/model/AddressDetail.java +++ b/src/main/java/com/easypost/model/AddressDetail.java @@ -1,31 +1,10 @@ package com.easypost.model; -public class AddressDetail { - Float latitude; - Float longitude; - String timeZone; +import lombok.Getter; - public Float getLatitude() { - return latitude; - } - - public void setLatitude(Float latitude) { - this.latitude = latitude; - } - - public Float getLongitude() { - return longitude; - } - - public void setLongitude(Float longitude) { - this.longitude = longitude; - } - - public String getTimeZone() { - return timeZone; - } - - public void setCode(String timeZone) { - this.timeZone = timeZone; - } +@Getter +public final class AddressDetail { + private Float latitude; + private Float longitude; + private String timeZone; } diff --git a/src/main/java/com/easypost/model/AddressVerification.java b/src/main/java/com/easypost/model/AddressVerification.java index ec7bed991..4853b3d82 100644 --- a/src/main/java/com/easypost/model/AddressVerification.java +++ b/src/main/java/com/easypost/model/AddressVerification.java @@ -1,33 +1,38 @@ package com.easypost.model; import java.util.List; - -public class AddressVerification { - Boolean success; - List errors; - AddressDetail details; - - public Boolean getSuccess() { - return success; - } - - public void setSuccess(Boolean success) { - this.success = success; - } - - public List getErrors() { - return errors; - } - - public void setErrors(List errors) { - this.errors = errors; - } - - public AddressDetail getAddressDetail() { - return details; - } - - public void setAddressDetail(AddressDetail details) { - this.details = details; - } +import lombok.Getter; + +@Getter +public final class AddressVerification { + private Boolean success; + private List errors; + private AddressDetail details; + + /** + * Set the success of this address verification object. + * + * @param success The success message. + */ + void setSuccess(final boolean success) { + this.success = success; + } + + /** + * Set the errors of this address verification object. + * + * @param errors The errors. + */ + void setErrors(final List errors) { + this.errors = errors; + } + + /** + * Set the details of this address verification object. + * + * @param details The details. + */ + void setDetails(final AddressDetail details) { + this.details = details; + } } diff --git a/src/main/java/com/easypost/model/AddressVerificationDeserializer.java b/src/main/java/com/easypost/model/AddressVerificationDeserializer.java new file mode 100644 index 000000000..2986edd44 --- /dev/null +++ b/src/main/java/com/easypost/model/AddressVerificationDeserializer.java @@ -0,0 +1,74 @@ +package com.easypost.model; + +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import java.lang.reflect.Type; +import java.util.ArrayList; + +public final class AddressVerificationDeserializer implements JsonDeserializer { + /** + * Deserialize an AddressVerification from a JSON object. + * + * @param json JSON object to deserialize. + * @param typeOfT Type of the object to deserialize. + * @param context Deserialization context. + * @return Deserialized AddressVerification object. + * @throws JsonParseException if the JSON object is not a valid + * SmartRateCollection. + */ + @Override + public AddressVerification deserialize(final JsonElement json, final Type typeOfT, + final JsonDeserializationContext context) throws JsonParseException { + JsonObject jo = json.getAsJsonObject(); + + AddressVerification addressVerification = new AddressVerification(); + + boolean success = jo.get("success").getAsBoolean(); + addressVerification.setSuccess(success); + + AddressDetail details = context.deserialize(jo.get("details"), AddressDetail.class); + addressVerification.setDetails(details); + + JsonElement errorsAsJson = jo.get("errors"); + + if (errorsAsJson != null) { + JsonArray errorsAsArray = errorsAsJson.getAsJsonArray(); + ArrayList errors = new ArrayList<>(); + for (JsonElement errorAsJson : errorsAsArray) { + JsonObject errorAsJsonObject = errorAsJson.getAsJsonObject(); + + AddressVerificationFieldError error = new AddressVerificationFieldError(); + + JsonElement code = errorAsJsonObject.get("code"); + if (code != null) { + error.setCode(code.getAsString()); + } + + JsonElement message = errorAsJsonObject.get("message"); + if (message != null) { + error.setMessage(message.getAsString()); + } + + JsonElement field = errorAsJsonObject.get("field"); + if (field != null) { + error.setField(field.getAsString()); + } + + JsonElement suggestion = errorAsJsonObject.get("suggestion"); + if (suggestion != null && !suggestion.isJsonNull()) { + error.setSuggestion(suggestion.getAsString()); + } + + errors.add(error); + } + addressVerification.setErrors(errors); + } + + return addressVerification; + } +} diff --git a/src/main/java/com/easypost/model/AddressVerificationFieldError.java b/src/main/java/com/easypost/model/AddressVerificationFieldError.java new file mode 100644 index 000000000..64b9e86dc --- /dev/null +++ b/src/main/java/com/easypost/model/AddressVerificationFieldError.java @@ -0,0 +1,47 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public final class AddressVerificationFieldError { + private String message; + private String code; + private String field; + private String suggestion; + + /** + * Set the message of this error object. + * + * @param message The error message. + */ + void setMessage(final String message) { + this.message = message; + } + + /** + * Set the code of this error object. + * + * @param code The code. + */ + void setCode(final String code) { + this.code = code; + } + + /** + * Set the field of this error object. + * + * @param field The field. + */ + void setField(final String field) { + this.field = field; + } + + /** + * Set the suggestion of this error object. + * + * @param suggestion The suggestion. + */ + void setSuggestion(final String suggestion) { + this.suggestion = suggestion; + } +} diff --git a/src/main/java/com/easypost/model/AddressVerifications.java b/src/main/java/com/easypost/model/AddressVerifications.java new file mode 100644 index 000000000..728cb772e --- /dev/null +++ b/src/main/java/com/easypost/model/AddressVerifications.java @@ -0,0 +1,9 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class AddressVerifications extends EasyPostResource { + private AddressVerification zip4; + private AddressVerification delivery; +} diff --git a/src/main/java/com/easypost/model/AddressVerifyResponse.java b/src/main/java/com/easypost/model/AddressVerifyResponse.java index 4731fe22d..ecae424c8 100644 --- a/src/main/java/com/easypost/model/AddressVerifyResponse.java +++ b/src/main/java/com/easypost/model/AddressVerifyResponse.java @@ -1,20 +1,9 @@ package com.easypost.model; -public class AddressVerifyResponse { - Address address; - String message; - - public Address getAddress() { - return address; - } - public void setAddress(Address address) { - this.address = address; - } +import lombok.Getter; - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } -} \ No newline at end of file +@Getter +public class AddressVerifyResponse { + private Address address; + private String message; +} diff --git a/src/main/java/com/easypost/model/AiResults.java b/src/main/java/com/easypost/model/AiResults.java new file mode 100644 index 000000000..8bfbdcd1a --- /dev/null +++ b/src/main/java/com/easypost/model/AiResults.java @@ -0,0 +1,14 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public final class AiResults { + private String carrier; + private Boolean meetsRulesetRequirements; + private String predictedDeliverByDate; + private Integer predictedDeliverDays; + private String rateId; + private String rateUsd; + private String service; +} diff --git a/src/main/java/com/easypost/model/ApiKey.java b/src/main/java/com/easypost/model/ApiKey.java index c11799b8f..f02f808c2 100644 --- a/src/main/java/com/easypost/model/ApiKey.java +++ b/src/main/java/com/easypost/model/ApiKey.java @@ -1,15 +1,9 @@ package com.easypost.model; -import com.easypost.net.EasyPostResource; +import lombok.Getter; -public class ApiKey extends EasyPostResource { - String mode; - String key; - - public String getMode() { return mode; } - public void setMode(String mode) { this.mode = mode; } - - public String getKey() { return key; } - public void setKey(String key) { this.key = key; } +@Getter +public final class ApiKey extends EasyPostResource { + private String key; + private Boolean active; } - diff --git a/src/main/java/com/easypost/model/ApiKeys.java b/src/main/java/com/easypost/model/ApiKeys.java index 22c6c6b47..d5da4da0c 100644 --- a/src/main/java/com/easypost/model/ApiKeys.java +++ b/src/main/java/com/easypost/model/ApiKeys.java @@ -1,34 +1,10 @@ package com.easypost.model; import java.util.List; -import java.util.Map; -import java.util.HashMap; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class ApiKeys extends EasyPostResource { - public String id; - List keys; - List children; - - public String getId() { return id; } - public void setId(String id) { this.id = id; } - - public List getKeys() { return keys; } - public void setKeys(List keys) { this.keys = keys; } - - public List getChildren() { return children; } - public void setChildren(List children) { this.children = children; } - - // all - public static ApiKeys all() throws EasyPostException { - return all(null); - } - public static ApiKeys all(String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(ApiKey.class), null, ApiKeys.class, apiKey); - } +import lombok.Getter; +@Getter +public final class ApiKeys extends EasyPostResource { + private List keys; + private List children; } - - diff --git a/src/main/java/com/easypost/model/BaseAddress.java b/src/main/java/com/easypost/model/BaseAddress.java new file mode 100644 index 000000000..9c387d4ef --- /dev/null +++ b/src/main/java/com/easypost/model/BaseAddress.java @@ -0,0 +1,17 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class BaseAddress extends EasyPostResource { + private String name; + private String company; + private String street1; + private String street2; + private String city; + private String state; + private String zip; + private String country; + private String phone; + private String email; +} diff --git a/src/main/java/com/easypost/model/BaseUser.java b/src/main/java/com/easypost/model/BaseUser.java new file mode 100644 index 000000000..4ccffa8d9 --- /dev/null +++ b/src/main/java/com/easypost/model/BaseUser.java @@ -0,0 +1,25 @@ +package com.easypost.model; + +import java.util.List; +import lombok.Getter; + +@Getter +public class BaseUser extends EasyPostResource { + private String name; + private String email; + private String phoneNumber; + private String balance; + private String rechargeAmount; + private String secondaryRechargeAmount; + private String rechargeThreshold; + private String parentId; + private boolean verified; + private String pricePerShipment; + private boolean hasBillingMethod; + private String ccFeeRate; + private String defaultInsuranceAmount; + private String insuranceFeeRate; + private String insuranceFeeMinimum; + private List children; + private List apiKeys; +} diff --git a/src/main/java/com/easypost/model/Batch.java b/src/main/java/com/easypost/model/Batch.java index a3fc012db..9c810fb57 100644 --- a/src/main/java/com/easypost/model/Batch.java +++ b/src/main/java/com/easypost/model/Batch.java @@ -1,214 +1,15 @@ package com.easypost.model; import java.util.List; -import java.util.Map; -import java.util.HashMap; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Batch extends EasyPostResource { - public String id; - String mode; - String state; - public BatchStatus status; - Number numShipments; - List shipments; - String labelUrl; - ScanForm scanForm; - String reference; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } - - public String getState() { - return state; - } - public void setState(String state) { - this.state = state; - } - - public Number getNumShipments() { - return numShipments; - } - public void setNumShipments(Number numShipments) { - this.numShipments = numShipments; - } - - public List getShipments() { - return shipments; - } - public void setShipments(List shipments) { - this.shipments = shipments; - } - - public String getLabelUrl() { - return labelUrl; - } - public void setLabelUrl(String labelUrl) { - this.labelUrl = labelUrl; - } - - public ScanForm getScanForm() { - return scanForm; - } - public void setScanForm(ScanForm scanForm) { - this.scanForm = scanForm; - } - - public String getReference() { - return reference; - } - public void setReference(String reference) { - this.reference = reference; - } - - - // create - public static Batch create() throws EasyPostException { - return create(null, null); - } - public static Batch create(Map params) throws EasyPostException { - return create(params, null); - } - public static Batch create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("batch", params); - - return request(RequestMethod.POST, classURL(Batch.class), wrappedParams, Batch.class, apiKey); - } - - // retrieve - public static Batch retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Batch retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Batch.class, id), null, Batch.class, apiKey); - } - - // all - public static BatchCollection all(Map params) throws EasyPostException { - return all(params, null); - } - public static BatchCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(Batch.class), params, BatchCollection.class, apiKey); - } - - // create_and_buy - public static Batch create_and_buy(Map params) throws EasyPostException { - return create_and_buy(params, null); - } - public static Batch create_and_buy(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("batch", params); - - return request(RequestMethod.POST, classURL(Batch.class), wrappedParams, Batch.class, apiKey); - } - - // refresh - public Batch refresh() throws EasyPostException { - return this.refresh(null, null); - } - public Batch refresh(Map params) throws EasyPostException { - return this.refresh(params, null); - } - public Batch refresh(String apiKey) throws EasyPostException { - return this.refresh((Map) null, apiKey); - } - public Batch refresh(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.GET, - String.format("%s", instanceURL(Batch.class, this.getId())), params, Batch.class, apiKey); - } - - // label - public Batch label() throws EasyPostException { - return this.label(null, null); - } - public Batch label(Map params) throws EasyPostException { - return this.label(params, null); - } - public Batch label(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.POST, - String.format("%s/label", instanceURL(Batch.class, this.getId())), params, Batch.class, apiKey); - } - - // add_shipments - public Batch addShipments(List shipments) throws EasyPostException { - Map params = new HashMap(); - params.put("shipments", shipments); - return this.addShipments(params, null); - } - public Batch addShipments(List shipments, String apiKey) throws EasyPostException { - Map params = new HashMap(); - params.put("shipments", shipments); - return this.addShipments(params, apiKey); - } - public Batch addShipments(Map params) throws EasyPostException { - return this.addShipments(params, null); - } - public Batch addShipments(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.POST, - String.format("%s/add_shipments", instanceURL(Batch.class, this.getId())), params, Batch.class, apiKey); - } - - // remove_shipments - public Batch removeShipments(List shipments) throws EasyPostException { - Map params = new HashMap(); - params.put("shipments", shipments); - return this.removeShipments(params, null); - } - public Batch removeShipments(List shipments, String apiKey) throws EasyPostException { - Map params = new HashMap(); - params.put("shipments", shipments); - return this.removeShipments(params, apiKey); - } - public Batch removeShipments(Map params) throws EasyPostException { - return this.removeShipments(params, null); - } - public Batch removeShipments(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.POST, - String.format("%s/remove_shipments", instanceURL(Batch.class, this.getId())), params, Batch.class, apiKey); - } - - // buy - public Batch buy() throws EasyPostException { - return this.buy(null, null); - } - public Batch buy(Map params) throws EasyPostException { - return this.buy(params, null); - } - public Batch buy(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.POST, - String.format("%s/buy", instanceURL(Batch.class, this.getId())), params, Batch.class, apiKey); - } - - // create_scan_form - public Batch createScanForm() throws EasyPostException { - return this.createScanForm(null, null); - } - public Batch createScanForm(Map params) throws EasyPostException { - return this.createScanForm(params, null); - } - public Batch createScanForm(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.POST, - String.format("%s/scan_form", instanceURL(Batch.class, this.getId())), params, Batch.class, apiKey); - } - +import lombok.Getter; + +@Getter +public final class Batch extends EasyPostResource { + private String state; + private BatchStatus status; + private Number numShipments; + private List shipments; + private String labelUrl; + private ScanForm scanForm; + private String reference; } diff --git a/src/main/java/com/easypost/model/BatchCollection.java b/src/main/java/com/easypost/model/BatchCollection.java index dd63476f8..578c34fd3 100644 --- a/src/main/java/com/easypost/model/BatchCollection.java +++ b/src/main/java/com/easypost/model/BatchCollection.java @@ -1,22 +1,18 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; +import java.util.Map; -public class BatchCollection extends EasyPostResource { - List batches; - Boolean hasMore; +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; - public List getBatches() { - return batches; - } - public void setBatches(List batches) { - this.batches = batches; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } +@Getter +public final class BatchCollection extends PaginatedCollection { + private List batches; + + @Override + protected Map buildNextPageParameters(List batches, Integer pageSize) + throws EndOfPaginationError { + throw new EndOfPaginationError(); + } } diff --git a/src/main/java/com/easypost/model/BatchStatus.java b/src/main/java/com/easypost/model/BatchStatus.java index 6f3afe614..4cbea4d3b 100644 --- a/src/main/java/com/easypost/model/BatchStatus.java +++ b/src/main/java/com/easypost/model/BatchStatus.java @@ -1,36 +1,11 @@ package com.easypost.model; -public class BatchStatus { - int created; - int creationFailed; - int postagePurchased; - int postagePurchaseFailed; - - public int getCreated() { - return created; - } - public void setCreated(int created) { - this.created = created; - } - - public int getCreationFailed() { - return creationFailed; - } - public void setCreationFailed(int creationFailed) { - this.creationFailed = creationFailed; - } - - public int getPostagePurchased() { - return postagePurchased; - } - public void setPostagePurchased(int postagePurchased) { - this.postagePurchased = postagePurchased; - } - - public int getPostagePurchaseFailed() { - return postagePurchaseFailed; - } - public void setPostagePurchaseFailed(int postagePurchaseFailed) { - this.postagePurchaseFailed = postagePurchaseFailed; - } +import lombok.Getter; + +@Getter +public final class BatchStatus { + private int created; + private int creationFailed; + private int postagePurchased; + private int postagePurchaseFailed; } diff --git a/src/main/java/com/easypost/model/BetaPaymentRefund.java b/src/main/java/com/easypost/model/BetaPaymentRefund.java new file mode 100644 index 000000000..3dc22709f --- /dev/null +++ b/src/main/java/com/easypost/model/BetaPaymentRefund.java @@ -0,0 +1,13 @@ +package com.easypost.model; + +import java.util.List; +import lombok.Getter; + +@Getter +public class BetaPaymentRefund extends EasyPostResource{ + private int refundedAmount; + private List errors; + private List refundedPaymentLogs; + private String paymentLogId; + private String refundedAmountCurrencys; +} diff --git a/src/main/java/com/easypost/model/Billing.java b/src/main/java/com/easypost/model/Billing.java new file mode 100644 index 000000000..6d20d4f16 --- /dev/null +++ b/src/main/java/com/easypost/model/Billing.java @@ -0,0 +1,4 @@ +package com.easypost.model; + +public final class Billing extends EasyPostResource { +} diff --git a/src/main/java/com/easypost/model/Brand.java b/src/main/java/com/easypost/model/Brand.java new file mode 100644 index 000000000..1b2525770 --- /dev/null +++ b/src/main/java/com/easypost/model/Brand.java @@ -0,0 +1,16 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class Brand extends EasyPostResource { + private String backgroundColor; + private String color; + private String logo; + private String logoHref; + private String ad; + private String adHref; + private String name; + private String userID; + private String theme; +} diff --git a/src/main/java/com/easypost/model/CarrierAccount.java b/src/main/java/com/easypost/model/CarrierAccount.java index 63f6c241b..124b707eb 100644 --- a/src/main/java/com/easypost/model/CarrierAccount.java +++ b/src/main/java/com/easypost/model/CarrierAccount.java @@ -1,97 +1,18 @@ package com.easypost.model; -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -import java.util.Arrays; -import java.util.HashMap; import java.util.Map; -import java.util.List; - -public class CarrierAccount extends EasyPostResource { - public String id; - String readable; - String description; - String reference; - Map credentials; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getReadable() { return readable; } - public void setReadable(String readable) { this.readable = readable; } - - public String getDescription() { return description; } - public void setDescription(String description) { this.description = description; } - - public String getReference() { - return reference; - } - public void setReference(String reference) { - this.reference = reference; - } - - public Map getCredentials() { - return credentials; - } - public void setCredentials(Map credentials) { - this.credentials = credentials; - } - - // update - public CarrierAccount update(Map params) throws EasyPostException { - return this.update(params, null); - } - public CarrierAccount update(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("carrier_account", params); - - CarrierAccount response = request(RequestMethod.PUT, instanceURL(CarrierAccount.class, this.getId()), wrappedParams, CarrierAccount.class, apiKey); - - this.merge(this, response); - return this; - } - - // delete - public void delete() throws EasyPostException { - this.delete(null); - } - public void delete(String apiKey) throws EasyPostException { - request(RequestMethod.DELETE, instanceURL(CarrierAccount.class, this.getId()), null, CarrierAccount.class, apiKey); - } - - // create - public static CarrierAccount create(Map params) throws EasyPostException { - return create(params, null); - } - public static CarrierAccount create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("carrier_account", params); - - return request(RequestMethod.POST, classURL(CarrierAccount.class), wrappedParams, CarrierAccount.class, apiKey); - } - - // retrieve - public static CarrierAccount retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static CarrierAccount retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(CarrierAccount.class, id), null, CarrierAccount.class, apiKey); - } - - // all - public static List all(Map params) throws EasyPostException { - return all(params, null); - } - public static List all(Map params, String apiKey) throws EasyPostException { - CarrierAccount[] response = request(RequestMethod.GET, classURL(CarrierAccount.class), params, CarrierAccount[].class, apiKey); - return Arrays.asList(response); - } - - - - } +import lombok.Getter; + +@Getter +public final class CarrierAccount extends EasyPostResource { + private String type; + private Fields fields; + private boolean clone; + private String logo; + private String readable; + private String description; + private String reference; + private String billingType; + private Map credentials; + private Map testCredentials; +} diff --git a/src/main/java/com/easypost/model/CarrierDetail.java b/src/main/java/com/easypost/model/CarrierDetail.java index 64c45814a..33096275c 100644 --- a/src/main/java/com/easypost/model/CarrierDetail.java +++ b/src/main/java/com/easypost/model/CarrierDetail.java @@ -1,60 +1,16 @@ package com.easypost.model; -public class CarrierDetail { - String service; - String containerType; - String estDeliveryDateLocal; - String estDeliveryTimeLocal; - String originLocation; - String destinationLocation; - String guaranteedDeliveryDate; - String alternateIdentifier; - String initialDeliveryAttempt; - - public String getService() { return service; } - public void setService(String service) { this.service = service; } - - public String getContainerType() { return containerType; } - public void setContainerType(String containerType) { this.containerType = containerType; } - - public String getEstDeliveryDateLocal() { return estDeliveryDateLocal; } - public void setEstDeliveryDateLocal(String estDeliveryDateLocal) { this.estDeliveryDateLocal = estDeliveryDateLocal; } - - public String getEstDeliveryTimeLocal() { return estDeliveryTimeLocal; } - public void setEstDeliveryTimeLocal(String estDeliveryTimeLocal) { this.estDeliveryTimeLocal = estDeliveryTimeLocal; } - - public String getOriginLocation() { - return originLocation; - } - public void setOriginLocation(String originLocation) { - this.originLocation = originLocation; - } - - public String getDestinationLocation() { - return destinationLocation; - } - public void setDestinationLocation(String destinationLocation) { - this.destinationLocation = destinationLocation; - } - - public String getGuaranteedDeliveryDate() { - return guaranteedDeliveryDate; - } - public void setGuaranteedDeliveryDate(String guaranteedDeliveryDate) { - this.guaranteedDeliveryDate = guaranteedDeliveryDate; - } - - public String getAlternateIdentifier() { - return alternateIdentifier; - } - public void setAlternateIdentifier(String alternateIdentifier) { - this.alternateIdentifier = alternateIdentifier; - } - - public String getInitialDeliveryAttempt() { - return initialDeliveryAttempt; - } - public void setInitialDeliveryAttempt(String initialDeliveryAttempt) { - this.initialDeliveryAttempt = initialDeliveryAttempt; - } +import lombok.Getter; + +@Getter +public final class CarrierDetail { + private String service; + private String containerType; + private String estDeliveryDateLocal; + private String estDeliveryTimeLocal; + private String originLocation; + private String destinationLocation; + private String guaranteedDeliveryDate; + private String alternateIdentifier; + private String initialDeliveryAttempt; } diff --git a/src/main/java/com/easypost/model/CarrierMetadata.java b/src/main/java/com/easypost/model/CarrierMetadata.java new file mode 100644 index 000000000..6b9b7a025 --- /dev/null +++ b/src/main/java/com/easypost/model/CarrierMetadata.java @@ -0,0 +1,58 @@ +package com.easypost.model; + +import java.util.List; + +import lombok.Getter; + +@Getter +public class CarrierMetadata extends EasyPostResource { + private List carriers; + + @Getter + public static class Carrier { + private String name; + private String humanReadable; + private List predefinedPackages; + private List serviceLevels; + private List shipmentOptions; + private List supportedFeatures; + } + + @Getter + public static class PredefinedPackage { + private String carrier; + private String description; + private List dimensions; + private String humanReadable; + private String maxWeight; + private String name; + } + + @Getter + public static class ServiceLevels { + private String carrier; + private String description; + private List dimensions; + private String humanReadable; + private String maxWeight; + private String name; + } + + @Getter + public static class ShipmentOption { + private String carrier; + private boolean deprecated; + private String description; + private String humanReadable; + private String name; + private String type; + } + + @Getter + public static class SupportedFeatures { + private String carrier; + private String description; + private String name; + private String supported; + } +} diff --git a/src/main/java/com/easypost/model/CarrierType.java b/src/main/java/com/easypost/model/CarrierType.java new file mode 100644 index 000000000..45b5ac89c --- /dev/null +++ b/src/main/java/com/easypost/model/CarrierType.java @@ -0,0 +1,12 @@ +package com.easypost.model; + +import java.util.Map; +import lombok.Getter; + +@Getter +public final class CarrierType extends EasyPostResource { + private String type; + private String readable; + private String logo; + private Map fields; +} diff --git a/src/main/java/com/easypost/model/ChildUserCollection.java b/src/main/java/com/easypost/model/ChildUserCollection.java new file mode 100644 index 000000000..f0e5027bb --- /dev/null +++ b/src/main/java/com/easypost/model/ChildUserCollection.java @@ -0,0 +1,25 @@ +package com.easypost.model; + +import java.util.List; +import java.util.Map; + +import lombok.Getter; + +@Getter +public final class ChildUserCollection extends PaginatedCollection { + private List children; + + @Override + protected Map buildNextPageParameters(List children, Integer pageSize) { + String lastId = children.get(children.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("after_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; + } +} diff --git a/src/main/java/com/easypost/model/Claim.java b/src/main/java/com/easypost/model/Claim.java new file mode 100644 index 000000000..1a55950bf --- /dev/null +++ b/src/main/java/com/easypost/model/Claim.java @@ -0,0 +1,27 @@ +package com.easypost.model; + +import java.util.Date; +import java.util.List; +import lombok.Getter; + +@Getter +public class Claim extends EasyPostResource { + private Date statusTimestamp; + private List history; + private String approvedAmount; + private String checkDeliveryAddress; + private String contactEmail; + private String description; + private String insuranceAmount; + private String insuranceId; + private String paymentMethod; + private String recipientName; + private String reference; + private String requestedAmount; + private String salvageValue; + private String shipmentId; + private String status; + private String statusDetail; + private String trackingCode; + private String type; +} diff --git a/src/main/java/com/easypost/model/ClaimCollection.java b/src/main/java/com/easypost/model/ClaimCollection.java new file mode 100644 index 000000000..de842214c --- /dev/null +++ b/src/main/java/com/easypost/model/ClaimCollection.java @@ -0,0 +1,34 @@ +package com.easypost.model; + +import java.util.List; +import java.util.Map; + +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class ClaimCollection extends PaginatedCollection { + private List claims; + + @Setter + private String type; + private String status; + + @Override + protected Map buildNextPageParameters(List claims, Integer pageSize) + throws EndOfPaginationError { + String lastId = claims.get(claims.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + parameters.put("type", type); + parameters.put("status", status); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; + } +} diff --git a/src/main/java/com/easypost/model/ClaimHistoryEntry.java b/src/main/java/com/easypost/model/ClaimHistoryEntry.java new file mode 100644 index 000000000..6083dc1ee --- /dev/null +++ b/src/main/java/com/easypost/model/ClaimHistoryEntry.java @@ -0,0 +1,11 @@ +package com.easypost.model; + +import java.util.Date; +import lombok.Getter; + +@Getter +public class ClaimHistoryEntry { + private String status; + private String statusDetail; + private Date statusTimestamp; +} diff --git a/src/main/java/com/easypost/model/ClientSecret.java b/src/main/java/com/easypost/model/ClientSecret.java new file mode 100644 index 000000000..cde3d932e --- /dev/null +++ b/src/main/java/com/easypost/model/ClientSecret.java @@ -0,0 +1,8 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public final class ClientSecret { + private String clientSecret; +} diff --git a/src/main/java/com/easypost/model/CustomerPortalAccountLink.java b/src/main/java/com/easypost/model/CustomerPortalAccountLink.java new file mode 100644 index 000000000..73687d126 --- /dev/null +++ b/src/main/java/com/easypost/model/CustomerPortalAccountLink.java @@ -0,0 +1,12 @@ +package com.easypost.model; + +import java.util.Date; +import lombok.Getter; + +@Getter +public class CustomerPortalAccountLink { + private String object; + private String link; + private Date createdAt; + private Date expiresAt; +} diff --git a/src/main/java/com/easypost/model/CustomsInfo.java b/src/main/java/com/easypost/model/CustomsInfo.java index 6d9678e02..79f8f5a88 100644 --- a/src/main/java/com/easypost/model/CustomsInfo.java +++ b/src/main/java/com/easypost/model/CustomsInfo.java @@ -1,104 +1,18 @@ package com.easypost.model; import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class CustomsInfo extends EasyPostResource { - public String id; - String contentsType; - String contentsExplanation; - boolean customsCertify; - String customsSigner; - String nonDeliveryOption; - String restrictionType; - String restrictionComments; - List customsItems; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getContentsType() { - return contentsType; - } - public void setContentsType(String contentsType) { - this.contentsType = contentsType; - } - - public String getContentsExplanation() { - return contentsExplanation; - } - public void setContentsExplanation(String contentsExplanation) { - this.contentsExplanation = contentsExplanation; - } - - public boolean getCustomsCertify() { - return customsCertify; - } - public void setCustomsCertify(boolean customsCertify) { - this.customsCertify = customsCertify; - } - - public String getCustomsSigner() { - return customsSigner; - } - public void setCustomsSigner(String customsSigner) { - this.customsSigner = customsSigner; - } - - public String getNonDeliveryOption() { - return nonDeliveryOption; - } - public void setNonDeliveryOption(String nonDeliveryOption) { - this.nonDeliveryOption = nonDeliveryOption; - } - - public String getRestrictionType() { - return restrictionType; - } - public void setRestrictionType(String restrictionType) { - this.restrictionType = restrictionType; - } - - public String getRestrictionComments() { - return restrictionComments; - } - public void setRestrictionComments(String restrictionComments) { - this.restrictionComments = restrictionComments; - } - - public List getCustomsItems() { - return customsItems; - } - public void setCustomsItems(List customsItems) { - this.customsItems = customsItems; - } - - - // create - public static CustomsInfo create(Map params) throws EasyPostException { - return create(params, null); - } - public static CustomsInfo create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("customs_info", params); - - return request(RequestMethod.POST, classURL(CustomsInfo.class), wrappedParams, CustomsInfo.class, apiKey); - } - - // retrieve - public static CustomsInfo retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static CustomsInfo retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(CustomsInfo.class, id), null, CustomsInfo.class, apiKey); - } - +import lombok.Getter; + +@Getter +public final class CustomsInfo extends EasyPostResource { + private String contentsType; + private String contentsExplanation; + private boolean customsCertify; + private String customsSigner; + private String nonDeliveryOption; + private String restrictionType; + private String restrictionComments; + private List customsItems; + private String eelPfc; + private String declaration; } diff --git a/src/main/java/com/easypost/model/CustomsItem.java b/src/main/java/com/easypost/model/CustomsItem.java index 5d161b9ff..a0308becb 100644 --- a/src/main/java/com/easypost/model/CustomsItem.java +++ b/src/main/java/com/easypost/model/CustomsItem.java @@ -1,104 +1,15 @@ package com.easypost.model; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class CustomsItem extends EasyPostResource { - public String id; - String description; - String hsTariffNumber; - String originCountry; - int quantity; - Float value; - Float weight; - String code; - String currency; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - - public String getHsTariffNumber() { - return hsTariffNumber; - } - public void setHsTariffNumber(String hsTariffNumber) { - this.hsTariffNumber = hsTariffNumber; - } - - public String getOriginCountry() { - return originCountry; - } - public void setOriginCountry(String originCountry) { - this.originCountry = originCountry; - } - - public int getQuantity() { - return quantity; - } - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public Float getValue() { - return value; - } - public void setValue(Float value) { - this.value = value; - } - - public Float getWeight() { - return weight; - } - public void setWeight(Float weight) { - this.weight = weight; - } - - public String getCode() { - return code; - } - public void setCode(String code) { - this.code = code; - } - - public String getCurrency() { - return currency; - } - public void setCurrency(String currency) { - this.currency = currency; - } - - - // create - public static CustomsItem create(Map params) throws EasyPostException { - return create(params, null); - } - public static CustomsItem create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("customs_item", params); - - return request(RequestMethod.POST, classURL(CustomsItem.class), wrappedParams, CustomsItem.class, apiKey); - } - - // retrieve - public static CustomsItem retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static CustomsItem retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(CustomsItem.class, id), null, CustomsItem.class, apiKey); - } - +import lombok.Getter; + +@Getter +public final class CustomsItem extends EasyPostResource { + private String description; + private String hsTariffNumber; + private String originCountry; + private int quantity; + private Float value; + private Float weight; + private String code; + private String currency; } diff --git a/src/main/java/com/easypost/model/DeliveryDateForZipPairEstimate.java b/src/main/java/com/easypost/model/DeliveryDateForZipPairEstimate.java new file mode 100644 index 000000000..4a72f5a18 --- /dev/null +++ b/src/main/java/com/easypost/model/DeliveryDateForZipPairEstimate.java @@ -0,0 +1,10 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class DeliveryDateForZipPairEstimate { + private String carrier; + private String service; + private TimeInTransitDetailsForDeliveryDate easypostTimeInTransitData; +} diff --git a/src/main/java/com/easypost/model/EasyPostResource.java b/src/main/java/com/easypost/model/EasyPostResource.java new file mode 100644 index 000000000..c8873a936 --- /dev/null +++ b/src/main/java/com/easypost/model/EasyPostResource.java @@ -0,0 +1,63 @@ +package com.easypost.model; + +import java.util.Date; + +import com.easypost.Constants; +import lombok.Getter; + +@Getter +public abstract class EasyPostResource { + private String id; + private String mode; + private String object; + private Date createdAt; + private Date updatedAt; + + /** + * Returns a string representation of the object. + * + * @return String of the object. + */ + @Override + public String toString() { + if (this.id == null) { + return String.format("<%s@%s>", this.getClass().getName(), System.identityHashCode(this)); + } + return String.format("<%s@%s id=%s>", this.getClass().getName(), System.identityHashCode(this), this.id); + } + + /** + * Pretty print the JSON representation of the object. + * + * @return the JSON representation of the object. + */ + public String prettyPrint() { + String identifier = this.toString(); + String json = Constants.Http.PRETTY_PRINT_GSON.toJson(this); + return String.format("%s JSON: %s", identifier, json); + } + + /** + * Override the hashCode method because it is needed when overriding equals(). + * + * @return The hashcode of current object. + */ + @Override + public int hashCode() { + return Constants.Http.GSON.toJson(this).hashCode(); + } + + /** + * Override the Equals method, convert objects to Json strings for comparison. + * + * @param object Object of any class. + * @return If two objects have the same properties. + */ + @Override + public boolean equals(Object object) { + String currentObject = Constants.Http.GSON.toJson(this); + String newObject = Constants.Http.GSON.toJson(object); + + return currentObject.equals(newObject); + } +} diff --git a/src/main/java/com/easypost/model/EasyPostTimeInTransitData.java b/src/main/java/com/easypost/model/EasyPostTimeInTransitData.java new file mode 100644 index 000000000..bd5bb7cda --- /dev/null +++ b/src/main/java/com/easypost/model/EasyPostTimeInTransitData.java @@ -0,0 +1,10 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class EasyPostTimeInTransitData { + private TimeInTransit daysInTransit; + private String easypostEstimatedDeliveryDate; + private String plannedShipDate; +} diff --git a/src/main/java/com/easypost/model/EmbeddablesSession.java b/src/main/java/com/easypost/model/EmbeddablesSession.java new file mode 100644 index 000000000..40f77fc2d --- /dev/null +++ b/src/main/java/com/easypost/model/EmbeddablesSession.java @@ -0,0 +1,12 @@ +package com.easypost.model; + +import java.util.Date; +import lombok.Getter; + +@Getter +public class EmbeddablesSession { + private String object; + private String sessionId; + private Date createdAt; + private Date expiresAt; +} diff --git a/src/main/java/com/easypost/model/EndShipper.java b/src/main/java/com/easypost/model/EndShipper.java new file mode 100644 index 000000000..4b7af078a --- /dev/null +++ b/src/main/java/com/easypost/model/EndShipper.java @@ -0,0 +1,4 @@ +package com.easypost.model; + +public final class EndShipper extends BaseAddress { +} diff --git a/src/main/java/com/easypost/model/EndShipperCollection.java b/src/main/java/com/easypost/model/EndShipperCollection.java new file mode 100644 index 000000000..05363bc4f --- /dev/null +++ b/src/main/java/com/easypost/model/EndShipperCollection.java @@ -0,0 +1,18 @@ +package com.easypost.model; + +import java.util.List; +import java.util.Map; + +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; + +@Getter +public final class EndShipperCollection extends PaginatedCollection { + private List endShippers; + + @Override + protected Map buildNextPageParameters(List endShippers, Integer pageSize) + throws EndOfPaginationError { + throw new EndOfPaginationError(); + } +} diff --git a/src/main/java/com/easypost/model/Error.java b/src/main/java/com/easypost/model/Error.java deleted file mode 100644 index 0922f7227..000000000 --- a/src/main/java/com/easypost/model/Error.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.easypost.model; - -public class Error { - String field; - String message; - String suggestion; - String code; - - public String getField() { - return field; - } - - public void setField(String field) { - this.field = field; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getSuggestion() { - return suggestion; - } - - public void setSuggestion(String suggestion) { - this.suggestion = suggestion; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } -} diff --git a/src/main/java/com/easypost/model/ErrorDeserializer.java b/src/main/java/com/easypost/model/ErrorDeserializer.java new file mode 100644 index 000000000..a2f0583de --- /dev/null +++ b/src/main/java/com/easypost/model/ErrorDeserializer.java @@ -0,0 +1,119 @@ +package com.easypost.model; + +import com.easypost.Constants; +import com.easypost.exception.APIException; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; + +public final class ErrorDeserializer implements JsonDeserializer { + /** + * Recursively traverse an error JSON element and its sub-element(s), and + * extracts all + * error string values found into the specified string list. + * + * @param element the JSON element to traverse + * @param messagesList the list of strings to append found values to + */ + private void traverseJsonElement(JsonElement element, ArrayList messagesList) { + if (element.isJsonPrimitive()) { + messagesList.add(element.getAsString()); + } else if (element.isJsonArray()) { + JsonArray array = element.getAsJsonArray(); + for (JsonElement arrayElement : array) { + traverseJsonElement(arrayElement, messagesList); + } + } else if (element.isJsonObject()) { + JsonObject object = element.getAsJsonObject(); + for (Entry entry : object.entrySet()) { + traverseJsonElement(entry.getValue(), messagesList); + } + } + } + + /** + * Deserialize an APIException from a JSON object. + * + * @param json JSON object to deserialize. + * @param typeOfT Type of the object to deserialize. + * @param context Deserialization context. + * @return Deserialized APIException object. + * @throws JsonParseException if the JSON object is not a valid + * SmartRateCollection. + */ + @Override + public APIException deserialize(final JsonElement json, final Type typeOfT, + final JsonDeserializationContext context) throws JsonParseException { + JsonObject jo = json.getAsJsonObject(); + + String message = null; + String code = null; + List errors = new ArrayList<>(); + + JsonElement errorResponse = jo.get("error"); + if (errorResponse == null) { + message = Constants.ErrorMessages.API_DID_NOT_RETURN_ERROR_DETAILS; + code = "NO RESPONSE CODE"; + return new APIException(message, code, null); + } + JsonObject errorData = errorResponse.getAsJsonObject(); + + JsonElement codeElement = errorData.get("code"); + if (codeElement != null) { + code = codeElement.getAsString(); + } + + JsonElement messageElement = errorData.get("message"); + if (messageElement != null) { + if (messageElement.isJsonPrimitive()) { + message = messageElement.getAsString(); + } else if (messageElement.isJsonObject() || messageElement.isJsonArray()) { + ArrayList messagesList = new ArrayList<>(); + traverseJsonElement(messageElement, messagesList); + message = String.join(", ", messagesList); + } else { + throw new JsonParseException("Invalid message format"); + } + } + + JsonElement errorsAsJson = errorData.get("errors"); + if (errorsAsJson != null) { + JsonArray errorsAsArray = errorsAsJson.getAsJsonArray(); + for (JsonElement errorAsJson : errorsAsArray) { + if (errorAsJson.isJsonObject()) { + JsonObject errorAsJsonObject = errorAsJson.getAsJsonObject(); + FieldError fieldError = new FieldError(); + + JsonElement field = errorAsJsonObject.get("field"); + if (field != null) { + fieldError.setField(field.getAsString()); + } + + JsonElement fieldMessage = errorAsJsonObject.get("message"); + if (fieldMessage != null) { + fieldError.setMessage(fieldMessage.getAsString()); + } + + JsonElement suggestion = errorAsJsonObject.get("suggestion"); + if (suggestion != null && !suggestion.isJsonNull()) { + fieldError.setSuggestion(suggestion.getAsString()); + } + + errors.add(fieldError); + } else { + errors.add(errorAsJson.getAsString()); + } + } + } + + return new APIException(message, code, errors); + } +} diff --git a/src/main/java/com/easypost/model/EstimateDeliveryDateForZipPairResult.java b/src/main/java/com/easypost/model/EstimateDeliveryDateForZipPairResult.java new file mode 100644 index 000000000..aa38c20a1 --- /dev/null +++ b/src/main/java/com/easypost/model/EstimateDeliveryDateForZipPairResult.java @@ -0,0 +1,14 @@ +package com.easypost.model; + +import java.util.List; +import lombok.Getter; + +@Getter +public class EstimateDeliveryDateForZipPairResult { + private Boolean saturdayDelivery; + private List results; + private List carriersWithoutTintEstimates; + private String desiredDeliveryDate; + private String fromZip; + private String toZip; +} diff --git a/src/main/java/com/easypost/model/EstimatedDeliveryDate.java b/src/main/java/com/easypost/model/EstimatedDeliveryDate.java new file mode 100644 index 000000000..563051411 --- /dev/null +++ b/src/main/java/com/easypost/model/EstimatedDeliveryDate.java @@ -0,0 +1,10 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class EstimatedDeliveryDate { + private EasyPostTimeInTransitData easypostTimeInTransitData; + private Rate rate; +} + diff --git a/src/main/java/com/easypost/model/EstimatedDeliveryDateResponse.java b/src/main/java/com/easypost/model/EstimatedDeliveryDateResponse.java new file mode 100644 index 000000000..1fdc1ca13 --- /dev/null +++ b/src/main/java/com/easypost/model/EstimatedDeliveryDateResponse.java @@ -0,0 +1,9 @@ +package com.easypost.model; + +import java.util.List; +import lombok.Getter; + +@Getter +public class EstimatedDeliveryDateResponse { + private List rates; +} diff --git a/src/main/java/com/easypost/model/Event.java b/src/main/java/com/easypost/model/Event.java index 57eccac48..4dc0a56cb 100644 --- a/src/main/java/com/easypost/model/Event.java +++ b/src/main/java/com/easypost/model/Event.java @@ -1,67 +1,15 @@ package com.easypost.model; +import java.util.List; import java.util.Map; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Event extends EasyPostResource { - public String id; - String description; - String mode; - EasyPostResource result; - Map previousAttributes; - - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } - - public EasyPostResource getResult() { - return result; - } - public void setResult(EasyPostResource result) { - this.result = result; - } - - public Map getPreviousAttributes() { - return previousAttributes; - } - public void setPreviousAttributes(Map previousAttributes) { - this.previousAttributes = previousAttributes; - } - - - public static Event retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - - public static EventCollection all(Map params) throws EasyPostException { - return all(params, null); - } - - public static Event retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Event.class, id), null, Event.class, apiKey); - } - - public static EventCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(Event.class), params, EventCollection.class, apiKey); - } +import lombok.Getter; + +@Getter +public final class Event extends EasyPostResource { + private String description; + private Map result; + private String status; + private Map previousAttributes; + private List pendingUrls; + private List completedUrls; } diff --git a/src/main/java/com/easypost/model/EventCollection.java b/src/main/java/com/easypost/model/EventCollection.java index 9ffb2554f..1c683d9f6 100644 --- a/src/main/java/com/easypost/model/EventCollection.java +++ b/src/main/java/com/easypost/model/EventCollection.java @@ -1,22 +1,27 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; +import java.util.Map; -public class EventCollection extends EasyPostResource { - List events; - Boolean hasMore; +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; - public List getEvents() { - return events; - } - public void setEvents(List events) { - this.events = events; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } +@Getter +public final class EventCollection extends PaginatedCollection { + private List events; + + @Override + protected Map buildNextPageParameters(List events, Integer pageSize) + throws EndOfPaginationError { + String lastId = events.get(events.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; + } } diff --git a/src/main/java/com/easypost/model/EventData.java b/src/main/java/com/easypost/model/EventData.java index 8f4f4334a..b2c490255 100644 --- a/src/main/java/com/easypost/model/EventData.java +++ b/src/main/java/com/easypost/model/EventData.java @@ -1,23 +1,9 @@ package com.easypost.model; import java.util.Map; -import com.easypost.net.EasyPostResource; +import lombok.Getter; -public class EventData extends EasyPostResource { - Map previousAttributes; - EasyPostResource object; - - public Map getPreviousAttributes() { - return previousAttributes; - } - public void setPreviousAttributes(Map previousAttributes) { - this.previousAttributes = previousAttributes; - } - - public EasyPostResource getObject() { - return object; - } - public void setObject(EasyPostResource object) { - this.object = object; - } +@Getter +public final class EventData extends EasyPostResource { + private Map previousAttributes; } diff --git a/src/main/java/com/easypost/model/EventDeserializer.java b/src/main/java/com/easypost/model/EventDeserializer.java deleted file mode 100644 index 6702a5b14..000000000 --- a/src/main/java/com/easypost/model/EventDeserializer.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.easypost.model; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.JsonPrimitive; -import com.easypost.net.EasyPostResource; -import com.easypost.model.Event; - -public class EventDeserializer implements JsonDeserializer { - - @SuppressWarnings("rawtypes") - static Map objectMap = new HashMap(); - static { - objectMap.put("Address", Address.class); - objectMap.put("Batch", Batch.class); - objectMap.put("CustomsInfo", CustomsInfo.class); - objectMap.put("CustomsItem", CustomsItem.class); - objectMap.put("Event", Event.class); - objectMap.put("Fee", Fee.class); - objectMap.put("Parcel", Parcel.class); - objectMap.put("PostageLabel", PostageLabel.class); - objectMap.put("Rate", Rate.class); - objectMap.put("Refund", Refund.class); - objectMap.put("ScanForm", ScanForm.class); - objectMap.put("Shipment", Shipment.class); - objectMap.put("Tracker", Tracker.class); - objectMap.put("TrackingDetail", TrackingDetail.class); - objectMap.put("Webhook", Webhook.class); - } - - private Object deserializeJsonPrimitive(JsonPrimitive element) { - if (element.isBoolean()) { - return element.getAsBoolean(); - } else if (element.isNumber()) { - return element.getAsNumber(); - } else { - return element.getAsString(); - } - } - - private Object[] deserializeJsonArray(JsonArray arr) { - Object[] elems = new Object[arr.size()]; - Iterator elemIter = arr.iterator(); - int i = 0; - while (elemIter.hasNext()) { - JsonElement elem = elemIter.next(); - elems[i++] = deserializeJsonElement(elem); - } - return elems; - } - - private Object deserializeJsonElement(JsonElement element) { - if (element.isJsonNull()) { - return null; - } else if (element.isJsonObject()) { - Map valueMap = new HashMap(); - populateMapFromJSONObject(valueMap, element.getAsJsonObject()); - return valueMap; - } else if (element.isJsonPrimitive()) { - return deserializeJsonPrimitive(element.getAsJsonPrimitive()); - } else if (element.isJsonArray()) { - return deserializeJsonArray(element.getAsJsonArray()); - } else { - System.err.println("Unknown JSON element type for element " + element + ". " + - "Please email us at support@easypost.com."); - return null; - } - } - - private void populateMapFromJSONObject(Map objMap, JsonObject jsonObject) { - for(Map.Entry entry: jsonObject.entrySet()) { - String key = entry.getKey(); - JsonElement element = entry.getValue(); - objMap.put(key, deserializeJsonElement(element)); - } - } - - @SuppressWarnings("unchecked") - public Event deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { - Event event = new Event(); - - JsonObject jsonObject = json.getAsJsonObject(); - for(Map.Entry entry: jsonObject.entrySet()) { - String key = entry.getKey(); - JsonElement element = entry.getValue(); - if("previous_attributes".equals(key) && !element.isJsonNull()) { - Map previousAttributes = new HashMap(); - populateMapFromJSONObject(previousAttributes, element.getAsJsonObject()); - event.setPreviousAttributes(previousAttributes); - } else if ("result".equals(key)) { - String type = element.getAsJsonObject().get("object").getAsString(); - Class cl = objectMap.get(type); - EasyPostResource result = EasyPostResource.gson.fromJson(entry.getValue(), cl); - event.setResult(result); - } - } - event.setId(jsonObject.get("id").getAsString()); - event.setDescription(jsonObject.get("description").getAsString()); - event.setMode(jsonObject.get("mode").getAsString()); - - return event; - } -} diff --git a/src/main/java/com/easypost/model/FedExAccountValidationResponse.java b/src/main/java/com/easypost/model/FedExAccountValidationResponse.java new file mode 100644 index 000000000..3fdb09a48 --- /dev/null +++ b/src/main/java/com/easypost/model/FedExAccountValidationResponse.java @@ -0,0 +1,19 @@ +package com.easypost.model; + +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public final class FedExAccountValidationResponse { + // If the response contains the following, one must complete pin or invoice validation next + private String emailAddress; + private List options; + private String phoneNumber; + + // If the response contains the following, pre-validation has been completed + private String id; + private String object; + private String type; + private Map credentials; +} diff --git a/src/main/java/com/easypost/model/FedExRequestPinResponse.java b/src/main/java/com/easypost/model/FedExRequestPinResponse.java new file mode 100644 index 000000000..1c53db0c1 --- /dev/null +++ b/src/main/java/com/easypost/model/FedExRequestPinResponse.java @@ -0,0 +1,8 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class FedExRequestPinResponse { + private String message; +} diff --git a/src/main/java/com/easypost/model/Fee.java b/src/main/java/com/easypost/model/Fee.java index 84382f610..5c5e9bb07 100644 --- a/src/main/java/com/easypost/model/Fee.java +++ b/src/main/java/com/easypost/model/Fee.java @@ -1,36 +1,11 @@ package com.easypost.model; -public class Fee{ - String type; - float amount; - Boolean charged; - Boolean refunded; - - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - - public float getAmount() { - return amount; - } - public void setAmount(float amount) { - this.amount = amount; - } - - public Boolean getCharged() { - return charged; - } - public void setCharged(Boolean charged) { - this.charged = charged; - } - - public Boolean getRefunded() { - return refunded; - } - public void setRefunded(Boolean refunded) { - this.refunded = refunded; - } +import lombok.Getter; + +@Getter +public final class Fee { + private String type; + private float amount; + private Boolean charged; + private Boolean refunded; } diff --git a/src/main/java/com/easypost/model/Field.java b/src/main/java/com/easypost/model/Field.java new file mode 100644 index 000000000..119ea847a --- /dev/null +++ b/src/main/java/com/easypost/model/Field.java @@ -0,0 +1,10 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class Field extends EasyPostResource { + private String visibility; + private String label; + private String value; +} diff --git a/src/main/java/com/easypost/model/FieldError.java b/src/main/java/com/easypost/model/FieldError.java new file mode 100644 index 000000000..134f273a7 --- /dev/null +++ b/src/main/java/com/easypost/model/FieldError.java @@ -0,0 +1,37 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public final class FieldError { + private String field; + private String message; + private String suggestion; + + /** + * Set the field of this error object. + * + * @param field The field. + */ + void setField(final String field) { + this.field = field; + } + + /** + * Set the message of this error object. + * + * @param message The error message. + */ + void setMessage(final String message) { + this.message = message; + } + + /** + * Set the suggestion of this error object. + * + * @param suggestion The suggestion. + */ + void setSuggestion(final String suggestion) { + this.suggestion = suggestion; + } +} diff --git a/src/main/java/com/easypost/model/Fields.java b/src/main/java/com/easypost/model/Fields.java new file mode 100644 index 000000000..c700389de --- /dev/null +++ b/src/main/java/com/easypost/model/Fields.java @@ -0,0 +1,13 @@ +package com.easypost.model; + +import lombok.Getter; + +import java.util.Map; + +@Getter +public class Fields extends EasyPostResource { + private Map credentials; + private Map testCredentials; + private boolean autoLink; + private boolean customWorkflow; +} diff --git a/src/main/java/com/easypost/model/Form.java b/src/main/java/com/easypost/model/Form.java index 1d285bc2d..54937b540 100644 --- a/src/main/java/com/easypost/model/Form.java +++ b/src/main/java/com/easypost/model/Form.java @@ -1,44 +1,10 @@ package com.easypost.model; -public class Form { - public String id; - String mode; - String formType; - String formUrl; - Boolean submittedElectronically; +import lombok.Getter; - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } - - public String getFormType() { - return formType; - } - public void setFormType(String formType) { - this.formType = formType; - } - - public String getFormUrl() { - return formUrl; - } - public void setFormUrl(String formUrl) { - this.formUrl = formUrl; - } - - public Boolean getSubmittedElectronically() { - return submittedElectronically; - } - public void setSubmittedElectronically(Boolean submittedElectronically) { - this.submittedElectronically = submittedElectronically; - } +@Getter +public final class Form extends EasyPostResource { + private String formType; + private String formUrl; + private Boolean submittedElectronically; } diff --git a/src/main/java/com/easypost/model/Insurance.java b/src/main/java/com/easypost/model/Insurance.java index 4d5fe72ae..b55637508 100644 --- a/src/main/java/com/easypost/model/Insurance.java +++ b/src/main/java/com/easypost/model/Insurance.java @@ -1,108 +1,19 @@ package com.easypost.model; import java.util.List; -import java.util.Map; -import java.util.HashMap; - -import com.google.gson.reflect.TypeToken; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Insurance extends EasyPostResource { - public String id; - String mode; - String reference; - Address toAddress; - Address fromAddress; - Tracker tracker; - String provider; - String providerId; - String trackingCode; - String status; - String shipmentId; - Float amount; - List messages; - - public String getId() { return id; } - public void setId(String id) { this.id = id; } - - public String getMode() { return mode; } - public void setMode(String mode) { this.mode = mode; } - - public String getReference() { return reference; } - public void setReference(String reference) { this.reference = reference; } - - public Address getToAddress() { return toAddress; } - public void setToAddress(Address toAddress) { this.toAddress = toAddress; } - - public Address getFromAddress() { return fromAddress; } - public void setFromAddress(Address fromAddress) { this.fromAddress = fromAddress; } - - public Tracker getTracker() { return tracker; } - public void setTracker(Tracker tracker) { this.tracker = tracker; } - - public String getProvider() { return provider; } - public void setProvider(String provider) { this.provider = provider; } - - public String getProviderId() { return providerId; } - public void setProviderId(String providerId) { this.providerId = providerId; } - - public String getTrackingCode() { return trackingCode; } - public void setTrackingCode(String trackingCode) { this.trackingCode = trackingCode; } - - public String getStatus() { return status; } - public void setStatus(String status) { this.status = status; } - - public String getShipmentId() { return shipmentId; } - public void setShipmentId(String shipmentId) { this.shipmentId = shipmentId; } - - public Float getAmount() { return amount; } - public void setAmount(Float amount) { this.amount = amount; } - - public List getMessages() { return messages; } - public void setMessages(List messages) { this.messages = messages; } - - // create - public static Insurance create(Map params) throws EasyPostException { - return create(params, null); - } - public static Insurance create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("insurance", params); - - return request(RequestMethod.POST, classURL(Insurance.class), wrappedParams, Insurance.class, apiKey); - } - - // retrieve - public static Insurance retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Insurance retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Insurance.class, id), null, Insurance.class, apiKey); - } - - // all - public static InsuranceCollection all(Map params) throws EasyPostException { - return all(params, null); - } - public static InsuranceCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(Insurance.class), params, InsuranceCollection.class, apiKey); - } - - // refresh - public Insurance refresh() throws EasyPostException { - return this.refresh(null, null); - } - public Insurance refresh(Map params) throws EasyPostException { - return this.refresh(params, null); - } - public Insurance refresh(String apiKey) throws EasyPostException { - return this.refresh((Map) null, apiKey); - } - public Insurance refresh(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.GET, - String.format("%s", instanceURL(Insurance.class, this.getId())), params, Insurance.class, apiKey); - } +import lombok.Getter; + +@Getter +public final class Insurance extends EasyPostResource { + private String reference; + private Address toAddress; + private Address fromAddress; + private Tracker tracker; + private String provider; + private String providerId; + private String trackingCode; + private String status; + private String shipmentId; + private String amount; + private List messages; } diff --git a/src/main/java/com/easypost/model/InsuranceCollection.java b/src/main/java/com/easypost/model/InsuranceCollection.java index 10eab64d0..8c7a1463e 100644 --- a/src/main/java/com/easypost/model/InsuranceCollection.java +++ b/src/main/java/com/easypost/model/InsuranceCollection.java @@ -1,22 +1,27 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; +import java.util.Map; -public class InsuranceCollection extends EasyPostResource { - List insurances; - Boolean hasMore; +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; - public List getInsurances() { - return insurances; - } - public void setInsurances(List insurances) { - this.insurances = insurances; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } +@Getter +public final class InsuranceCollection extends PaginatedCollection { + private List insurances; + + @Override + protected Map buildNextPageParameters(List insurances, Integer pageSize) + throws EndOfPaginationError { + String lastId = insurances.get(insurances.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; + } } diff --git a/src/main/java/com/easypost/model/LumaInfo.java b/src/main/java/com/easypost/model/LumaInfo.java new file mode 100644 index 000000000..d9004a63a --- /dev/null +++ b/src/main/java/com/easypost/model/LumaInfo.java @@ -0,0 +1,12 @@ +package com.easypost.model; + +import java.util.List; +import lombok.Getter; + +@Getter +public final class LumaInfo { + private List aiResults; + private Integer matchingRuleIdx; + private String rulesetDescription; + private Rate lumaSelectedRate; +} diff --git a/src/main/java/com/easypost/model/LumaPromiseResponse.java b/src/main/java/com/easypost/model/LumaPromiseResponse.java new file mode 100644 index 000000000..7d1ff68bb --- /dev/null +++ b/src/main/java/com/easypost/model/LumaPromiseResponse.java @@ -0,0 +1,8 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class LumaPromiseResponse { + private LumaInfo lumaInfo; +} diff --git a/src/main/java/com/easypost/model/Order.java b/src/main/java/com/easypost/model/Order.java index a848a95e4..94d14aa4e 100644 --- a/src/main/java/com/easypost/model/Order.java +++ b/src/main/java/com/easypost/model/Order.java @@ -2,192 +2,59 @@ import java.util.List; import java.util.Map; -import java.util.HashMap; - -import com.google.gson.reflect.TypeToken; import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Order extends EasyPostResource { - public String id; - String mode; - String reference; - Boolean isReturn; - Address toAddress; - Address buyerAddress; - Address fromAddress; - Address returnAddress; - CustomsInfo customsInfo; - List shipments; - List rates; - Map options; - List messages; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } - - public String getReference() { - return reference; - } - public void setReference(String reference) { - this.reference = reference; - } - - public Boolean getIsReturn() { - return isReturn; - } - public void setIsReturn(Boolean isReturn) { - this.isReturn = isReturn; - } - - public Address getToAddress() { - return toAddress; - } - public void setToAddress(Address toAddress) { - this.toAddress = toAddress; - } - - public Address getBuyerAddress() { - return buyerAddress; - } - public void setBuyerAddress(Address buyerAddress) { - this.buyerAddress = buyerAddress; - } - - public Address getFromAddress() { - return fromAddress; - } - public void setFromAddress(Address fromAddress) { - this.fromAddress = fromAddress; - } - - public Address getReturnAddress() { - return returnAddress; - } - public void setReturnAddress(Address returnAddress) { - this.returnAddress = returnAddress; - } - - public CustomsInfo getCustomsInfo() { - return customsInfo; - } - public void setCustomsInfo(CustomsInfo customsInfo) { - this.customsInfo = customsInfo; - } - - public List getShipments() { - return shipments; - } - public void setShipments(List shipments) { - this.shipments = shipments; - } - - public List getRates() { - return rates; - } - public void setRates(List rates) { - this.rates = rates; - } - - public Map getOptions() { - return options; - } - public void setOptions(Map options) { - this.options = options; - } - - public List getMessages() { - return messages; - } - public void setMessages(List messages) { - this.messages = messages; - } - - - // create - public static Order create(Map params) throws EasyPostException { - return create(params, null); - } - public static Order create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("order", params); - - return request(RequestMethod.POST, classURL(Order.class), wrappedParams, Order.class, apiKey); - } - - // retrieve - public static Order retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Order retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Order.class, id), null, Order.class, apiKey); - } - - // refresh - public Order refresh() throws EasyPostException { - return this.refresh(null, null); - } - public Order refresh(Map params) throws EasyPostException { - return this.refresh(params, null); - } - public Order refresh(String apiKey) throws EasyPostException { - return this.refresh((Map) null, apiKey); - } - public Order refresh(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.GET, - String.format("%s", instanceURL(Order.class, this.getId())), params, Order.class, apiKey); - } - - // get rates - public Order newRates() throws EasyPostException { - return this.newRates(null, null); - } - public Order newRates(Map params) throws EasyPostException { - return this.newRates(params, null); - } - public Order newRates(String apiKey) throws EasyPostException { - return this.newRates((Map) null, apiKey); - } - public Order newRates(Map params, String apiKey) throws EasyPostException { - Order response = request( - RequestMethod.GET, - String.format("%s/rates", instanceURL(Order.class, this.getId())), params, Order.class, apiKey); - - this.merge(this, response); - return this; - } - - // buy - public Order buy(Map params) throws EasyPostException { - return this.buy(params, null); - } - public Order buy(Rate rate) throws EasyPostException { - Map params = new HashMap(); - params.put("carrier", rate.carrier); - params.put("service", rate.service); - - return this.buy(params, null); - } - public Order buy(Map params, String apiKey) throws EasyPostException { - Order response = request( - RequestMethod.POST, - String.format("%s/buy", instanceURL(Order.class, this.getId())), params, Order.class, apiKey); - - this.merge(this, response); - return this; - } - +import com.easypost.utils.Utilities; + +import lombok.Getter; + +@Getter +public final class Order extends EasyPostResource { + private String service; + private String reference; + private Boolean isReturn; + private Address toAddress; + private Address buyerAddress; + private Address fromAddress; + private Address returnAddress; + private CustomsInfo customsInfo; + private List shipments; + private List rates; + private Map options; + private List messages; + private List carrierAccounts; + + /** + * Get the lowest rate for this Order. + * + * @return Lowest Rate object + * @throws EasyPostException when the request fails. + */ + public Rate lowestRate() throws EasyPostException { + return this.lowestRate(null, null); + } + + /** + * Get the lowest rate for this Order. + * + * @param carriers The carriers to use in the filter. + * @param services The services to use in the filter. + * @return Lowest Rate object + * @throws EasyPostException when the request fails. + */ + public Rate lowestRate(final List carriers, final List services) + throws EasyPostException { + return Utilities.getLowestObjectRate(this.getRates(), carriers, services); + } + + /** + * Get the lowest rate for this order. + * + * @param carriers The carriers to use in the query. + * @return Rate object + * @throws EasyPostException when the request fails. + */ + public Rate lowestRate(final List carriers) throws EasyPostException { + return this.lowestRate(carriers, null); + } } diff --git a/src/main/java/com/easypost/model/OrderCollection.java b/src/main/java/com/easypost/model/OrderCollection.java deleted file mode 100644 index 5df28f268..000000000 --- a/src/main/java/com/easypost/model/OrderCollection.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.easypost.model; - -import java.util.List; -import com.easypost.net.EasyPostResource; - -public class OrderCollection extends EasyPostResource { - List orders; - Boolean hasMore; - - public List getOrders() { - return orders; - } - public void setOrders(List orders) { - this.orders = orders; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } -} diff --git a/src/main/java/com/easypost/model/PaginatedCollection.java b/src/main/java/com/easypost/model/PaginatedCollection.java new file mode 100644 index 000000000..4686c83b5 --- /dev/null +++ b/src/main/java/com/easypost/model/PaginatedCollection.java @@ -0,0 +1,65 @@ +package com.easypost.model; + +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +@Getter +public abstract class PaginatedCollection extends EasyPostResource { + + private Boolean hasMore; + + /** + * Get the next page of a paginated collection. + * + * @param apiCallFunction The function to call to get the next page. + * @param currentEntries The current entries in the collection. Needed to determine the next page parameters. + * @param The type of the collection to retrieve. + * @return The next page of the collection. + * @throws EndOfPaginationError If there are no more pages to retrieve. + */ + public final > TCollection getNextPage( + Function, TCollection> apiCallFunction, List currentEntries) + throws EndOfPaginationError { + + return getNextPage(apiCallFunction, currentEntries, null); + } + + /** + * Get the next page of a paginated collection with a custom page size. + * + * @param apiCallFunction The function to call to get the next page. + * @param currentEntries The current entries in the collection. Needed to determine the next page parameters. + * @param pageSize The page size to use for the next page. + * @param The type of the collection to retrieve. + * @return The next page of the collection. + * @throws EndOfPaginationError If there are no more pages to retrieve. + */ + public final > TCollection getNextPage( + Function, TCollection> apiCallFunction, List currentEntries, Integer pageSize) + throws EndOfPaginationError { + if (currentEntries == null || currentEntries.size() == 0) { + throw new EndOfPaginationError(); + } + + if (!this.hasMore) { + throw new EndOfPaginationError(); + } + + Map parameters = buildNextPageParameters(currentEntries, pageSize); + + return apiCallFunction.apply(parameters); + } + + /** + * Build the parameters for retrieving the next page of a paginated collection. + * + * @param entries The current entries in the collection. Needed to determine the next page parameters. + * @param pageSize The page size to use for the next page. + * @return The parameters for retrieving the next page of a paginated collection. + */ + protected abstract Map buildNextPageParameters( + List entries, Integer pageSize) throws EndOfPaginationError; +} diff --git a/src/main/java/com/easypost/model/Parcel.java b/src/main/java/com/easypost/model/Parcel.java index 0dd3b08a8..732dffe49 100644 --- a/src/main/java/com/easypost/model/Parcel.java +++ b/src/main/java/com/easypost/model/Parcel.java @@ -1,88 +1,12 @@ package com.easypost.model; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Parcel extends EasyPostResource { - public String id; - String predefinedPackage; - Float weight; - Float length; - Float width; - Float height; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getPredefinedPackage() { - return predefinedPackage; - } - public void setPredefinedPackage(String predefinedPackage) { - this.predefinedPackage = predefinedPackage; - } - - public Float getWeight() { - return weight; - } - public void setWeight(Float weight) { - this.weight = weight; - } - - public Float getLength() { - return length; - } - public void setLength(Float length) { - this.length = length; - } - - public Float getWidth() { - return width; - } - public void setWidth(Float width) { - this.width = width; - } - - public Float getHeight() { - return height; - } - public void setHeight(Float height) { - this.height = height; - } - - - // create - public static Parcel create(Map params) throws EasyPostException { - return create(params, null); - } - public static Parcel create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("parcel", params); - - return request(RequestMethod.POST, classURL(Parcel.class), wrappedParams, Parcel.class, apiKey); - } - - // retrieve - public static Parcel retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Parcel retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Parcel.class, id), null, Parcel.class, apiKey); - } - - // all - public static ParcelCollection all(Map params) throws EasyPostException { - return all(params, null); - } - public static ParcelCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(Parcel.class), params, ParcelCollection.class, apiKey); - } - -} \ No newline at end of file +import lombok.Getter; + +@Getter +public final class Parcel extends EasyPostResource { + private String predefinedPackage; + private Float weight; + private Float length; + private Float width; + private Float height; +} diff --git a/src/main/java/com/easypost/model/ParcelCollection.java b/src/main/java/com/easypost/model/ParcelCollection.java deleted file mode 100644 index b7aafd66f..000000000 --- a/src/main/java/com/easypost/model/ParcelCollection.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.easypost.model; - -import java.util.List; -import com.easypost.net.EasyPostResource; - -public class ParcelCollection extends EasyPostResource { - List parcels; - Boolean hasMore; - - public List getParcels() { - return parcels; - } - public void setParcels(List parcels) { - this.parcels = parcels; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } -} diff --git a/src/main/java/com/easypost/model/Payload.java b/src/main/java/com/easypost/model/Payload.java new file mode 100644 index 000000000..e5e366a87 --- /dev/null +++ b/src/main/java/com/easypost/model/Payload.java @@ -0,0 +1,16 @@ +package com.easypost.model; + +import java.util.Map; + +import lombok.Getter; + +@Getter +public class Payload extends EasyPostResource { + private int responseCode; + private int totalTime; + private Map requestHeaders; + private Map responseHeaders; + private String requestBody; + private String requestUrl; + private String responseBody; +} diff --git a/src/main/java/com/easypost/model/PayloadCollection.java b/src/main/java/com/easypost/model/PayloadCollection.java new file mode 100644 index 000000000..f5dbc86e0 --- /dev/null +++ b/src/main/java/com/easypost/model/PayloadCollection.java @@ -0,0 +1,10 @@ +package com.easypost.model; + +import lombok.Getter; + +import java.util.List; + +@Getter +public class PayloadCollection { + private List payloads; +} diff --git a/src/main/java/com/easypost/model/PaymentMethod.java b/src/main/java/com/easypost/model/PaymentMethod.java new file mode 100644 index 000000000..44b08711b --- /dev/null +++ b/src/main/java/com/easypost/model/PaymentMethod.java @@ -0,0 +1,15 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class PaymentMethod extends EasyPostResource { + + public enum Priority { + PRIMARY, + SECONDARY + } + + private PaymentMethodObject primaryPaymentMethod; + private PaymentMethodObject secondaryPaymentMethod; +} diff --git a/src/main/java/com/easypost/model/PaymentMethodObject.java b/src/main/java/com/easypost/model/PaymentMethodObject.java new file mode 100644 index 000000000..e978134be --- /dev/null +++ b/src/main/java/com/easypost/model/PaymentMethodObject.java @@ -0,0 +1,85 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class PaymentMethodObject extends EasyPostResource { + + public enum PaymentMethodType { + CREDIT_CARD("credit_cards"), + BANK_ACCOUNT("bank_accounts"); + + private final String endpoint; + + /** + * Constructor. + * + * @param endpoint the endpoint for this type of payment method. + */ + PaymentMethodType(String endpoint) { + this.endpoint = endpoint; + } + + /** + * Get the endpoint for this type of payment method. + * + * @return the endpoint for this type of payment method. + */ + String getEndpoint() { + return endpoint; + } + } + + // bank_account + private String country; + // bank_account + private String bankName; + // credit_card + private String brand; + // both + private String disabledAt; + // credit_card + private int expMonth; + // credit_card + private int expYear; + // both + private String last4; + // credit_card + private String name; + // bank_account + private boolean verified; + // both + private boolean requiresMandateCollection; + + /** + * Get the type of this PaymentMethodObject object. + * + * @return the type of this PaymentMethodObject. + */ + public PaymentMethodType getType() { + PaymentMethodType type = null; + if (getId() == null) { + return null; + } + String objectType = getObject(); + if (objectType != null && objectType.equals("CreditCard")) { + type = PaymentMethodType.CREDIT_CARD; + } else if (objectType != null && objectType.equals("BankAccount")) { + type = PaymentMethodType.BANK_ACCOUNT; + } + return type; + } + + /** + * Get the endpoint for this PaymentMethodObject object. + * + * @return the endpoint for this PaymentMethodObject. + */ + public String getEndpoint() { + PaymentMethodType type = getType(); + if (type == null) { + return null; + } + return type.getEndpoint(); + } +} diff --git a/src/main/java/com/easypost/model/Pickup.java b/src/main/java/com/easypost/model/Pickup.java index 3e3b01c69..c21dfc664 100644 --- a/src/main/java/com/easypost/model/Pickup.java +++ b/src/main/java/com/easypost/model/Pickup.java @@ -1,153 +1,65 @@ package com.easypost.model; -import java.util.HashMap; -import java.util.List; +import java.util.ArrayList; import java.util.Date; -import java.util.Map; +import java.util.List; import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Pickup extends EasyPostResource { - public String id; - String mode; - String status; - String reference; - Date minDatetime; - Date maxDatetime; - Boolean isAccountAddress; - String instructions; - List messages; - String confirmation; - Address address; - List carrierAccounts; - List pickupRates; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } - - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - - public String getReference() { return reference; } - public void setReference(String reference) { this.reference = reference; } - - public Date getMinDatetime() { return minDatetime; } - public void setMinDatetime(Date minDatetime) { this.minDatetime = minDatetime; } - - public Date getMaxDatetime() { return maxDatetime; } - public void setMaxDatetime(Date maxDatetime) { this.maxDatetime = maxDatetime; } - - public Boolean getIsAccountAddress() { return isAccountAddress; } - public void setIsAccountAddress(Boolean isAccountAddress) { this.isAccountAddress = isAccountAddress; } - - public String getInstructions() { return instructions; } - public void setInstructions(String instructions) { this.instructions = instructions; } - - public List getMessages() { return messages; } - public void setMessages(List messages) { this.messages = messages; } - - public String getConfirmation() { return confirmation; } - public void setConfirmation(String confirmation) { this.confirmation = confirmation; } - - public Address getAddress() { return address; } - public void setAddress(Address address) { this.address = address; } - - public List getCarrierAccounts() { return carrierAccounts; } - public void setCarrierAccounts(List carrierAccounts) { this.carrierAccounts = carrierAccounts; } - - public List getPickupRates() { return pickupRates; } - public void setPickupRates(List pickupRates) { this.pickupRates = pickupRates; } - - - // create - public static Pickup create(Map params) throws EasyPostException { - return create(params, null); - } - public static Pickup create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("pickup", params); - - return request(RequestMethod.POST, classURL(Pickup.class), wrappedParams, Pickup.class, apiKey); - } - - // retrieve - public static Pickup retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Pickup retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Pickup.class, id), null, Pickup.class, apiKey); - } - - // refresh - public Pickup refresh() throws EasyPostException { - return this.refresh(null, null); - } - public Pickup refresh(Map params) throws EasyPostException { - return this.refresh(params, null); - } - public Pickup refresh(String apiKey) throws EasyPostException { - return this.refresh((Map) null, apiKey); - } - public Pickup refresh(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.GET, - String.format("%s", instanceURL(Pickup.class, this.getId())), params, Pickup.class, apiKey); - } - - // buy - public Pickup buy() throws EasyPostException { - return this.buy(null, null); - } - public Pickup buy(Map params) throws EasyPostException { - return this.buy(params, null); - } - public Pickup buy(String apiKey) throws EasyPostException { - return this.buy((Map) null, apiKey); - } - public Pickup buy(PickupRate pickupRate) throws EasyPostException { - Map params = new HashMap(); - params.put("rate", pickupRate); - - return this.buy(params, null); - } - public Pickup buy(Map params, String apiKey) throws EasyPostException { - Pickup response = request( - RequestMethod.POST, - String.format("%s/buy", instanceURL(Pickup.class, this.getId())), params, Pickup.class, apiKey); - - this.merge(this, response); - return this; - } - - // cancel - public Pickup cancel() throws EasyPostException { - return this.cancel(null, null); - } - public Pickup cancel(Map params) throws EasyPostException { - return this.cancel(params, null); - } - public Pickup cancel(String apiKey) throws EasyPostException { - return this.cancel((Map) null, apiKey); - } - public Pickup cancel(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.POST, - String.format("%s/cancel", instanceURL(Pickup.class, this.getId())), params, Pickup.class, apiKey); +import com.easypost.utils.Utilities; + +import lombok.Getter; + +@Getter +public final class Pickup extends EasyPostResource { + private String status; + private String reference; + private Date minDatetime; + private Date maxDatetime; + private Boolean isAccountAddress; + private String instructions; + private List messages; + private String confirmation; + private Address address; + private List carrierAccounts; + private List pickupRates; + + /** + * Get the lowest rate for this Pickup. + * + * @return lowest PickupRate object + * @throws EasyPostException when the request fails. + */ + public PickupRate lowestRate() throws EasyPostException { + return this.lowestRate(null, null); + } + + /** + * Get the lowest rate for this Pickup. + * + * @param carriers The carriers to use in the filter. + * @param services The services to use in the filter. + * @return lowest PickupRate object + * @throws EasyPostException when the request fails. + */ + public PickupRate lowestRate(final List carriers, final List services) + throws EasyPostException { + List rates = new ArrayList(); + + for (PickupRate rate : this.getPickupRates()) { + rates.add((Rate) rate); + } + + return (PickupRate) Utilities.getLowestObjectRate(rates, carriers, services); + } + + /** + * Get the lowest rate for this pickup. + * + * @param carriers The carriers to use in the query. + * @return PickupRate object + * @throws EasyPostException when the request fails. + */ + public PickupRate lowestRate(final List carriers) throws EasyPostException { + return this.lowestRate(carriers, null); } } diff --git a/src/main/java/com/easypost/model/PickupCollection.java b/src/main/java/com/easypost/model/PickupCollection.java index f7d2172d2..d4a5921e0 100644 --- a/src/main/java/com/easypost/model/PickupCollection.java +++ b/src/main/java/com/easypost/model/PickupCollection.java @@ -1,22 +1,27 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; +import java.util.Map; -public class PickupCollection extends EasyPostResource { - List pickups; - Boolean hasMore; +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; - public List getPickups() { - return pickups; - } - public void setPickups(List pickups) { - this.pickups = pickups; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; +@Getter +public final class PickupCollection extends PaginatedCollection { + private List pickups; + + @Override + protected Map buildNextPageParameters(List pickups, Integer pageSize) + throws EndOfPaginationError { + String lastId = pickups.get(pickups.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; } } diff --git a/src/main/java/com/easypost/model/PickupRate.java b/src/main/java/com/easypost/model/PickupRate.java index 686e428cf..8b0adefaf 100644 --- a/src/main/java/com/easypost/model/PickupRate.java +++ b/src/main/java/com/easypost/model/PickupRate.java @@ -1,34 +1,8 @@ package com.easypost.model; -import com.easypost.net.EasyPostResource; +import lombok.Getter; -public class PickupRate extends EasyPostResource { - public String id; - String mode; - String carrier; - String service; - Float rate; - String currency; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getMode() { return mode; } - public void setMode(String mode) { this.mode = mode; } - - public String getCarrier() { return carrier; } - public void setCarrier(String carrier) { this.carrier = carrier; } - - public String getService() { return service; } - public void setService(String service) { this.service = service; } - - public Float getRate() { return rate; } - public void setRate(Float rate) { this.rate = rate; } - - public String getCurrency() { return currency; } - public void setCurrency(String currency) { this.currency = currency; } -} \ No newline at end of file +@Getter +public final class PickupRate extends Rate { + private String pickupId; +} diff --git a/src/main/java/com/easypost/model/PostageLabel.java b/src/main/java/com/easypost/model/PostageLabel.java index f062eaa51..27ec33790 100644 --- a/src/main/java/com/easypost/model/PostageLabel.java +++ b/src/main/java/com/easypost/model/PostageLabel.java @@ -1,179 +1,27 @@ package com.easypost.model; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class PostageLabel extends EasyPostResource { - public String id; - int dateAdvance; - String integratedForm; - int labelResolution; - String labelSize; - String labelType; - String labelUrl; - String labelFile; - String labelFileType; - String labelPdfSize; - String labelPdfType; - String labelPdfUrl; - String labelPdfFileType; - String labelEpl2Size; - String labelEpl2Type; - String labelEpl2Url; - String labelEpl2FileType; - String labelZplSize; - String labelZplType; - String labelZplUrl; - String labelZplFileType; - - public String getId() { - return id; - } - private void setId(String id) { - this.id = id; - } - - public int getDateAdvance() { - return dateAdvance; - } - private void setDateAdvance(int dateAdvance) { - this.dateAdvance = dateAdvance; - } - - public String getIntegratedForm() { - return integratedForm; - } - private void setIntegratedForm(String integratedForm) { - this.integratedForm = integratedForm; - } - - public int getLabelResolution() { - return labelResolution; - } - private void setLabelResolution(int labelResolution) { - this.labelResolution = labelResolution; - } - - public String getLabelSize() { - return labelSize; - } - private void setLabelSize(String labelSize) { - this.labelSize = labelSize; - } - - public String getLabelType() { - return labelType; - } - private void setLabelType(String labelType) { - this.labelType = labelType; - } - - public String getLabelUrl() { - return labelUrl; - } - private void setLabelUrl(String labelUrl) { - this.labelUrl = labelUrl; - } - - public String getLabelFile() { - return labelFile; - } - private void setLabelFile(String labelFile) { - this.labelFile = labelFile; - } - - public String getLabelFileType() { - return labelFileType; - } - private void setLabelFileType(String labelFileType) { - this.labelFileType = labelFileType; - } - - public String getLabelPdfSize() { - return labelPdfSize; - } - private void setLabelPdfSize(String labelPdfSize) { - this.labelPdfSize = labelPdfSize; - } - - public String getPdfLabelType() { - return labelPdfType; - } - private void setLabelPdfType(String labelPdfType) { - this.labelPdfType = labelPdfType; - } - - public String getLabelPdfUrl() { - return labelPdfUrl; - } - private void setLabelPdfUrl(String labelPdfUrl) { - this.labelPdfUrl = labelPdfUrl; - } - - public String getLabelPdfFileType() { - return labelPdfFileType; - } - private void setLabelPdfFileType(String labelPdfFileType) { - this.labelPdfFileType = labelPdfFileType; - } - - public String getLabelEpl2Size() { - return labelEpl2Size; - } - private void setLabelEpl2Size(String labelEpl2Size) { - this.labelEpl2Size = labelEpl2Size; - } - - public String getEpl2LabelType() { - return labelEpl2Type; - } - private void setLabelEpl2Type(String labelEpl2Type) { - this.labelEpl2Type = labelEpl2Type; - } - - public String getLabelEpl2Url() { - return labelEpl2Url; - } - private void setLabelEpl2Url(String labelEpl2Url) { - this.labelEpl2Url = labelEpl2Url; - } - - public String getLabelEpl2FileType() { - return labelEpl2FileType; - } - private void setLabelEpl2FileType(String labelEpl2FileType) { - this.labelEpl2FileType = labelEpl2FileType; - } - - public String getLabelZplSize() { - return labelZplSize; - } - private void setLabelZplSize(String labelZplSize) { - this.labelZplSize = labelZplSize; - } - - public String getZplLabelType() { - return labelZplType; - } - private void setLabelZplType(String labelZplType) { - this.labelZplType = labelZplType; - } - - public String getLabelZplUrl() { - return labelZplUrl; - } - private void setLabelZplUrl(String labelZplUrl) { - this.labelZplUrl = labelZplUrl; - } - - public String getLabelZplFileType() { - return labelZplFileType; - } - private void setLabelZplFileType(String labelZplFileType) { - this.labelZplFileType = labelZplFileType; - } +import lombok.Getter; + +@Getter +public final class PostageLabel extends EasyPostResource { + private int dateAdvance; + private String integratedForm; + private int labelResolution; + private String labelSize; + private String labelType; + private String labelUrl; + private String labelFile; + private String labelFileType; + private String labelPdfSize; + private String labelPdfType; + private String labelPdfUrl; + private String labelPdfFileType; + private String labelEpl2Size; + private String labelEpl2Type; + private String labelEpl2Url; + private String labelEpl2FileType; + private String labelZplSize; + private String labelZplType; + private String labelZplUrl; + private String labelZplFileType; } diff --git a/src/main/java/com/easypost/model/Rate.java b/src/main/java/com/easypost/model/Rate.java index 239cec6d3..ca069612a 100644 --- a/src/main/java/com/easypost/model/Rate.java +++ b/src/main/java/com/easypost/model/Rate.java @@ -1,170 +1,25 @@ package com.easypost.model; -import java.util.List; -import java.util.HashMap; import java.util.Map; -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; +import lombok.Getter; +@Getter public class Rate extends EasyPostResource { - public String id; - String carrier; - String service; - String serviceCode; - Float rate; - String currency; - Float listRate; - String listCurrency; - Float retailRate; - String retailCurrency; - Number deliveryDays; - String deliveryDate; - Boolean deliveryDateGuaranteed; - Number estDeliveryDays; - String shipmentId; - String carrierAccountId; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getCarrier() { - return carrier; - } - public void setCarrier(String carrier) { - this.carrier = carrier; - } - - public String getService() { - return service; - } - public void setService(String service) { - this.service = service; - } - - public String getServiceCode() { - return serviceCode; - } - public void setServiceCode(String serviceCode) { - this.serviceCode = serviceCode; - } - - public Float getRate() { - return rate; - } - public void setRate(Float rate) { - this.rate = rate; - } - - public Float getListRate() { - return listRate; - } - public void setListRate(Float listRate) { - this.listRate = listRate; - } - - public Float getRetailRate() { - return retailRate; - } - public void setRetailRate(Float retailRate) { - this.retailRate = retailRate; - } - - public String getCurrency() { - return currency; - } - public void setCurrency(String currency) { - this.currency = currency; - } - - public String getListCurrency() { - return listCurrency; - } - public void setListCurrency(String listCurrency) { - this.listCurrency = listCurrency; - } - - public String getRetailCurrency() { - return retailCurrency; - } - public void setRetailCurrency(String retailCurrency) { - this.retailCurrency = retailCurrency; - } - - public Number getDeliveryDays() { - return deliveryDays; - } - public void setDeliveryDays(Number deliveryDays) { - this.deliveryDays = deliveryDays; - } - - public String getDeliveryDate() { - return deliveryDate; - } - public void setDeliveryDate(String deliveryDate) { - this.deliveryDate = deliveryDate; - } - - public Boolean getDeliveryDateGuaranteed() { - return deliveryDateGuaranteed; - } - public void setDeliveryDateGuaranteed(Boolean deliveryDateGuaranteed) { - this.deliveryDateGuaranteed = deliveryDateGuaranteed; - } - - public Number getEstDeliveryDays() { - return estDeliveryDays; - } - public void setEstDeliveryDays(Number estDeliveryDays) { - this.estDeliveryDays = estDeliveryDays; - } - - public String getShipmentId() { - return shipmentId; - } - public void setShipmentId(String shipmentId) { - this.shipmentId = shipmentId; - } - - public String getCarrierAccountId() { - return carrierAccountId; - } - public void setCarrierAccountId(String carrierAccountId) { - this.carrierAccountId = carrierAccountId; - } - - - public Rate(String id, String carrier, String service, Float rate, String currency, Float listRate, String listCurrency, Float retailRate, String retailCurrency, Number deliveryDays, String deliveryDate, Boolean deliveryDateGuaranteed, Number estDeliveryDays, String shipmentId, String carrierAccountId) { - this.id = id; - this.carrier = carrier; - this.service = service; - this.serviceCode = carrier.toLowerCase() + "." + service.toLowerCase(); - this.rate = rate; - this.currency = currency; - this.listRate = listRate; - this.listCurrency = listCurrency; - this.retailRate = retailRate; - this.retailCurrency = retailCurrency; - this.deliveryDays = deliveryDays; - this.deliveryDate = deliveryDate; - this.deliveryDateGuaranteed = deliveryDateGuaranteed; - this.estDeliveryDays = estDeliveryDays; - this.shipmentId = shipmentId; - this.carrierAccountId = carrierAccountId; - } - - // retrieve - public static Rate retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Rate retrieve(String id, String apiKey) throws EasyPostException { - Rate response; - response = request(RequestMethod.GET, instanceURL(Rate.class, id), null, Rate.class, apiKey); - - return response; - } + private String carrier; + private String service; + private Float rate; + private String currency; + private Float listRate; + private String listCurrency; + private Float retailRate; + private String retailCurrency; + private Number deliveryDays; + private String deliveryDate; + private Boolean deliveryDateGuaranteed; + private Number estDeliveryDays; + private String shipmentId; + private String carrierAccountId; + private String billingType; + private Map details; } diff --git a/src/main/java/com/easypost/model/RateDeserializer.java b/src/main/java/com/easypost/model/RateDeserializer.java deleted file mode 100644 index 9ff4d2b29..000000000 --- a/src/main/java/com/easypost/model/RateDeserializer.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.easypost.model; - -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import java.lang.reflect.Type; - -public class RateDeserializer implements JsonDeserializer { - @Override - public Rate deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) - throws JsonParseException { - JsonObject jo = (JsonObject) json; - - String currency; - if (jo.get("currency").isJsonNull()) { - currency = null; - } else { - currency = jo.get("currency").getAsString(); - } - - Float listRate; - if (jo.get("list_rate").isJsonNull()) { - listRate = null; - } else { - listRate = jo.get("list_rate").getAsFloat(); - } - - String listCurrency; - if (jo.get("list_currency").isJsonNull()) { - listCurrency = null; - } else { - listCurrency = jo.get("list_currency").getAsString(); - } - - Float retailRate; - if (jo.get("retail_rate").isJsonNull()) { - retailRate = null; - } else { - retailRate = jo.get("retail_rate").getAsFloat(); - } - - String retailCurrency; - if (jo.get("retail_currency").isJsonNull()) { - retailCurrency = null; - } else { - retailCurrency = jo.get("retail_currency").getAsString(); - } - - Number deliveryDays; - if (jo.get("delivery_days").isJsonNull()) { - deliveryDays = null; - } else { - deliveryDays = jo.get("delivery_days").getAsNumber(); - } - - String deliveryDate; - if (jo.get("delivery_date").isJsonNull()) { - deliveryDate = null; - } else { - deliveryDate = jo.get("delivery_date").getAsString(); - } - - Boolean deliveryDateGuaranteed; - if (jo.get("delivery_date_guaranteed").isJsonNull()) { - deliveryDateGuaranteed = false; - } else { - deliveryDateGuaranteed = new Boolean(jo.get("delivery_date_guaranteed").getAsString()); - } - - Number estDeliveryDays; - if (jo.get("est_delivery_days").isJsonNull()) { - estDeliveryDays = null; - } else { - estDeliveryDays = jo.get("est_delivery_days").getAsNumber(); - } - - String shipmentID; - if (jo.get("shipment_id").isJsonNull()) { - shipmentID = null; - } else { - shipmentID = jo.get("shipment_id").getAsString(); - } - - return new Rate( - jo.get("id").getAsString(), - jo.get("carrier").getAsString(), - jo.get("service").getAsString(), - jo.get("rate").getAsFloat(), - currency, - listRate, - listCurrency, - retailRate, - retailCurrency, - deliveryDays, - deliveryDate, - deliveryDateGuaranteed, - estDeliveryDays, - shipmentID, - jo.get("carrier_account_id").getAsString()); - } -} diff --git a/src/main/java/com/easypost/model/RecommendShipDateForShipmentResult.java b/src/main/java/com/easypost/model/RecommendShipDateForShipmentResult.java new file mode 100644 index 000000000..6a9e73366 --- /dev/null +++ b/src/main/java/com/easypost/model/RecommendShipDateForShipmentResult.java @@ -0,0 +1,9 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class RecommendShipDateForShipmentResult { + private TimeInTransitDetailsForShipDateRecommendation easypostTimeInTransitData; + private Rate rate; +} diff --git a/src/main/java/com/easypost/model/RecommendShipDateForZipPairResult.java b/src/main/java/com/easypost/model/RecommendShipDateForZipPairResult.java new file mode 100644 index 000000000..cfb87e5a2 --- /dev/null +++ b/src/main/java/com/easypost/model/RecommendShipDateForZipPairResult.java @@ -0,0 +1,15 @@ +package com.easypost.model; + +import java.util.List; + +import lombok.Getter; + +@Getter +public class RecommendShipDateForZipPairResult { + private Boolean saturdayDelivery; + private List results; + private List carriersWithoutTintEstimates; + private String desiredDeliveryDate; + private String fromZip; + private String toZip; +} diff --git a/src/main/java/com/easypost/model/RecommendShipDateResponse.java b/src/main/java/com/easypost/model/RecommendShipDateResponse.java new file mode 100644 index 000000000..15b5061e0 --- /dev/null +++ b/src/main/java/com/easypost/model/RecommendShipDateResponse.java @@ -0,0 +1,9 @@ +package com.easypost.model; + +import java.util.List; +import lombok.Getter; + +@Getter +public class RecommendShipDateResponse { + private List rates; +} diff --git a/src/main/java/com/easypost/model/ReferralCustomer.java b/src/main/java/com/easypost/model/ReferralCustomer.java new file mode 100644 index 000000000..b80518585 --- /dev/null +++ b/src/main/java/com/easypost/model/ReferralCustomer.java @@ -0,0 +1,7 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class ReferralCustomer extends BaseUser { +} diff --git a/src/main/java/com/easypost/model/ReferralCustomerCollection.java b/src/main/java/com/easypost/model/ReferralCustomerCollection.java new file mode 100644 index 000000000..6dcbb2a9c --- /dev/null +++ b/src/main/java/com/easypost/model/ReferralCustomerCollection.java @@ -0,0 +1,27 @@ +package com.easypost.model; + +import java.util.List; +import java.util.Map; + +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; + +@Getter +public final class ReferralCustomerCollection extends PaginatedCollection { + private List referralCustomers; + + @Override + protected Map buildNextPageParameters(List referralCustomers, Integer pageSize) + throws EndOfPaginationError { + String lastId = referralCustomers.get(referralCustomers.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; + } +} diff --git a/src/main/java/com/easypost/model/Refund.java b/src/main/java/com/easypost/model/Refund.java index 1ec55ba0c..841d0bfec 100644 --- a/src/main/java/com/easypost/model/Refund.java +++ b/src/main/java/com/easypost/model/Refund.java @@ -1,88 +1,12 @@ package com.easypost.model; -import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Refund extends EasyPostResource { - public String id; - String trackingCode; - String confirmationNumber; - String status; - String carrier; - String shipmentId; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getTrackingCode() { - return trackingCode; - } - public void setTrackingCode(String trackingCode) { - this.trackingCode = trackingCode; - } - - public String getConfirmationNumber() { - return confirmationNumber; - } - public void setConfirmationNumber(String confirmationNumber) { - this.confirmationNumber = confirmationNumber; - } - - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - - public String getCarrier() { - return carrier; - } - public void setCarrier(String carrier) { - this.carrier = carrier; - } - - public String getShipmentId() { - return shipmentId; - } - public void setShipmentId(String shipmentId) { - this.shipmentId = shipmentId; - } - - - // create - public static List create(Map params) throws EasyPostException { - return create(params, null); - } - public static List create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("refund", params); - - return request(RequestMethod.POST, classURL(Refund.class), wrappedParams, List.class, apiKey); - } - - // retrieve - public static Refund retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Refund retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Refund.class, id), null, Refund.class, apiKey); - } - - // all - public static RefundCollection all(Map params) throws EasyPostException { - return all(params, null); - } - public static RefundCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(Refund.class), params, RefundCollection.class, apiKey); - } - -} \ No newline at end of file +import lombok.Getter; + +@Getter +public final class Refund extends EasyPostResource { + private String trackingCode; + private String confirmationNumber; + private String status; + private String carrier; + private String shipmentId; +} diff --git a/src/main/java/com/easypost/model/RefundCollection.java b/src/main/java/com/easypost/model/RefundCollection.java index 8de485b25..b336bc235 100644 --- a/src/main/java/com/easypost/model/RefundCollection.java +++ b/src/main/java/com/easypost/model/RefundCollection.java @@ -1,22 +1,27 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; +import java.util.Map; -public class RefundCollection extends EasyPostResource { - List refunds; - Boolean hasMore; +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; - public List getRefunds() { - return refunds; - } - public void setRefunds(List refunds) { - this.refunds = refunds; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } +@Getter +public final class RefundCollection extends PaginatedCollection { + private List refunds; + + @Override + protected Map buildNextPageParameters(List refunds, Integer pageSize) + throws EndOfPaginationError { + String lastId = refunds.get(refunds.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; + } } diff --git a/src/main/java/com/easypost/model/Report.java b/src/main/java/com/easypost/model/Report.java index 8075ef2d0..bde4fb708 100644 --- a/src/main/java/com/easypost/model/Report.java +++ b/src/main/java/com/easypost/model/Report.java @@ -1,129 +1,14 @@ package com.easypost.model; -import com.easypost.EasyPost; -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; -import java.net.URLEncoder; import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -public class Report extends EasyPostResource { - public String id; - Date startDate; - Date endDate; - String mode; - String status; - Boolean includeChildren; - String url; - Date urlExpiresAt; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Date getStartDate() { - return startDate; - } - - public void setStartDate(Date startDate) { - this.startDate = startDate; - } - - public Date getEndDate() { - return endDate; - } - - public void setEndDate(Date endDate) { - this.endDate = endDate; - } - - public String getMode() { - return mode; - } - - public void setMode(String mode) { - this.mode = mode; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Boolean getIncludeChildren() { - return includeChildren; - } - - public void setIncludeChildren(Boolean includeChildren) { - this.includeChildren = includeChildren; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public Date getUrlExpiresAt() { - return urlExpiresAt; - } - - public void setUrlExpiresAt(Date urlExpiresAt) { - this.urlExpiresAt = urlExpiresAt; - } - - // create - public static Report create(Map params) throws EasyPostException { - return create(params, null); - } - - public static Report create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("report", params); - wrappedParams.put("start_date", params.get("start_date")); - wrappedParams.put("end_date", params.get("end_date")); - - String type = (String) params.get("type"); - return request(RequestMethod.POST, reportURL(type), wrappedParams, Report.class, apiKey); - } - - // retrieve - public static Report retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - - public static Report retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Report.class, id), null, Report.class, apiKey); - } - - // all - public static ReportCollection all(Map params) throws EasyPostException { - return all(params, null); - } - - public static ReportCollection all(Map params, String apiKey) - throws EasyPostException { - String type = (String) params.get("type"); - return request(RequestMethod.GET, reportURL(type), params, ReportCollection.class, apiKey); - } - - // generate report URL pattern - protected static String reportURL(String type) throws EasyPostException { - try { - String urlType = URLEncoder.encode(type, "UTF-8").toLowerCase(); - return String.format("%s/reports/%s/", EasyPost.API_BASE, urlType); - } catch (java.io.UnsupportedEncodingException e) { - throw new EasyPostException("Undetermined Report Type"); - } - } +import lombok.Getter; + +@Getter +public final class Report extends EasyPostResource { + private Date startDate; + private Date endDate; + private String status; + private Boolean includeChildren; + private String url; + private Date urlExpiresAt; } diff --git a/src/main/java/com/easypost/model/ReportCollection.java b/src/main/java/com/easypost/model/ReportCollection.java index beb4267ef..ad791c01b 100644 --- a/src/main/java/com/easypost/model/ReportCollection.java +++ b/src/main/java/com/easypost/model/ReportCollection.java @@ -1,23 +1,32 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; +import java.util.Map; -public class ReportCollection extends EasyPostResource { - List reports; - Boolean hasMore; +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; +import lombok.Setter; - public List getReports() { - return reports; - } - public void setReports(List reports) { - this.reports = reports; - } +@Getter +public final class ReportCollection extends PaginatedCollection { + private List reports; - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; + @Setter + private String type; + + @Override + protected Map buildNextPageParameters(List reports, Integer pageSize) + throws EndOfPaginationError { + String lastId = reports.get(reports.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + parameters.put("type", type); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; } } diff --git a/src/main/java/com/easypost/model/ScanForm.java b/src/main/java/com/easypost/model/ScanForm.java index 4c8f36e40..52ae55cb4 100644 --- a/src/main/java/com/easypost/model/ScanForm.java +++ b/src/main/java/com/easypost/model/ScanForm.java @@ -1,108 +1,16 @@ package com.easypost.model; import java.util.List; -import java.util.HashMap; -import java.util.Map; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; +import lombok.Getter; +@Getter public class ScanForm extends EasyPostResource { - public String id; - String status; - String message; - Address fromAddress; - List trackingCodes; - String formUrl; - String formFileType; - String confirmation; - String batchId; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - public Address getFromAddress() { - return fromAddress; - } - public void setFromAddress(Address fromAddress) { - this.fromAddress = fromAddress; - } - - public List getTrackingCodes() { - return trackingCodes; - } - public void setTrackingCodes(List trackingCodes) { - this.trackingCodes = trackingCodes; - } - - public String getFormUrl() { - return formUrl; - } - public String getLabelUrl() { - return this.getFormUrl(); - } - public void setFormUrl(String formUrl) { - this.formUrl = formUrl; - } - - public String getFormFileType() { - return formFileType; - } - public String getLabelFileType() { return this.getFormFileType(); } - public void setFormFileType(String formFileType) { - this.formFileType = formFileType; - } - - public String getConfirmation() { return confirmation; } - public void setConfirmation(String confirmation) { this.confirmation = confirmation; } - - public String getBatchId() { - return batchId; - } - public void setBatchId(String batchId) { - this.batchId = batchId; - } - - // create - public static ScanForm create(Map params) throws EasyPostException { - return create(params, null); - } - public static ScanForm create(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.POST, classURL(ScanForm.class), params, ScanForm.class, apiKey); - } - - // retrieve - public static ScanForm retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static ScanForm retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(ScanForm.class, id), null, ScanForm.class, apiKey); - } - - // all - public static ScanFormCollection all(Map params) throws EasyPostException { - return all(params, null); - } - public static ScanFormCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(ScanForm.class), params, ScanFormCollection.class, apiKey); - } - + private String status; + private String message; + private Address fromAddress; + private List trackingCodes; + private String formUrl; + private String formFileType; + private String confirmation; + private String batchId; } diff --git a/src/main/java/com/easypost/model/ScanFormCollection.java b/src/main/java/com/easypost/model/ScanFormCollection.java index 6955d9182..6fb7312b6 100644 --- a/src/main/java/com/easypost/model/ScanFormCollection.java +++ b/src/main/java/com/easypost/model/ScanFormCollection.java @@ -1,22 +1,27 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; +import java.util.Map; -public class ScanFormCollection extends EasyPostResource { - List scanForms; - Boolean hasMore; +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; - public List getScanForms() { - return scanForms; - } - public void setScanForms(List scanForms) { - this.scanForms = scanForms; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } +@Getter +public final class ScanFormCollection extends PaginatedCollection { + private List scanForms; + + @Override + protected Map buildNextPageParameters(List scanForms, Integer pageSize) + throws EndOfPaginationError { + String lastId = scanForms.get(scanForms.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + return parameters; + } } diff --git a/src/main/java/com/easypost/model/ShipDateForZipPairRecommendation.java b/src/main/java/com/easypost/model/ShipDateForZipPairRecommendation.java new file mode 100644 index 000000000..524a9d8f2 --- /dev/null +++ b/src/main/java/com/easypost/model/ShipDateForZipPairRecommendation.java @@ -0,0 +1,10 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class ShipDateForZipPairRecommendation { + private String carrier; + private String service; + private TimeInTransitDetailsForShipDate easypostTimeInTransitData; +} diff --git a/src/main/java/com/easypost/model/Shipment.java b/src/main/java/com/easypost/model/Shipment.java index 22e9ba4d2..4c14dc23d 100644 --- a/src/main/java/com/easypost/model/Shipment.java +++ b/src/main/java/com/easypost/model/Shipment.java @@ -2,409 +2,75 @@ import java.util.List; import java.util.Map; -import java.util.HashMap; - -import com.google.gson.reflect.TypeToken; import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Shipment extends EasyPostResource { - public String id; - String mode; - String reference; - Boolean isReturn; - Address toAddress; - Address buyerAddress; - Address fromAddress; - Address returnAddress; - Parcel parcel; - CustomsInfo customsInfo; - Rate selectedRate; - List rates; - PostageLabel postageLabel; - ScanForm scanForm; - String orderId; - List
forms; - Tracker tracker; - String insurance; - String trackingCode; - String status; - String refundStatus; - String batchId; - String batchStatus; - String batchMessage; - String uspsZone; - Map options; - List messages; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } - - public String getReference() { - return reference; - } - public void setReference(String reference) { - this.reference = reference; - } - - public Boolean getIsReturn() { - return isReturn; - } - public void setIsReturn(Boolean isReturn) { - this.isReturn = isReturn; - } - - public Address getToAddress() { - return toAddress; - } - public void setToAddress(Address toAddress) { - this.toAddress = toAddress; - } - - public Address getBuyerAddress() { - return buyerAddress; - } - public void setBuyerAddress(Address buyerAddress) { - this.buyerAddress = buyerAddress; - } - - public Address getFromAddress() { - return fromAddress; - } - public void setFromAddress(Address fromAddress) { - this.fromAddress = fromAddress; - } - - public Address getReturnAddress() { - return returnAddress; - } - public void setReturnAddress(Address returnAddress) { - this.returnAddress = returnAddress; - } - - public Parcel getParcel() { - return parcel; - } - public void setParcel(Parcel parcel) { - this.parcel = parcel; - } - - public CustomsInfo getCustomsInfo() { - return customsInfo; - } - public void setCustomsInfo(CustomsInfo customsInfo) { - this.customsInfo = customsInfo; - } - - public Rate getSelectedRate() { - return selectedRate; - } - public void setSelectedRate(Rate selectedRate) { - this.selectedRate = selectedRate; - } - - public List getRates() { - return rates; - } - public void setRates(List rates) { - this.rates = rates; - } - - public PostageLabel getPostageLabel() { - return postageLabel; - } - public void setPostageLabel(PostageLabel postageLabel) { - this.postageLabel = postageLabel; - } - - public ScanForm getScanForm() { - return scanForm; - } - public void setScanForm(ScanForm scanForm) { - this.scanForm = scanForm; - } - - public String getOrderId() { - return orderId; - } - public void setOrderId(String orderId) { - this.orderId = orderId; - } - - public Tracker getTracker() { - return tracker; - } - public void setTracker(Tracker tracker) { - this.tracker = tracker; - } - - public String getInsurance() { - return insurance; - } - public void setInsurance(String insurance) { - this.insurance = insurance; - } - - public String getTrackingCode() { - return trackingCode; - } - public void setTrackingCode(String trackingCode) { - this.trackingCode = trackingCode; - } - - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - - public String getRefundStatus() { - return refundStatus; - } - public void setRefundStatus(String refundStatus) { - this.refundStatus = refundStatus; - } - - public String getBatchId() { - return batchId; - } - public void setBatchId(String batchId) { - this.batchId = batchId; - } - - public String getBatchStatus() { - return batchStatus; - } - public void setBatchStatus(String batchStatus) { - this.batchStatus = batchStatus; - } - - public String getBatchMessage() { - return batchMessage; - } - public void setBatchMessage(String batchMessage) { - this.batchMessage = batchMessage; - } +import com.easypost.utils.Utilities; - public String getUspsZone() { - return uspsZone; - } - public void setUspsZone(String uspsZone) { - this.uspsZone = uspsZone; - } +import lombok.Getter; - public Map getOptions() { - return options; - } - public void setOptions(Map options) { - this.options = options; - } - - public List getMessages() { - return messages; - } - public void setMessages(List messages) { - this.messages = messages; - } - - public List getForms() { - return forms; - } - public void setForms(List forms) { - this.forms = forms; - } - - - // create - public static Shipment create(Map params) throws EasyPostException { - return create(params, null); - } - public static Shipment create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("shipment", params); - - return request(RequestMethod.POST, classURL(Shipment.class), wrappedParams, Shipment.class, apiKey); - } - - // retrieve - public static Shipment retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Shipment retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Shipment.class, id), null, Shipment.class, apiKey); - } - - // all - public static ShipmentCollection all(Map params) throws EasyPostException { - return all(params, null); - } - public static ShipmentCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(Shipment.class), params, ShipmentCollection.class, apiKey); - } - - // refresh - public Shipment refresh() throws EasyPostException { - return this.refresh(null, null); - } - public Shipment refresh(Map params) throws EasyPostException { - return this.refresh(params, null); - } - public Shipment refresh(String apiKey) throws EasyPostException { - return this.refresh((Map) null, apiKey); - } - public Shipment refresh(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.GET, - String.format("%s", instanceURL(Shipment.class, this.getId())), params, Shipment.class, apiKey); - } - - // get rates - public Shipment newRates() throws EasyPostException { - return this.newRates(null, null); - } - public Shipment newRates(Map params) throws EasyPostException { - return this.newRates(params, null); - } - public Shipment newRates(String apiKey) throws EasyPostException { - return this.newRates((Map) null, apiKey); - } - public Shipment newRates(Map params, String apiKey) throws EasyPostException { - Shipment response = request( - RequestMethod.POST, - String.format("%s/rerate", instanceURL(Shipment.class, this.getId())), params, Shipment.class, apiKey); - - this.merge(this, response); - return this; - } - - // buy - public Shipment buy() throws EasyPostException { - return this.buy(null, null); - } - public Shipment buy(Map params) throws EasyPostException { - return this.buy(params, null); - } - public Shipment buy(String apiKey) throws EasyPostException { - return this.buy((Map) null, apiKey); - } - public Shipment buy(Rate rate) throws EasyPostException { - Map params = new HashMap(); - params.put("rate", rate); - - return this.buy(params, null); - } - public Shipment buy(Map params, String apiKey) throws EasyPostException { - Shipment response = request( - RequestMethod.POST, - String.format("%s/buy", instanceURL(Shipment.class, this.getId())), params, Shipment.class, apiKey); - - this.merge(this, response); - return this; - } - - // refund - public Shipment refund() throws EasyPostException { - return this.refund(null, null); - } - public Shipment refund(Map params) throws EasyPostException { - return this.refund(params, null); - } - public Shipment refund(String apiKey) throws EasyPostException { - return this.refund((Map) null, apiKey); - } - public Shipment refund(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.GET, - String.format("%s/refund", instanceURL(Shipment.class, this.getId())), params, Shipment.class, apiKey); - } - - // label - public Shipment label() throws EasyPostException { - return this.label(null, null); - } - public Shipment label(Map params) throws EasyPostException { - return this.label(params, null); - } - public Shipment label(String apiKey) throws EasyPostException { - return this.label((Map) null, apiKey); - } - public Shipment label(Map params, String apiKey) throws EasyPostException { - Shipment response = request( - RequestMethod.GET, - String.format("%s/label", instanceURL(Shipment.class, this.getId())), params, Shipment.class, apiKey); - - this.merge(this, response); - return this; - } - - // insure - public Shipment insure() throws EasyPostException { - return this.insure(null, null); - } - public Shipment insure(Map params) throws EasyPostException { - return this.insure(params, null); - } - public Shipment insure(String apiKey) throws EasyPostException { - return this.insure((Map) null, apiKey); - } - public Shipment insure(Map params, String apiKey) throws EasyPostException { - return request( - RequestMethod.POST, - String.format("%s/insure", instanceURL(Shipment.class, this.getId())), params, Shipment.class, apiKey); - } - - // lowest rate - public Rate lowestRate() throws EasyPostException { - return this.lowestRate(null, null); - } - public Rate lowestRate(List carriers) throws EasyPostException { - return this.lowestRate(carriers, null); - } - public Rate lowestRate(List carriers, List services) throws EasyPostException { - Rate lowestRate = null; - - if (carriers != null) { - for(int i=0; i < carriers.size(); i++) { - carriers.set(i, carriers.get(i).toLowerCase()); - } - } - - if (services != null) { - for(int i=0; i < services.size(); i++) { - services.set(i, services.get(i).toLowerCase()); - } - } - - for(int i=0; i < this.rates.size(); i++) { - if (carriers != null && carriers.size() > 0 && !carriers.contains(this.rates.get(i).carrier.toLowerCase()) && !carriers.contains(this.rates.get(i).serviceCode.toLowerCase())) { - continue; - } - if (services != null && services.size() > 0 && !services.contains(this.rates.get(i).service.toLowerCase()) && !services.contains(this.rates.get(i).serviceCode.toLowerCase())) { - continue; - } - - if (lowestRate == null || lowestRate.rate > this.rates.get(i).rate) { - lowestRate = this.rates.get(i); - } - } - - if(lowestRate == null) { - throw new EasyPostException("Unable to find lowest rate matching required criteria."); - } - - return lowestRate; - } +@Getter +public class Shipment extends EasyPostResource { + private String reference; + private Boolean isReturn; + private Address toAddress; + private Address buyerAddress; + private Address fromAddress; + private Address returnAddress; + private Parcel parcel; + private CustomsInfo customsInfo; + private Rate selectedRate; + private List rates; + private PostageLabel postageLabel; + private ScanForm scanForm; + private String orderId; + private List forms; + private Tracker tracker; + private String insurance; + private String trackingCode; + private String status; + private String refundStatus; + private String batchId; + private String batchStatus; + private String batchMessage; + private String uspsZone; + private Map options; + private List messages; + private List taxIdentifiers; + private List carrierAccounts; + private String service; + private List fees; + + /** + * Get the lowest rate for this Shipment. + * + * @return lowest Rate object + * @throws EasyPostException when the request fails. + */ + public Rate lowestRate() throws EasyPostException { + return this.lowestRate(null, null); + } + + /** + * Get the lowest rate for this Shipment. + * + * @param carriers the carriers to use in the filter. + * @param services the services to use in the filter. + * @return lowest Rate object + * @throws EasyPostException when the request fails. + */ + public Rate lowestRate(final List carriers, final List services) + throws EasyPostException { + return Utilities.getLowestObjectRate(this.getRates(), carriers, services); + } + + /** + * Get the lowest rate for this shipment. + * + * @param carriers the carriers to use in the query. + * @return Rate object + * @throws EasyPostException when the request fails. + */ + public Rate lowestRate(final List carriers) throws EasyPostException { + return this.lowestRate(carriers, null); + } } diff --git a/src/main/java/com/easypost/model/ShipmentCollection.java b/src/main/java/com/easypost/model/ShipmentCollection.java index 69ed68336..c73db327f 100644 --- a/src/main/java/com/easypost/model/ShipmentCollection.java +++ b/src/main/java/com/easypost/model/ShipmentCollection.java @@ -1,22 +1,42 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; - -public class ShipmentCollection extends EasyPostResource { - List shipments; - Boolean hasMore; - - public List getShipments() { - return shipments; - } - public void setShipments(List shipments) { - this.shipments = shipments; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } +import java.util.Map; + +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; +import lombok.Setter; + +@Getter +public class ShipmentCollection extends PaginatedCollection { + private List shipments; + + @Setter + private Boolean purchased; + + @Setter + private Boolean includeChildren; + + @Override + protected final Map buildNextPageParameters(List shipments, Integer pageSize) + throws EndOfPaginationError { + String lastId = shipments.get(shipments.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + // We only want to include these parameters if they are set (versus defaulting to false; anti-pattern) + if (purchased != null) { + parameters.put("purchased", purchased); + } + if (includeChildren != null) { + parameters.put("include_children", includeChildren); + } + + return parameters; + } } diff --git a/src/main/java/com/easypost/model/ShipmentMessage.java b/src/main/java/com/easypost/model/ShipmentMessage.java index 5241a352a..b383ab05b 100644 --- a/src/main/java/com/easypost/model/ShipmentMessage.java +++ b/src/main/java/com/easypost/model/ShipmentMessage.java @@ -1,31 +1,11 @@ package com.easypost.model; -public class ShipmentMessage { - String carrier; - String type; - Object message; - - public String getCarrier() { - return carrier; - } - - public void setCarrier(String carrier) { - this.carrier = carrier; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Object getMessage() { - return message; - } - - public void setMessage(Object message) { - this.message = message; - } +import lombok.Getter; + +@Getter +public final class ShipmentMessage { + private String carrier; + private String carrierAccountId; + private String type; + private Object message; } diff --git a/src/main/java/com/easypost/model/ShipmentOptions.java b/src/main/java/com/easypost/model/ShipmentOptions.java index 12f2b0c69..b37770bcc 100644 --- a/src/main/java/com/easypost/model/ShipmentOptions.java +++ b/src/main/java/com/easypost/model/ShipmentOptions.java @@ -1,20 +1,9 @@ package com.easypost.model; -public class ShipmentOptions { - String smartpostHub; - String smartpostManifest; - - public String getSmartpostHub() { - return smartpostHub; - } - public void setSmartpostHub(String smartpostHub) { - this.smartpostHub = smartpostHub; - } +import lombok.Getter; - public String getSmartpostManifest() { - return smartpostManifest; - } - public void setSmartpostManifest(String smartpostManifest) { - this.smartpostManifest = smartpostManifest; - } +@Getter +public final class ShipmentOptions { + private String smartpostHub; + private String smartpostManifest; } diff --git a/src/main/java/com/easypost/model/SmartRate.java b/src/main/java/com/easypost/model/SmartRate.java new file mode 100644 index 000000000..f45f07bae --- /dev/null +++ b/src/main/java/com/easypost/model/SmartRate.java @@ -0,0 +1,8 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class SmartRate extends Rate { + private TimeInTransit timeInTransit; +} diff --git a/src/main/java/com/easypost/model/SmartRateAccuracy.java b/src/main/java/com/easypost/model/SmartRateAccuracy.java new file mode 100644 index 000000000..c08b6645d --- /dev/null +++ b/src/main/java/com/easypost/model/SmartRateAccuracy.java @@ -0,0 +1,44 @@ +package com.easypost.model; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.InvalidParameterError; + +import lombok.Getter; + +@Getter +public enum SmartRateAccuracy { + Percentile50("percentile_50"), + Percentile75("percentile_75"), + Percentile85("percentile_85"), + Percentile90("percentile_90"), + Percentile95("percentile_95"), + Percentile97("percentile_97"), + Percentile99("percentile_99"); + + private final String keyName; + + /** + * Constructor. + * + * @param keyName the internal key name + */ + SmartRateAccuracy(String keyName) { + this.keyName = keyName; + } + + /** + * Get the enum value for a given internal key name. + * + * @param keyName the internal key name + * @return the enum value + * @throws EasyPostException if the key name is not found + */ + public static SmartRateAccuracy getByKeyName(String keyName) throws EasyPostException { + for (SmartRateAccuracy smartrateAccuracy : values()) { + if (smartrateAccuracy.getKeyName().equals(keyName)) { + return smartrateAccuracy; + } + } + throw new InvalidParameterError("smartrateAccuracy"); + } +} diff --git a/src/main/java/com/easypost/model/SmartRateCollection.java b/src/main/java/com/easypost/model/SmartRateCollection.java new file mode 100644 index 000000000..60b5eef58 --- /dev/null +++ b/src/main/java/com/easypost/model/SmartRateCollection.java @@ -0,0 +1,51 @@ +package com.easypost.model; + +import java.util.ArrayList; +import java.util.List; + +public final class SmartRateCollection { + private List smartRates; + + /** + * Get this SmartRateCollection's Smartrate objects. + * + * @return List of Smartrate objects. + */ + public List getSmartRates() { + return this.smartRates; + } + + /** + * Set this SmartRateCollection's Smartrate objects. + * + * @param smartRates List of Smartrate objects. + */ + public void setSmartRates(final List smartRates) { + this.smartRates = smartRates; + } + + /** + * Constructor. + */ + public SmartRateCollection() { + this.smartRates = new ArrayList(); + } + + /** + * Create a SmartRateCollection from a list of rates. + * + * @param smartRates List of Smartrate objects + */ + public SmartRateCollection(final List smartRates) { + setSmartRates(smartRates); + } + + /** + * Add a SmartRate object to this SmartRateCollection. + * + * @param rate Rate object + */ + public void addRate(final SmartRate rate) { + smartRates.add(rate); + } +} diff --git a/src/main/java/com/easypost/model/SmartRateCollectionDeserializer.java b/src/main/java/com/easypost/model/SmartRateCollectionDeserializer.java new file mode 100644 index 000000000..18715c89e --- /dev/null +++ b/src/main/java/com/easypost/model/SmartRateCollectionDeserializer.java @@ -0,0 +1,43 @@ +package com.easypost.model; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import java.lang.reflect.Type; + +public final class SmartRateCollectionDeserializer implements JsonDeserializer { + /** + * Deserialize a SmartRateCollection from a JSON object. + * + * @param json JSON object to deserialize. + * @param typeOfT Type of the object to deserialize. + * @param context Deserialization context. + * @return Deserialized SmartRateCollection object. + * @throws JsonParseException if the JSON object is not a valid + * SmartRateCollection. + */ + @Override + public SmartRateCollection deserialize(final JsonElement json, final Type typeOfT, + final JsonDeserializationContext context) throws JsonParseException { + SmartRateCollection smartrateCollection = new SmartRateCollection(); + + JsonObject jo = (JsonObject) json; + JsonElement results = jo.get("result"); + + if (results == null || !results.isJsonArray()) { + return smartrateCollection; + // return empty collection if "results" key does not exist or corresponding + // value is not an array + } + // the JsonDeserializationContext should have access to the other type adapters, + // so we can tap into the RateDeserializer from here + results.getAsJsonArray().forEach(rateData -> { + smartrateCollection.addRate(context.deserialize(rateData, SmartRate.class)); + }); + + return smartrateCollection; + } +} diff --git a/src/main/java/com/easypost/model/StatelessRate.java b/src/main/java/com/easypost/model/StatelessRate.java new file mode 100644 index 000000000..fd8f092a9 --- /dev/null +++ b/src/main/java/com/easypost/model/StatelessRate.java @@ -0,0 +1,23 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public class StatelessRate { + private Boolean deliveryDateGuaranteed; + private Integer deliveryDays; + private Integer estDeliveryDays; + private String billingType; + private String carrier; + private String carrierAccountId; + private String currency; + private String deliveryDate; + private String listCurrency; + private String listRate; + private String mode; + private String object; + private String rate; + private String retailCurrency; + private String retailRate; + private String service; +} diff --git a/src/main/java/com/easypost/model/StatelessRateDeserializer.java b/src/main/java/com/easypost/model/StatelessRateDeserializer.java new file mode 100644 index 000000000..029020154 --- /dev/null +++ b/src/main/java/com/easypost/model/StatelessRateDeserializer.java @@ -0,0 +1,42 @@ +package com.easypost.model; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +import com.easypost.Constants; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +public final class StatelessRateDeserializer implements JsonDeserializer { + /** + * Deserialize a StatelessRate from a JSON object. + * + * @param json JSON object to deserialize. + * @param typeOfT Type of the object to deserialize. + * @param context Deserialization context. + * @return Deserialized StatelessRate object. + * @throws JsonParseException if the JSON object is not a valid StatelessRate. + */ + @Override + public StatelessRate[] deserialize(final JsonElement json, final Type typeOfT, + final JsonDeserializationContext context) throws JsonParseException { + JsonObject jo = json.getAsJsonObject(); + JsonElement results = jo.get("rates"); + + if (results == null || !results.isJsonArray()) { + return new StatelessRate[0]; + } + + List ratesList = new ArrayList<>(); + for (JsonElement element : results.getAsJsonArray()) { + StatelessRate rate = Constants.Http.GSON.fromJson(element, StatelessRate.class); + ratesList.add(rate); + } + + return ratesList.toArray(new StatelessRate[0]); + } +} diff --git a/src/main/java/com/easypost/model/TaxIdentifier.java b/src/main/java/com/easypost/model/TaxIdentifier.java new file mode 100644 index 000000000..3c9b21a58 --- /dev/null +++ b/src/main/java/com/easypost/model/TaxIdentifier.java @@ -0,0 +1,11 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public final class TaxIdentifier extends EasyPostResource { + private String entity; + private String taxId; + private String taxIdType; + private String issuingCountry; +} diff --git a/src/main/java/com/easypost/model/TimeInTransit.java b/src/main/java/com/easypost/model/TimeInTransit.java new file mode 100644 index 000000000..927c162a9 --- /dev/null +++ b/src/main/java/com/easypost/model/TimeInTransit.java @@ -0,0 +1,55 @@ +package com.easypost.model; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.InvalidParameterError; +import com.google.gson.annotations.SerializedName; + +import lombok.Getter; + +@Getter +public final class TimeInTransit { + + @SerializedName("percentile_50") + private Integer percentile50; + @SerializedName("percentile_75") + private Integer percentile75; + @SerializedName("percentile_85") + private Integer percentile85; + @SerializedName("percentile_90") + private Integer percentile90; + @SerializedName("percentile_95") + private Integer percentile95; + @SerializedName("percentile_97") + private Integer percentile97; + @SerializedName("percentile_99") + private Integer percentile99; + + /** + * Get the delivery accuracy of a specific percentile of this TimeInTransit. + * + * @param accuracy the SmartRateAccuracy to find the corresponding accuracy for + * @return the delivery accuracy of the specified percentile + * @throws EasyPostException when the percentile is not valid + */ + public int getSmartRateAccuracy(SmartRateAccuracy accuracy) throws EasyPostException { + switch (accuracy) { + case Percentile50: + return this.percentile50; + case Percentile75: + return this.percentile75; + case Percentile85: + return this.percentile85; + case Percentile90: + return this.percentile90; + case Percentile95: + return this.percentile95; + case Percentile97: + return this.percentile97; + case Percentile99: + return this.percentile99; + default: + throw new InvalidParameterError("accuracy"); + } + } + +} diff --git a/src/main/java/com/easypost/model/TimeInTransitDetailsForDeliveryDate.java b/src/main/java/com/easypost/model/TimeInTransitDetailsForDeliveryDate.java new file mode 100644 index 000000000..203f74250 --- /dev/null +++ b/src/main/java/com/easypost/model/TimeInTransitDetailsForDeliveryDate.java @@ -0,0 +1,10 @@ +package com.easypost.model; + +import java.util.Date; +import lombok.Getter; + +@Getter +public class TimeInTransitDetailsForDeliveryDate { + private Date easypostEstimatedDeliveryDate; + private TimeInTransit daysInTransit; +} diff --git a/src/main/java/com/easypost/model/TimeInTransitDetailsForShipDate.java b/src/main/java/com/easypost/model/TimeInTransitDetailsForShipDate.java new file mode 100644 index 000000000..214c02ebc --- /dev/null +++ b/src/main/java/com/easypost/model/TimeInTransitDetailsForShipDate.java @@ -0,0 +1,12 @@ +package com.easypost.model; + +import java.util.Date; +import lombok.Getter; + +@Getter +public class TimeInTransitDetailsForShipDate { + private Date shipOnDate; + private Float deliveryDateConfidence; + private int estimatedTransitDays; + private TimeInTransit daysInTransit; +} diff --git a/src/main/java/com/easypost/model/TimeInTransitDetailsForShipDateRecommendation.java b/src/main/java/com/easypost/model/TimeInTransitDetailsForShipDateRecommendation.java new file mode 100644 index 000000000..12e266800 --- /dev/null +++ b/src/main/java/com/easypost/model/TimeInTransitDetailsForShipDateRecommendation.java @@ -0,0 +1,13 @@ +package com.easypost.model; + +import java.util.Date; +import lombok.Getter; + +@Getter +public class TimeInTransitDetailsForShipDateRecommendation { + private Date desiredDeliveryDate; + private Float deliveryDateConfidence; + private String estimatedTransitDays; + private String shipOnDate; + private TimeInTransit daysInTransit; +} diff --git a/src/main/java/com/easypost/model/Tracker.java b/src/main/java/com/easypost/model/Tracker.java index 83b8d94ef..0e90b4911 100644 --- a/src/main/java/com/easypost/model/Tracker.java +++ b/src/main/java/com/easypost/model/Tracker.java @@ -1,155 +1,23 @@ package com.easypost.model; -import java.util.List; -import java.util.HashMap; -import java.util.Map; import java.util.Date; +import java.util.List; -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; +import lombok.Getter; +@Getter public class Tracker extends EasyPostResource { - public String id; - String mode; - String trackingCode; - String status; - String shipmentId; - String carrier; - List trackingDetails; - float weight; - Date estDeliveryDate; - String signedBy; - CarrierDetail carrierDetail; - String publicUrl; - String statusDetail; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } - - public String getShipmentId() { - return shipmentId; - } - public void setShipmentId(String shipmentId) { - this.shipmentId = shipmentId; - } - - public String getCarrier() { - return carrier; - } - public void setCarrier(String carrier) { - this.carrier = carrier; - } - - public String getTrackingCode() { - return trackingCode; - } - public void setTrackingCode(String trackingCode) { - this.trackingCode = trackingCode; - } - - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - - public List getTrackingDetails() { - return trackingDetails; - } - public void setTrackingDetails(List trackingDetails) { - this.trackingDetails = trackingDetails; - } - - public float getWeight() { - return weight; - } - public void setWeight(float weight) { - this.weight = weight; - } - - public Date getEstDeliveryDate() { - return estDeliveryDate; - } - public void setEstDeliveryDate(Date estDeliveryDate) { - this.estDeliveryDate = estDeliveryDate; - } - - public String getSignedBy() { - return signedBy; - } - public void setSignedBy(String signedBy) { - this.signedBy = signedBy; - } - - public CarrierDetail getCarrierDetail() { return carrierDetail; } - public void setCarrierDetail(CarrierDetail carrierDetail) { this.carrierDetail = carrierDetail; } - - // This method is a misspelling, but it persists to avoid breaking backwards compatibility - public Date getUpdateAt() { - return getUpdatedAt(); - } - public void setUpdateAt(Date updatedAt) { - setUpdatedAt(updatedAt); - } - - public String getPublicUrl() { return publicUrl; } - public void setPublicUrl(String publicUrl) { this.publicUrl = publicUrl; } - - public String getStatusDetail() { - return statusDetail; - } - public void setStatusDetail(String statusDetail) { - this.statusDetail = statusDetail; - } - - // create - public static Tracker create(Map params) throws EasyPostException { - return create(params, null); - } - public static Tracker create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("tracker", params); - - return request(RequestMethod.POST, classURL(Tracker.class), wrappedParams, Tracker.class, apiKey); - } - - // retrieve - public static Tracker retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Tracker retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Tracker.class, id), null, Tracker.class, apiKey); - } - - // all - public static TrackerCollection all(Map params) throws EasyPostException { - return all(params, null); - } - public static TrackerCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(Tracker.class), params, TrackerCollection.class, apiKey); - } - - // createList - public static boolean createList(Map params) throws EasyPostException { - return createList(params, null); - } - public static boolean createList(Map params, String apiKey) throws EasyPostException { - String createListUrl = String.format("%s/create_list", classURL(Tracker.class)); - - request(RequestMethod.POST, createListUrl, params, Object.class, apiKey); - return true; - } - + private String trackingCode; + private String status; + private String shipmentId; + private String carrier; + private List trackingDetails; + private float weight; + private Date estDeliveryDate; + private String signedBy; + private CarrierDetail carrierDetail; + private String publicUrl; + private String statusDetail; + private Boolean finalized; + private Boolean isReturn; } diff --git a/src/main/java/com/easypost/model/TrackerCollection.java b/src/main/java/com/easypost/model/TrackerCollection.java index 876518770..843abd1f1 100644 --- a/src/main/java/com/easypost/model/TrackerCollection.java +++ b/src/main/java/com/easypost/model/TrackerCollection.java @@ -1,22 +1,48 @@ package com.easypost.model; import java.util.List; -import com.easypost.net.EasyPostResource; - -public class TrackerCollection extends EasyPostResource { - List trackers; - Boolean hasMore; - - public List getTrackers() { - return trackers; - } - public void setTrackers(List trackers) { - this.trackers = trackers; - } - public Boolean getHasMore() { - return hasMore; - } - public void setHasMore(Boolean hasMore) { - this.hasMore = hasMore; - } +import java.util.Map; + +import com.easypost.exception.General.EndOfPaginationError; +import lombok.Getter; +import lombok.Setter; + +@Getter +public class TrackerCollection extends PaginatedCollection { + private List trackers; + + @Setter + private String trackingCode; + + @Setter + private List trackingCodes; + + @Setter + private String carrier; + + @Override + protected final Map buildNextPageParameters(List trackers, Integer pageSize) + throws EndOfPaginationError { + String lastId = trackers.get(trackers.size() - 1).getId(); + + Map parameters = new java.util.HashMap<>(); + parameters.put("before_id", lastId); + + if (pageSize != null) { + parameters.put("page_size", pageSize); + } + + // We only want to include these parameters if they are set (versus defaulting to false; anti-pattern) + if (trackingCode != null) { + parameters.put("tracking_code", trackingCode); + } + if (trackingCodes != null) { + parameters.put("tracking_codes", trackingCodes); + } + if (carrier != null) { + parameters.put("carrier", carrier); + } + + return parameters; + } } diff --git a/src/main/java/com/easypost/model/TrackingDetail.java b/src/main/java/com/easypost/model/TrackingDetail.java index 56e6d74b0..e9af665d0 100644 --- a/src/main/java/com/easypost/model/TrackingDetail.java +++ b/src/main/java/com/easypost/model/TrackingDetail.java @@ -2,42 +2,17 @@ import java.util.Date; -public class TrackingDetail { - String status; - String message; - Date datetime; - TrackingLocation trackingLocation; - String statusDetail; - - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - public Date getDatetime() { - return datetime; - } - public void setDatetime(Date datetime) { - this.datetime = datetime; - } - - public TrackingLocation getTrackingLocation() { return trackingLocation; } - public void setTrackingLocation(TrackingLocation location) { this.trackingLocation = location; } - - public String getStatusDetail() { - return statusDetail; - } - public void setStatusDetail(String statusDetail) { - this.statusDetail = statusDetail; - } - +import lombok.Getter; + +@Getter +public final class TrackingDetail { + private String message; + private String description; + private String status; + private String statusDetail; + private Date datetime; + private String source; + private String carrierCode; + private TrackingLocation trackingLocation; + private String estDeliveryDate; } diff --git a/src/main/java/com/easypost/model/TrackingLocation.java b/src/main/java/com/easypost/model/TrackingLocation.java index 85a803065..dced781d6 100644 --- a/src/main/java/com/easypost/model/TrackingLocation.java +++ b/src/main/java/com/easypost/model/TrackingLocation.java @@ -1,21 +1,11 @@ package com.easypost.model; -public class TrackingLocation { - String city; - String state; - String country; - String zip; - - public String getCity() { return city; } - public void setCity(String city) { this.city = city; } - - public String getState() { return state; } - public void setState(String state) { this.state = state; } - - public String getCountry() { return country; } - public void setCountry(String country) { this.country = country; } - - public String getZip() { return zip; } - public void setZip(String zip) { this.zip = zip; } - +import lombok.Getter; + +@Getter +public final class TrackingLocation { + private String city; + private String state; + private String country; + private String zip; } diff --git a/src/main/java/com/easypost/model/User.java b/src/main/java/com/easypost/model/User.java index 72add3de5..2778292e0 100644 --- a/src/main/java/com/easypost/model/User.java +++ b/src/main/java/com/easypost/model/User.java @@ -1,130 +1,4 @@ package com.easypost.model; -import java.util.List; -import java.util.Map; -import java.util.HashMap; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; -import com.easypost.model.ApiKeys; - -public class User extends EasyPostResource { - public String id; - String name; - String email; - String phoneNumber; - String balance; - String rechargeAmount; - String secondaryRechargeAmount; - String rechargeThreshold; - List children; - - public String getId() { return id; } - public void setId(String id) { this.id = id; } - - public String getName() { return name; } - public void setName(String name) { this.name = name; } - - public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - - public String getPhoneNumber() { return phoneNumber; } - public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } - - public String getBalance() { return balance; } - public void setBalance(String balance) { this.balance = balance; } - - public String getRechargeAmount() { return rechargeAmount; } - public void setRechargeAmount(String rechargeAmount) { - this.rechargeAmount = rechargeAmount; - } - - public String getSecondaryRechargeAmount() { return secondaryRechargeAmount; } - public void setSecondaryRechargeAmount(String secondaryRechargeAmount) { - this.secondaryRechargeAmount = secondaryRechargeAmount; - } - - public String getRechargeThreshold() { return rechargeThreshold; } - public void setRechargeThreshold(String rechargeThreshold) { - this.rechargeThreshold = rechargeThreshold; - } - - public List getChildren() { return children; } - public void setChildren(List children) { this.children = children; } - - // retrieve - public static User retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static User retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(User.class, id), - null, User.class, apiKey); - } - - // retrieve me - public static User retrieveMe() throws EasyPostException { - return retrieveMe(null); - } - public static User retrieveMe(String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(User.class), null, User.class, apiKey); - } - - // create - public static User create() throws EasyPostException { - return create(null, null); - } - public static User create(Map params) throws EasyPostException { - return create(params, null); - } - public static User create(Map params, String apiKey) - throws EasyPostException - { - Map wrappedParams = new HashMap(); - wrappedParams.put("user", params); - - return request(RequestMethod.POST, classURL(User.class), wrappedParams, - User.class, apiKey, false); - } - - // update - public User update(Map params) throws EasyPostException { - return update(params, null); - } - public User update(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("user", params); - - User response = request(RequestMethod.PUT, - instanceURL(User.class, this.getId()), - wrappedParams, User.class, apiKey); - - this.merge(this, response); - return this; - } - - // delete - public void delete() throws EasyPostException { - this.delete(null); - } - public void delete(String apiKey) throws EasyPostException { - request(RequestMethod.DELETE, instanceURL(User.class, this.getId()), null, User.class, apiKey); - } - - // api keys - public List apiKeys() throws EasyPostException { - ApiKeys parentKeys = ApiKeys.all(); - - if (this.getId() == parentKeys.getId()) { - return parentKeys.getKeys(); - } - - for(int i=0; i < parentKeys.children.size(); i++) { - if(this.getId().equals(parentKeys.children.get(i).getId())) { - return parentKeys.children.get(i).getKeys(); - } - } - - throw new EasyPostException("Unable to find api key. Please contact support@easypost.com"); - } +public class User extends BaseUser { } - diff --git a/src/main/java/com/easypost/model/Webhook.java b/src/main/java/com/easypost/model/Webhook.java index ab50c6d2c..4e6ca3218 100644 --- a/src/main/java/com/easypost/model/Webhook.java +++ b/src/main/java/com/easypost/model/Webhook.java @@ -1,100 +1,12 @@ package com.easypost.model; import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import com.easypost.exception.EasyPostException; -import com.easypost.net.EasyPostResource; - -public class Webhook extends EasyPostResource { - public String id; - String mode; - String url; - Date disabledAt; - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } - - public String getUrl() { - return url; - } - public void setUrl(String url) { - this.url = url; - } - - public Date getDisabledAt() { - return disabledAt; - } - public void setDisabledAt(Date disabledAt) { - this.disabledAt = disabledAt; - } - - // create - public static Webhook create(Map params) throws EasyPostException { - return create(params, null); - } - public static Webhook create(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("webhook", params); - - return request(RequestMethod.POST, classURL(Webhook.class), wrappedParams, Webhook.class, apiKey); - } - - // retrieve - public static Webhook retrieve(String id) throws EasyPostException { - return retrieve(id, null); - } - public static Webhook retrieve(String id, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, instanceURL(Webhook.class, id), null, Webhook.class, apiKey); - } - - // all - public static WebhookCollection all() throws EasyPostException { - Map params = new HashMap(); - return all(params, null); - } - public static WebhookCollection all(Map params) throws EasyPostException { - return all(params, null); - } - public static WebhookCollection all(Map params, String apiKey) throws EasyPostException { - return request(RequestMethod.GET, classURL(Webhook.class), params, WebhookCollection.class, apiKey); - } - - // delete - public void delete() throws EasyPostException { - this.delete(null); - } - public void delete(String apiKey) throws EasyPostException { - request(RequestMethod.DELETE, instanceURL(Webhook.class, this.getId()), null, Webhook.class, apiKey); - } - - // update - public Webhook update() throws EasyPostException { - Map params = new HashMap(); - return this.update(params, null); - } - public Webhook update(Map params) throws EasyPostException { - return this.update(params, null); - } - public Webhook update(Map params, String apiKey) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("webhook", params); - - Webhook response = request(RequestMethod.PUT, instanceURL(Webhook.class, this.getId()), wrappedParams, Webhook.class, apiKey); - - this.merge(this, response); - return this; - } -} \ No newline at end of file +import java.util.List; +import lombok.Getter; + +@Getter +public final class Webhook extends EasyPostResource { + private String url; + private Date disabledAt; + private List customHeaders; +} diff --git a/src/main/java/com/easypost/model/WebhookCollection.java b/src/main/java/com/easypost/model/WebhookCollection.java deleted file mode 100644 index edc94d9c1..000000000 --- a/src/main/java/com/easypost/model/WebhookCollection.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.easypost.model; - -import java.util.List; -import com.easypost.net.EasyPostResource; - -public class WebhookCollection extends EasyPostResource { - List webhooks; - - public List getWebhooks() { - return webhooks; - } - public void setWebhooks(List webhooks) { - this.webhooks = webhooks; - } -} diff --git a/src/main/java/com/easypost/model/WebhookCustomHeader.java b/src/main/java/com/easypost/model/WebhookCustomHeader.java new file mode 100644 index 000000000..ebe359938 --- /dev/null +++ b/src/main/java/com/easypost/model/WebhookCustomHeader.java @@ -0,0 +1,9 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public final class WebhookCustomHeader { + private String name; + private String value; +} diff --git a/src/main/java/com/easypost/model/WebhookDeserializer.java b/src/main/java/com/easypost/model/WebhookDeserializer.java new file mode 100644 index 000000000..9e1a02d1e --- /dev/null +++ b/src/main/java/com/easypost/model/WebhookDeserializer.java @@ -0,0 +1,42 @@ +package com.easypost.model; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +import com.easypost.Constants; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +public final class WebhookDeserializer implements JsonDeserializer { + /** + * Deserialize a list of Webhook from a JSON object. + * + * @param json JSON object to deserialize. + * @param typeOfT Type of the object to deserialize. + * @param context Deserialization context. + * @return Deserialized Webhook object. + * @throws JsonParseException if the JSON object is not a valid Webhook. + */ + @Override + public Webhook[] deserialize(final JsonElement json, final Type typeOfT, + final JsonDeserializationContext context) throws JsonParseException { + JsonObject jo = json.getAsJsonObject(); + JsonElement results = jo.get("webhooks"); + + if (results == null || !results.isJsonArray()) { + return new Webhook[0]; + } + + List webhooksList = new ArrayList<>(); + for (JsonElement element : results.getAsJsonArray()) { + Webhook webhook = Constants.Http.GSON.fromJson(element, Webhook.class); + webhooksList.add(webhook); + } + + return webhooksList.toArray(new Webhook[0]); + } +} diff --git a/src/main/java/com/easypost/model/package-info.java b/src/main/java/com/easypost/model/package-info.java new file mode 100644 index 000000000..f6fd4fa14 --- /dev/null +++ b/src/main/java/com/easypost/model/package-info.java @@ -0,0 +1,9 @@ +/** + * Classes for the EasyPost API. + * + * @author EasyPost developers + * @version 1.0 + * @see EasyPost API documentation + * @since 1.0 + */ +package com.easypost.model; diff --git a/src/main/java/com/easypost/net/EasyPostResource.java b/src/main/java/com/easypost/net/EasyPostResource.java deleted file mode 100644 index 0d76cea50..000000000 --- a/src/main/java/com/easypost/net/EasyPostResource.java +++ /dev/null @@ -1,610 +0,0 @@ -package com.easypost.net; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Field; -import java.lang.reflect.Type; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLEncoder; -import java.net.URLStreamHandler; -import java.util.HashMap; -import java.util.Map; -import java.util.Scanner; -import java.util.List; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; - -import com.google.gson.FieldNamingPolicy; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.reflect.TypeToken; -import com.easypost.EasyPost; -import com.easypost.exception.EasyPostException; -import com.easypost.model.BatchStatus; -import com.easypost.model.Event; -import com.easypost.model.EventDeserializer; -import com.easypost.model.Fee; -import com.easypost.model.Rate; -import com.easypost.model.RateDeserializer; -import com.easypost.model.Shipment; -import com.easypost.model.TrackingDetail; - -public abstract class EasyPostResource { - - public static final Gson gson = new GsonBuilder() - .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) - .registerTypeAdapter(Event.class, new EventDeserializer()) - .registerTypeAdapter(Rate.class, new RateDeserializer()) - .create(); - - public static final Gson prettyPrintGson = new GsonBuilder(). - setPrettyPrinting(). - serializeNulls(). - setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES). - registerTypeAdapter(Event.class, new EventDeserializer()). - create(); - - @Override public String toString() { - - return (String) this.getIdString(); - } - - public String prettyPrint() { - return String.format( - "<%s@%s id=%s> JSON: %s", - this.getClass().getName(), - System.identityHashCode(this), - this.getIdString(), - prettyPrintGson.toJson(this)); - } - - private Object getIdString() { - try { - Field idField = this.getClass().getDeclaredField("id"); - return idField.get(this); - } catch (SecurityException e) { - return ""; - } catch (NoSuchFieldException e) { - return ""; - } catch (IllegalArgumentException e) { - return ""; - } catch (IllegalAccessException e) { - return ""; - } - } - - private static String className(Class clazz) { - return clazz.getSimpleName().replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase().replace("$", ""); - - } - - protected static String singleClassURL(Class clazz) { - return String.format("%s/%s", EasyPost.API_BASE, className(clazz)); - } - - protected static String classURL(Class clazz) { - String singleURL = singleClassURL(clazz); - if (singleURL.charAt(singleURL.length() - 1) == 's' || singleURL.charAt(singleURL.length() - 1) == 'h') { - return String.format("%ses", singleClassURL(clazz)); - } else { - return String.format("%ss", singleClassURL(clazz)); - } - } - - protected static String instanceURL(Class clazz, String id) { - return String.format("%s/%s", classURL(clazz), id); - } - - public void merge(EasyPostResource obj, EasyPostResource update) { - if (!obj.getClass().isAssignableFrom(update.getClass())) { - return; - } - - Method[] methods = obj.getClass().getMethods(); - - for (Method fromMethod: methods) { - if ((fromMethod.getDeclaringClass().equals(obj.getClass()) && fromMethod.getName().startsWith("get")) - || GLOBAL_FIELD_ACCESSORS.contains(fromMethod.getName())) { - - String fromName = fromMethod.getName(); - String toName = fromName.replace("get", "set"); - - try { - Object value = fromMethod.invoke(update, (Object[]) null); - if (value != null) { - Method toMethod = obj.getClass().getMethod(toName, fromMethod.getReturnType()); - toMethod.invoke(obj, value); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - - public static final String CHARSET = "UTF-8"; - - private static final String DNS_CACHE_TTL_PROPERTY_NAME = "networkaddress.cache.ttl"; - - - // Set this property to override your environment's default URLStreamHandler. - private static final String CUSTOM_URL_STREAM_HANDLER_PROPERTY_NAME = "com.easypost.net.customURLStreamHandler"; - - protected enum RequestMethod { - GET, POST, DELETE, PUT - } - - private static String urlEncodePair(String k, String v) throws UnsupportedEncodingException { - return String.format("%s=%s", URLEncoder.encode(k, CHARSET), URLEncoder.encode(v, CHARSET)); - } - - static Map getHeaders(String apiKey) { - Map headers = new HashMap(); - headers.put("Accept-Charset", CHARSET); - headers.put("User-Agent", String.format("EasyPost/v2 JavaClient/%s", EasyPost.VERSION)); - - if (apiKey == null) { - apiKey = EasyPost.apiKey; - } - - headers.put("Authorization", String.format("Bearer %s", apiKey)); - - // debug headers - String[] propertyNames = { "os.name", "os.version", "os.arch", - "java.version", "java.vendor", "java.vm.version", - "java.vm.vendor" }; - Map propertyMap = new HashMap(); - for (String propertyName : propertyNames) { - propertyMap.put(propertyName, System.getProperty(propertyName)); - } - propertyMap.put("lang", "Java"); - propertyMap.put("publisher", "EasyPost"); - headers.put("X-Client-User-Agent", gson.toJson(propertyMap)); - - return headers; - } - - private static javax.net.ssl.HttpsURLConnection createEasyPostConnection(String url, String apiKey) throws IOException { - URL easypostURL = null; - String customURLStreamHandlerClassName = System.getProperty(CUSTOM_URL_STREAM_HANDLER_PROPERTY_NAME, null); - if (customURLStreamHandlerClassName != null) { - // instantiate the custom handler provided - try { - Class clazz = (Class) Class.forName(customURLStreamHandlerClassName); - Constructor constructor = clazz.getConstructor(); - URLStreamHandler customHandler = constructor.newInstance(); - easypostURL = new URL(null, url, customHandler); - } catch (ClassNotFoundException e) { - throw new IOException(e); - } catch (SecurityException e) { - throw new IOException(e); - } catch (NoSuchMethodException e) { - throw new IOException(e); - } catch (IllegalArgumentException e) { - throw new IOException(e); - } catch (InstantiationException e) { - throw new IOException(e); - } catch (IllegalAccessException e) { - throw new IOException(e); - } catch (InvocationTargetException e) { - throw new IOException(e); - } - } else { - easypostURL = new URL(url); - } - javax.net.ssl.HttpsURLConnection conn = (javax.net.ssl.HttpsURLConnection) easypostURL.openConnection(); - conn.setConnectTimeout(20000); // 20 seconds - - int readTimeout; - if (EasyPost.readTimeout != 0) { - readTimeout = EasyPost.readTimeout; - } else{ - readTimeout = 40000; // 40 seconds by default - } - conn.setReadTimeout(readTimeout); - - conn.setUseCaches(false); - for (Map.Entry header : getHeaders(apiKey).entrySet()) { - conn.setRequestProperty(header.getKey(), header.getValue()); - } - - return conn; - } - - private static javax.net.ssl.HttpsURLConnection createGetConnection(String url, String query, String apiKey) throws IOException { - String getURL = String.format("%s?%s", url, query); - javax.net.ssl.HttpsURLConnection conn = createEasyPostConnection(getURL, apiKey); - conn.setRequestMethod("GET"); - return conn; - } - - private static javax.net.ssl.HttpsURLConnection createPostConnection(String url, String query, String apiKey) throws IOException { - javax.net.ssl.HttpsURLConnection conn = createEasyPostConnection(url, apiKey); - conn.setDoOutput(true); - conn.setRequestMethod("POST"); - conn.setRequestProperty("Content-Type", String.format("application/x-www-form-urlencoded;charset=%s", CHARSET)); - OutputStream output = null; - try { - output = conn.getOutputStream(); - output.write(query.getBytes(CHARSET)); - } finally { - if (output != null) { - output.close(); - } - } - return conn; - } - - private static javax.net.ssl.HttpsURLConnection createDeleteConnection(String url, String query, String apiKey) throws IOException { - String deleteUrl = String.format("%s?%s", url, query); - javax.net.ssl.HttpsURLConnection conn = createEasyPostConnection(deleteUrl, apiKey); - conn.setRequestMethod("DELETE"); - return conn; - } - - private static javax.net.ssl.HttpsURLConnection createPutConnection(String url, String query, String apiKey) throws IOException { - javax.net.ssl.HttpsURLConnection conn = createEasyPostConnection(url, apiKey); - conn.setDoOutput(true); - conn.setRequestMethod("PUT"); - conn.setRequestProperty("Content-Type", String.format("application/x-www-form-urlencoded;charset=%s", CHARSET)); - OutputStream output = null; - try { - output = conn.getOutputStream(); - output.write(query.getBytes(CHARSET)); - } finally { - if (output != null) { - output.close(); - } - } - return conn; - } - - private static String createQuery(Map params) throws UnsupportedEncodingException { - Map flatParams = flattenParams(params); - StringBuffer queryStringBuffer = new StringBuffer(); - for (Map.Entry entry : flatParams.entrySet()) { - queryStringBuffer.append("&"); - queryStringBuffer.append(urlEncodePair(entry.getKey(), entry.getValue())); - } - if (queryStringBuffer.length() > 0) { - queryStringBuffer.deleteCharAt(0); - } - return queryStringBuffer.toString(); - } - - private static Map flattenParams(Map params) { - if (params == null) { - return new HashMap(); - } - Map flatParams = new HashMap(); - for (Map.Entry entry : params.entrySet()) { - String key = entry.getKey(); - Object value = entry.getValue(); - if (value instanceof Map) { - Map flatNestedMap = new HashMap(); - Map nestedMap = (Map) value; - for (Map.Entry nestedEntry : nestedMap.entrySet()) { - flatNestedMap.put( - String.format("%s[%s]", key, nestedEntry.getKey()), - nestedEntry.getValue()); - } - flatParams.putAll(flattenParams(flatNestedMap)); - } else if (value instanceof List) { - Map flatNestedMap = new HashMap(); - List nestedList = (List) value; - for (int i = 0; i < nestedList.size(); i++) { - flatNestedMap.put( - String.format("%s[%s]", key, i), - nestedList.get(i)); - flatParams.putAll(flattenParams(flatNestedMap)); - } - } else if (value instanceof EasyPostResource) { - flatParams.put( - String.format("%s[%s]", key, "id"), - value.toString()); - - } else if (value != null) { - flatParams.put(key, value.toString()); - } - } - - // System.out.println(flatParams); - - return flatParams; - } - - // represents Errors returned as JSON - private static class ErrorContainer { - private EasyPostResource.Error error; - } - - private static class Error { - @SuppressWarnings("unused") - String type; - String message; - String code; - String param; - String error; - } - - private static String getResponseBody(InputStream responseStream) throws IOException { - String rBody = new Scanner(responseStream, CHARSET).useDelimiter("\\A").next(); - responseStream.close(); - return rBody; - } - - private static EasyPostResponse makeURLConnectionRequest(EasyPostResource.RequestMethod method, String url, String query, String apiKey) throws EasyPostException { - javax.net.ssl.HttpsURLConnection conn = null; - try { - switch (method) { - case GET: - conn = createGetConnection(url, query, apiKey); - break; - case POST: - conn = createPostConnection(url, query, apiKey); - break; - case DELETE: - conn = createDeleteConnection(url, query, apiKey); - break; - case PUT: - conn = createPutConnection(url, query, apiKey); - break; - default: - throw new EasyPostException( - String.format("Unrecognized HTTP method %s. Please contact EasyPost at support@easypost.com.", method)); - } - int rCode = conn.getResponseCode(); // sends the request - String rBody = null; - if (rCode == 204) { - rBody = ""; - } else if (rCode >= 200 && rCode < 300) { - rBody = getResponseBody(conn.getInputStream()); - } else { - rBody = getResponseBody(conn.getErrorStream()); - } - return new EasyPostResponse(rCode, rBody); - } catch (IOException e) { - throw new EasyPostException( - String.format( - "Could not connect to EasyPost (%s). " - + "Please check your internet connection and try again. If this problem persists," - + "please contact us at support@easypost.com.", EasyPost.API_BASE), e); - } finally { - if (conn != null) { - conn.disconnect(); - } - } - } - - protected static T request(EasyPostResource.RequestMethod method, String url, Map params, Class clazz, String apiKey) throws EasyPostException { - return request(method, url, params, clazz, apiKey, true); - } - - protected static T request(EasyPostResource.RequestMethod method, String url, Map params, Class clazz, String apiKey, boolean apiKeyRequired) throws EasyPostException { - String originalDNSCacheTTL = null; - Boolean allowedToSetTTL = true; - try { - originalDNSCacheTTL = java.security.Security.getProperty(DNS_CACHE_TTL_PROPERTY_NAME); - // disable DNS cache - java.security.Security.setProperty(DNS_CACHE_TTL_PROPERTY_NAME, "0"); - } catch (SecurityException se) { - allowedToSetTTL = false; - } - - try { - return _request(method, url, params, clazz, apiKey, apiKeyRequired); - } finally { - if (allowedToSetTTL) { - if (originalDNSCacheTTL == null) { - // value unspecified by implementation - java.security.Security.setProperty(DNS_CACHE_TTL_PROPERTY_NAME, "-1"); // cache forever - } else { - java.security.Security.setProperty(DNS_CACHE_TTL_PROPERTY_NAME, originalDNSCacheTTL); - } - } - } - } - - protected static T _request(EasyPostResource.RequestMethod method, String url, Map params, Class clazz, String apiKey, boolean apiKeyRequired) throws EasyPostException { - if ((EasyPost.apiKey == null || EasyPost.apiKey.length() == 0) && (apiKey == null || apiKey.length() == 0)) { - if (apiKeyRequired) { - throw new EasyPostException( - "No API key provided. (set your API key using 'EasyPost.apiKey = {KEY}'. " - + "Your API key can be found in your EasyPost dashboard, or you can email us at support@easypost.com for assistance."); - - } - } - - if (apiKey == null) { - apiKey = EasyPost.apiKey; - } - - String query; - try { - query = createQuery(params); - } catch (UnsupportedEncodingException e) { - throw new EasyPostException("Unable to encode parameters to " - + CHARSET - + ". Please email support@easypost.com for assistance.", e); - } - - // System.out.println(url); - - EasyPostResponse response; - try { - // HTTPSURLConnection verifies SSL cert by default - response = makeURLConnectionRequest(method, url, query, apiKey); - } catch (ClassCastException ce) { - // appengine - String appEngineEnv = System.getProperty("com.google.appengine.runtime.environment", null); - if (appEngineEnv != null) { - response = makeAppEngineRequest(method, url, query, apiKey); - } else { - throw ce; - } - } - int rCode = response.responseCode; - String rBody = response.responseBody; - if (rCode < 200 || rCode >= 300) { - handleAPIError(rBody, rCode); - } - - return gson.fromJson(rBody, clazz); - } - - private static void handleAPIError(String rBody, int rCode) throws EasyPostException { - try { - EasyPostResource.Error error = gson.fromJson(rBody, EasyPostResource.Error.class); - - if(error.error.length() > 0) { - throw new EasyPostException(error.error); - } - - throw new EasyPostException(error.message, error.param, null); - } catch (Exception e) { - throw new EasyPostException(String.format("An error occured. Response code: %s Response body: %s", rCode, rBody)); - } - } - - private static EasyPostResponse makeAppEngineRequest(RequestMethod method, String url, String query, String apiKey) throws EasyPostException { - String unknownErrorMessage = "Sorry, an unknown error occurred while trying to use the " - + "Google App Engine runtime. Please email support@easypost.com for assistance."; - try { - if (method == RequestMethod.GET || method == RequestMethod.DELETE) { - url = String.format("%s?%s", url, query); - } - URL fetchURL = new URL(url); - - Class requestMethodClass = Class.forName("com.google.appengine.api.urlfetch.HTTPMethod"); - Object httpMethod = requestMethodClass.getDeclaredField(method.name()).get(null); - - Class fetchOptionsBuilderClass = Class.forName("com.google.appengine.api.urlfetch.FetchOptions$Builder"); - Object fetchOptions = null; - try { - fetchOptions = fetchOptionsBuilderClass.getDeclaredMethod("validateCertificate").invoke(null); - } catch (NoSuchMethodException e) { - System.err - .println("Warning: this App Engine SDK version does not allow verification of SSL certificates;" - + "this exposes you to a MITM attack. Please upgrade your App Engine SDK to >=1.5.0. " - + "If you have questions, email support@easypost.com."); - fetchOptions = fetchOptionsBuilderClass.getDeclaredMethod("withDefaults").invoke(null); - } - - Class fetchOptionsClass = Class.forName("com.google.appengine.api.urlfetch.FetchOptions"); - - // Heroku times out after 30s, so leave some time for the API to return a response - fetchOptionsClass.getDeclaredMethod("setDeadline", java.lang.Double.class).invoke(fetchOptions, new Double(20)); - - Class requestClass = Class.forName("com.google.appengine.api.urlfetch.HTTPRequest"); - - Object request = requestClass.getDeclaredConstructor(URL.class, requestMethodClass, fetchOptionsClass).newInstance(fetchURL, httpMethod, fetchOptions); - - if (method == RequestMethod.POST) { - requestClass.getDeclaredMethod("setPayload", byte[].class).invoke(request, query.getBytes()); - } - - for (Map.Entry header : getHeaders(apiKey).entrySet()) { - Class httpHeaderClass = Class.forName("com.google.appengine.api.urlfetch.HTTPHeader"); - Object reqHeader = httpHeaderClass.getDeclaredConstructor(String.class, String.class).newInstance(header.getKey(), header.getValue()); - requestClass.getDeclaredMethod("setHeader", httpHeaderClass).invoke(request, reqHeader); - } - - Class urlFetchFactoryClass = Class.forName("com.google.appengine.api.urlfetch.URLFetchServiceFactory"); - Object urlFetchService = urlFetchFactoryClass.getDeclaredMethod("getURLFetchService").invoke(null); - - Method fetchMethod = urlFetchService.getClass().getDeclaredMethod("fetch", requestClass); - fetchMethod.setAccessible(true); - Object response = fetchMethod.invoke(urlFetchService, request); - - int responseCode = (Integer) response.getClass().getDeclaredMethod("getResponseCode").invoke(response); - String body = new String((byte[]) response.getClass().getDeclaredMethod("getContent").invoke(response), CHARSET); - - return new EasyPostResponse(responseCode, body); - - } catch (InvocationTargetException e) { - throw new EasyPostException(unknownErrorMessage, e); - } catch (MalformedURLException e) { - throw new EasyPostException(unknownErrorMessage, e); - } catch (NoSuchFieldException e) { - throw new EasyPostException(unknownErrorMessage, e); - } catch (SecurityException e) { - throw new EasyPostException(unknownErrorMessage, e); - } catch (NoSuchMethodException e) { - throw new EasyPostException(unknownErrorMessage, e); - } catch (ClassNotFoundException e) { - throw new EasyPostException(unknownErrorMessage, e); - } catch (IllegalArgumentException e) { - throw new EasyPostException(unknownErrorMessage, e); - } catch (IllegalAccessException e) { - throw new EasyPostException(unknownErrorMessage, e); - } catch (InstantiationException e) { - throw new EasyPostException(unknownErrorMessage, e); - } catch (UnsupportedEncodingException e) { - throw new EasyPostException(unknownErrorMessage, e); - } - } - - public static final ArrayList GLOBAL_FIELD_ACCESSORS = new ArrayList<>(Arrays.asList("getCreatedAt", "getUpdatedAt", "getFees")); - Date CreatedAt; - Date UpdatedAt; - ArrayList fees; - - public Date getCreatedAt() { - return CreatedAt; - } - public void setCreatedAt(Date createdAt) { - CreatedAt = createdAt; - } - - public Date getUpdatedAt() { - return UpdatedAt; - } - public void setUpdatedAt(Date updatedAt) { - UpdatedAt = updatedAt; - } - - public ArrayList getFees() { - return fees; - } - public void setFees(ArrayList fees) { - this.fees = fees; - } - - public String getId() { - return ""; - } - public String getMode() { - return ""; - } - // Batch - public List getShipments() { - return new ArrayList(); - } - // public BatchStatus getStatus() { - // return new BatchStatus(); - // } - public String getLabelUrl() { - return ""; - } - // Tracker - public String getShipmentId() { - return ""; - } - public String getTrackingCode() { - return ""; - } - public String getStatus() { - return ""; - } - public List getTrackingDetails() { - return new ArrayList(); - } - -} diff --git a/src/main/java/com/easypost/net/EasyPostResponse.java b/src/main/java/com/easypost/net/EasyPostResponse.java deleted file mode 100644 index 58f8dc522..000000000 --- a/src/main/java/com/easypost/net/EasyPostResponse.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.easypost.net; - -public class EasyPostResponse { - - int responseCode; - String responseBody; - - public EasyPostResponse(int responseCode, String responseBody) { - this.responseCode = responseCode; - this.responseBody = responseBody; - - // System.out.println(this.responseBody); - } - - public int getResponseCode() { - return responseCode; - } - - public void setResponseCode(int responseCode) { - this.responseCode = responseCode; - } - - public String getResponseBody() { - return responseBody; - } - - public void setResponseBody(String responseBody) { - this.responseBody = responseBody; - } -} diff --git a/src/main/java/com/easypost/package-info.java b/src/main/java/com/easypost/package-info.java new file mode 100644 index 000000000..b174dcf4e --- /dev/null +++ b/src/main/java/com/easypost/package-info.java @@ -0,0 +1,9 @@ +/** + * Interact with the EasyPost API in Java. + * + * @author EasyPost developers + * @version 1.0 + * @see EasyPost API documentation + * @since 1.0 + */ +package com.easypost; diff --git a/src/main/java/com/easypost/service/AddressService.java b/src/main/java/com/easypost/service/AddressService.java new file mode 100644 index 000000000..1ad0697c5 --- /dev/null +++ b/src/main/java/com/easypost/service/AddressService.java @@ -0,0 +1,150 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.Address; +import com.easypost.model.AddressCollection; +import com.easypost.model.AddressVerifyResponse; +import lombok.SneakyThrows; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +public class AddressService { + private final EasyPostClient client; + + /** + * AddressService constructor. + * + * @param client The client object. + */ + AddressService(EasyPostClient client) { + this.client = client; + } + + /** + * Create Address object from parameter map. + * + * @param params Map of address parameters. + * @return Address object. + * @throws EasyPostException when the request fails. + */ + public Address create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + + if (params.containsKey("verify")) { + wrappedParams.put("verify", params.remove("verify")); + } + + if (params.containsKey("verify_strict")) { + wrappedParams.put("verify_strict", params.remove("verify_strict")); + } + + if (params.containsKey("verify_carrier")) { + wrappedParams.put("verify_carrier", params.remove("verify_carrier")); + } + + wrappedParams.put("address", params); + + String endpoint = "addresses"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Address.class, client); + } + + /** + * Retrieve Address object from API. + * + * @param id ID of address to retrieve. + * @return Address object. + * @throws EasyPostException when the request fails. + */ + public Address retrieve(final String id) throws EasyPostException { + String endpoint = "addresses/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Address.class, client); + } + + /** + * List all Address objects. + * + * @param params Map of parameters. + * @return AddressCollection object. + * @throws EasyPostException when the request fails. + */ + public AddressCollection all(final Map params) throws EasyPostException { + String endpoint = "addresses"; + + return Requestor.request(RequestMethod.GET, endpoint, params, AddressCollection.class, client); + } + + /** + * Get the next page of an AddressCollection. + * + * @param collection AddressCollection to get next page of. + * @return AddressCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public AddressCollection getNextPage(AddressCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an AddressCollection. + * + * @param collection AddressCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return AddressCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public AddressCollection getNextPage(AddressCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, AddressCollection>() { + @Override @SneakyThrows + public AddressCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getAddresses(), pageSize); + } + + /** + * Create Address object from parameter map and immediately verify it. + * + * @param params Map of address parameters. + * @return Address object. + * @throws EasyPostException when the request fails. + */ + public Address createAndVerify(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + + if (params.containsKey("verify_carrier")) { + wrappedParams.put("verify_carrier", params.remove("verify_carrier")); + } + + wrappedParams.put("address", params); + + String endpoint = "addresses/create_and_verify"; + + AddressVerifyResponse response = + Requestor.request(RequestMethod.POST, endpoint, wrappedParams, AddressVerifyResponse.class, client); + + return response.getAddress(); + } + + /** + * Verify this Address object. + * + * @param id The ID of address. + * @return Address object. + * @throws EasyPostException when the request fails. + */ + public Address verify(String id) throws EasyPostException { + String endpoint = "addresses/" + id + "/verify"; + + AddressVerifyResponse response = + Requestor.request(RequestMethod.GET, endpoint, null, AddressVerifyResponse.class, client); + + return response.getAddress(); + } +} diff --git a/src/main/java/com/easypost/service/ApiKeyService.java b/src/main/java/com/easypost/service/ApiKeyService.java new file mode 100644 index 000000000..20ca357a3 --- /dev/null +++ b/src/main/java/com/easypost/service/ApiKeyService.java @@ -0,0 +1,114 @@ +package com.easypost.service; + +import com.easypost.Constants; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.FilteringError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.ApiKey; +import com.easypost.model.ApiKeys; + +import java.util.List; +import java.util.Objects; + +public class ApiKeyService { + private final EasyPostClient client; + + /** + * ApiKeyService constructor. + * + * @param client The client object. + */ + ApiKeyService(EasyPostClient client) { + this.client = client; + } + + /** + * Get this User's API keys. + * + * @param id The ID of the user. + * @return List of ApiKey objects. + * @throws EasyPostException when the request fails. + */ + public List retrieveApiKeysForUser(final String id) throws EasyPostException { + ApiKeys parentKeys = all(); + + if (Objects.equals(id, parentKeys.getId())) { + return parentKeys.getKeys(); + } + + for (int i = 0; i < parentKeys.getChildren().size(); i++) { + if (id.equals(parentKeys.getChildren().get(i).getId())) { + return parentKeys.getChildren().get(i).getKeys(); + } + } + + throw new FilteringError(String.format(Constants.ErrorMessages.NO_OBJECT_FOUND, "API keys")); + } + + /** + * Get all API keys. + * + * @return ApiKeys object. + * @throws EasyPostException when the request fails. + */ + public ApiKeys all() throws EasyPostException { + String endpoint = "api_keys"; + + return Requestor.request(RequestMethod.GET, endpoint, null, ApiKeys.class, client); + } + + /** + * Create an API key for a child or referral customer user. + * + * @param mode The mode of the API key (production or test). + * @return ApiKey object. + * @throws EasyPostException when the request fails. + */ + public ApiKey create(final String mode) throws EasyPostException { + String endpoint = "api_keys"; + + java.util.Map params = new java.util.HashMap<>(); + params.put("mode", mode); + + return Requestor.request(RequestMethod.POST, endpoint, params, ApiKey.class, client); + } + + /** + * Delete an API key for a child or referral customer user. + * + * @param id The ID of the API key to delete. + * @throws EasyPostException when the request fails. + */ + public void delete(final String id) throws EasyPostException { + String endpoint = String.format("api_keys/%s", id); + + Requestor.request(RequestMethod.DELETE, endpoint, null, ApiKey.class, client); + } + + /** + * Enable a child or referral customer API key. + * + * @param id The ID of the API key to enable. + * @return ApiKey object. + * @throws EasyPostException when the request fails. + */ + public ApiKey enable(final String id) throws EasyPostException { + String endpoint = String.format("api_keys/%s/enable", id); + + return Requestor.request(RequestMethod.POST, endpoint, null, ApiKey.class, client); + } + + /** + * Disable a child or referral customer API key. + * + * @param id The ID of the API key to disable. + * @return ApiKey object. + * @throws EasyPostException when the request fails. + */ + public ApiKey disable(final String id) throws EasyPostException { + String endpoint = String.format("api_keys/%s/disable", id); + + return Requestor.request(RequestMethod.POST, endpoint, null, ApiKey.class, client); + } +} diff --git a/src/main/java/com/easypost/service/BatchService.java b/src/main/java/com/easypost/service/BatchService.java new file mode 100644 index 000000000..979bdbe81 --- /dev/null +++ b/src/main/java/com/easypost/service/BatchService.java @@ -0,0 +1,202 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.Batch; +import com.easypost.model.BatchCollection; +import com.easypost.model.Shipment; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class BatchService { + private final EasyPostClient client; + + /** + * BatchService constructor. + * + * @param client The client object. + */ + BatchService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a Batch object. + * + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch create() throws EasyPostException { + return create(null); + } + + /** + * Create a Batch object. + * + * @param params Map of parameters. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("batch", params); + + String endpoint = "batches"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Batch.class, client); + } + + /** + * Retrieve a Batch object from the API. + * + * @param id ID of the Batch to retrieve. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch retrieve(final String id) throws EasyPostException { + String endpoint = "batches/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Batch.class, client); + } + + /** + * List all Batch objects. + * + * @param params Map of parameters. + * @return BatchCollection object. + * @throws EasyPostException when the request fails. + */ + public BatchCollection all(final Map params) throws EasyPostException { + String endpoint = "batches"; + + return Requestor.request(RequestMethod.GET, endpoint, params, BatchCollection.class, client); + } + + // TODO: Add getNextPage function when Batches are sorted newest to oldest. + + /** + * Label this Batch object. + * + * @param id The ID of batch. + * @param params Map of parameters. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch label(final String id, final Map params) throws EasyPostException { + String endpoint = "batches/" + id + "/label"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Batch.class, client); + } + + /** + * Add shipments to this Batch object. + * + * @param id The ID of batch. + * @param params Map of parameters. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch addShipments(final String id, final Map params) throws EasyPostException { + String endpoint = "batches/" + id + "/add_shipments"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Batch.class, client); + } + + /** + * Add shipments to this Batch object. + * + * @param id The ID of batch. + * @param shipments List of Shipment objects. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch addShipments(final String id, final List shipments) throws EasyPostException { + Map params = new HashMap(); + params.put("shipments", shipments); + + return this.addShipments(id, params); + } + + /** + * Remove shipments from this Batch object. + * + * @param id The ID of batch. + * @param params Map of parameters. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch removeShipments(final String id, final Map params) throws EasyPostException { + String endpoint = "batches/" + id + "/remove_shipments"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Batch.class, + client); + } + + /** + * Remove shipments from this Batch object. + * + * @param id The ID of batch. + * @param shipments List of Shipment objects. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch removeShipments(final String id, final List shipments) throws EasyPostException { + Map params = new HashMap(); + params.put("shipments", shipments); + + return this.removeShipments(id, params); + } + + /** + * Buy this batch. + * + * @param id The ID of batch. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch buy(final String id) throws EasyPostException { + return this.buy(id, null); + } + + /** + * Buy this batch. + * + * @param id The ID of batch. + * @param params Map of parameters. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch buy(final String id, final Map params) throws EasyPostException { + String endpoint = "batches/" + id + "/buy"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Batch.class, client); + } + + /** + * Create a scan form for this batch. + * + * @param id The ID of batch. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch createScanForm(final String id) throws EasyPostException { + return this.createScanForm(id, null); + } + + /** + * Create a scan form for this batch. + * + * @param id The ID of batch. + * @param params Map of parameters. + * @return Batch object. + * @throws EasyPostException when the request fails. + */ + public Batch createScanForm(final String id, final Map params) throws EasyPostException { + String endpoint = "batches/" + id + "/scan_form"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Batch.class, client); + } +} diff --git a/src/main/java/com/easypost/service/BetaRateService.java b/src/main/java/com/easypost/service/BetaRateService.java new file mode 100644 index 000000000..7650f6a7f --- /dev/null +++ b/src/main/java/com/easypost/service/BetaRateService.java @@ -0,0 +1,40 @@ +package com.easypost.service; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.StatelessRate; + +public class BetaRateService { + private final EasyPostClient client; + + /** + * BetaRateService constructor. + * + * @param client The client object. + */ + BetaRateService(EasyPostClient client) { + this.client = client; + } + + /** + * List all StatelessRate objects. + * + * @param params Map of parameters. + * @return List of StatelessRate objects. + * @throws EasyPostException when the request fails. + */ + public List retrieveStatelessRates(HashMap params) throws EasyPostException { + HashMap wrappedParams = new HashMap(); + wrappedParams.put("shipment", params); + + StatelessRate[] statelessRates = Requestor.request(RequestMethod.POST, "rates", wrappedParams, + StatelessRate[].class, client, "beta"); + + return Arrays.asList(statelessRates); + } +} diff --git a/src/main/java/com/easypost/service/BetaReferralCustomerService.java b/src/main/java/com/easypost/service/BetaReferralCustomerService.java new file mode 100644 index 000000000..e76704b8d --- /dev/null +++ b/src/main/java/com/easypost/service/BetaReferralCustomerService.java @@ -0,0 +1,136 @@ +package com.easypost.service; + +import java.util.HashMap; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.BetaPaymentRefund; +import com.easypost.model.ClientSecret; +import com.easypost.model.PaymentMethod; +import com.easypost.model.PaymentMethodObject; + +public class BetaReferralCustomerService { + private final EasyPostClient client; + + /** + * BetaReferralCustomerService constructor. + * + * @param client The client object. + */ + BetaReferralCustomerService(EasyPostClient client) { + this.client = client; + } + + /** + * Add Stripe payment method to referral customer. + * + * @param stripeCustomerId ID of the Stripe account. + * @param paymentMethodReference Reference of Stripe payment method. + * @return PaymentMethodObject object. + * @throws EasyPostException When the request fails. + */ + public PaymentMethodObject addPaymentMethod(String stripeCustomerId, String paymentMethodReference) + throws EasyPostException { + return addPaymentMethod(stripeCustomerId, paymentMethodReference, PaymentMethod.Priority.PRIMARY); + } + + /** + * Add Stripe payment method to referral customer. + * + * @param stripeCustomerId ID of the Stripe account. + * @param paymentMethodReference Reference of Stripe payment method. + * @param primaryOrSecondary Primary or secondary of this payment method. + * @return PaymentMethodObject object. + * @throws EasyPostException When the request fails. + */ + public PaymentMethodObject addPaymentMethod(String stripeCustomerId, String paymentMethodReference, + PaymentMethod.Priority primaryOrSecondary) throws EasyPostException { + HashMap params = new HashMap<>(); + params.put("stripe_customer_id", stripeCustomerId); + params.put("payment_method_reference", paymentMethodReference); + params.put("priority", primaryOrSecondary); + + HashMap wrappedParams = new HashMap<>(); + wrappedParams.put("payment_method", params); + + String endpoint = "referral_customers/payment_method"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, + PaymentMethodObject.class, client, "beta"); + } + + /** + * Refund by amount for a recent payment. + * + * @param refundAmount Amount to be refunded by cents. + * @return BetaPaymentRefund object. + * @throws EasyPostException When the request fails. + */ + public BetaPaymentRefund refundByAmount(int refundAmount) throws EasyPostException { + HashMap params = new HashMap<>(); + params.put("refund_amount", refundAmount); + + String endpoint = "referral_customers/refunds"; + + return Requestor.request(RequestMethod.POST, endpoint, params, + BetaPaymentRefund.class, client, "beta"); + } + + /** + * Refund a payment by a payment log ID. + * + * @param paymentLogId ID of the payment log. + * @return BetaPaymentRefund object. + * @throws EasyPostException When the request fails. + */ + public BetaPaymentRefund refundByPaymentLog(String paymentLogId) throws EasyPostException { + HashMap params = new HashMap<>(); + params.put("payment_log_id", paymentLogId); + + String endpoint = "referral_customers/refunds"; + + return Requestor.request(RequestMethod.POST, endpoint, params, + BetaPaymentRefund.class, client, "beta"); + } + + /** + * Creates a client secret to use with Stripe when adding a credit card. + * + * @return ClientSecret containing the client secret. + * @throws EasyPostException When the request fails. + */ + public ClientSecret createCreditCardClientSecret() throws EasyPostException { + String endpoint = "setup_intents"; + + return Requestor.request(RequestMethod.POST, endpoint, null, ClientSecret.class, client, "beta"); + } + + /** + * Creates a client secret to use with Stripe when adding a bank account. + * + * @return ClientSecret containing the client secret. + * @throws EasyPostException When the request fails. + */ + public ClientSecret createBankAccountClientSecret() throws EasyPostException { + return createBankAccountClientSecret(null); + } + + /** + * Creates a client secret to use with Stripe when adding a bank account. + * + * @param returnUrl Optional return URL for the bank account setup. + * @return ClientSecret containing the client secret. + * @throws EasyPostException When the request fails. + */ + public ClientSecret createBankAccountClientSecret(String returnUrl) throws EasyPostException { + HashMap params = new HashMap<>(); + if (returnUrl != null) { + params.put("return_url", returnUrl); + } + + String endpoint = "financial_connections_sessions"; + + return Requestor.request(RequestMethod.POST, endpoint, params, ClientSecret.class, client, "beta"); + } +} diff --git a/src/main/java/com/easypost/service/BillingService.java b/src/main/java/com/easypost/service/BillingService.java new file mode 100644 index 000000000..03561e90d --- /dev/null +++ b/src/main/java/com/easypost/service/BillingService.java @@ -0,0 +1,116 @@ +package com.easypost.service; + +import com.easypost.Constants; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.InvalidObjectError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.PaymentMethod; +import com.easypost.model.PaymentMethodObject; + +import java.util.HashMap; +import java.util.Map; + +public class BillingService { + private final EasyPostClient client; + + /** + * BillingService constructor. + * + * @param client The client object. + */ + BillingService(EasyPostClient client) { + this.client = client; + } + + /** + * Delete a payment method. + * + * @param priority Which type of payment method to delete. + * @throws EasyPostException when the request fails. + */ + public void deletePaymentMethod(PaymentMethod.Priority priority) throws EasyPostException { + PaymentMethodObject paymentMethodObject = getPaymentMethodByPriority(priority); + + String endpoint = paymentMethodObject.getEndpoint() + "/" + paymentMethodObject.getId(); + + // will attempt to serialize empty JSON to a PaymentMethod.class, that's fine + Requestor.request(RequestMethod.DELETE, endpoint, null, PaymentMethod.class, client); + } + + /** + * Fund your wallet from the primary payment method. + * + * @param amount Amount to fund. + * @throws EasyPostException when the request fails. + */ + public void fundWallet(String amount) throws EasyPostException { + fundWallet(amount, PaymentMethod.Priority.PRIMARY); + } + + /** + * Fund your wallet from a specific payment method. + * + * @param amount Amount to fund. + * @param priority which type of payment method to use to fund the wallet. + * @throws EasyPostException when the request fails. + */ + public void fundWallet(String amount, PaymentMethod.Priority priority) throws EasyPostException { + PaymentMethodObject paymentMethodObject = getPaymentMethodByPriority(priority); + + Map params = new HashMap<>(); + params.put("amount", amount); + + String endpoint = paymentMethodObject.getEndpoint() + "/" + paymentMethodObject.getId() + "/charges"; + + // will attempt to serialize empty JSON to a PaymentMethod.class, that's fine + Requestor.request(RequestMethod.POST, endpoint, params, PaymentMethod.class, client); + } + + /** + * List all payment methods for this account. + * + * @return an EasyPost.PaymentMethod summary object. + * @throws EasyPostException when the request fails or billing has not been set + * up. + */ + public PaymentMethod retrievePaymentMethods() throws EasyPostException { + String endpoint = "payment_methods"; + + PaymentMethod response = Requestor.request(RequestMethod.GET, endpoint, null, PaymentMethod.class, client); + + if (response.getId() == null) { + throw new InvalidObjectError(Constants.ErrorMessages.NO_PAYMENT_METHODS); + } + + return response; + } + + /** + * Get a payment method by priority. + * + * @param priority Which priority payment method to get. + * @return an EasyPost.PaymentMethodObject instance. + * @throws EasyPostException when the request fails. + */ + private PaymentMethodObject getPaymentMethodByPriority(PaymentMethod.Priority priority) throws EasyPostException { + PaymentMethod paymentMethods = retrievePaymentMethods(); + PaymentMethodObject paymentMethod = null; + switch (priority) { + case PRIMARY: + paymentMethod = paymentMethods.getPrimaryPaymentMethod(); + break; + case SECONDARY: + paymentMethod = paymentMethods.getSecondaryPaymentMethod(); + break; + default: + break; + } + + if (paymentMethod == null || paymentMethod.getId() == null) { + throw new InvalidObjectError(Constants.ErrorMessages.NO_PAYMENT_METHODS); + } + + return paymentMethod; + } +} diff --git a/src/main/java/com/easypost/service/CarrierAccountService.java b/src/main/java/com/easypost/service/CarrierAccountService.java new file mode 100644 index 000000000..9c4329188 --- /dev/null +++ b/src/main/java/com/easypost/service/CarrierAccountService.java @@ -0,0 +1,148 @@ +package com.easypost.service; + +import com.easypost.Constants; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.MissingParameterError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.CarrierAccount; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CarrierAccountService { + private final EasyPostClient client; + + /** + * CarrierAccountService constructor. + * + * @param client The client object. + */ + CarrierAccountService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a carrier account. + * + * @param params Map of parameters to create. + * @return created CarrierAccount object. + * @throws EasyPostException when the request fails. + */ + public CarrierAccount create(final Map params) throws EasyPostException { + String type = (String) params.get("type"); + Map wrappedParams = new HashMap(); + wrappedParams.put(selectTopLayerKey(type), params); + String endpoint = selectCarrierAccountCreationEndpoint(type); + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, CarrierAccount.class, client); + } + + /** + * Retrieve a carrier account from the API. + * + * @param id id of the carrier account. + * @return CarrierAccount object. + * @throws EasyPostException when the request fails. + */ + public CarrierAccount retrieve(final String id) throws EasyPostException { + String endpoint = "carrier_accounts/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, CarrierAccount.class, client); + } + + /** + * List all carrier accounts. + * + * @return List of CarrierAccount objects. + * @throws EasyPostException when the request fails. + */ + public List all() throws EasyPostException { + return all(null); + } + + /** + * List all carrier accounts. + * + * @param params filters to apply to the list. + * @return List of CarrierAccount objects. + * @throws EasyPostException when the request fails. + */ + public List all(final Map params) throws EasyPostException { + String endpoint = "carrier_accounts"; + + CarrierAccount[] response = + Requestor.request(RequestMethod.GET, endpoint, params, CarrierAccount[].class, client); + + return Arrays.asList(response); + } + + /** + * Update this carrier account. + * + * @param id The ID of carrier account + * @param params parameters to update. + * @return updated CarrierAccount object. + * @throws EasyPostException when the request fails. + */ + public CarrierAccount update(String id, final Map params) throws EasyPostException { + String endpoint = "carrier_accounts/" + id; + Map wrappedParams = new HashMap(); + wrappedParams.put("carrier_account", params); + + return Requestor.request(RequestMethod.PUT, endpoint, wrappedParams, CarrierAccount.class, + client); + } + + /** + * Delete this carrier account. + * + * @param id The ID of carrier account. + * @throws EasyPostException when the request fails. + */ + public void delete(String id) throws EasyPostException { + String endpoint = "carrier_accounts/" + id; + + Requestor.request(RequestMethod.DELETE, endpoint, null, CarrierAccount.class, client); + } + + /** + * Select the endpoint for the carrier account creation request based on the + * carrier type. + * + * @param carrierAccountType The type of carrier account to create. + * @return The endpoint for the carrier account creation request. + */ + private static String selectCarrierAccountCreationEndpoint(final String carrierAccountType) { + if (Constants.CarrierAccountTypes.CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOW.contains(carrierAccountType)) { + return "carrier_accounts/register"; + } else if (Constants.CarrierAccountTypes.CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH.contains(carrierAccountType)) { + return "carrier_accounts/register_oauth"; + } else { + return "carrier_accounts"; + } + } + + /** + * Select the top-layer key for the carrier account creation/update request based on the + * carrier type. + * + * @param carrierAccountType The type of carrier account to create. + * @return The top-layer key for the carrier account creation/update request. + * @throws MissingParameterError when the request fails. + */ + private static String selectTopLayerKey(final String carrierAccountType) throws MissingParameterError { + if (carrierAccountType == null) { + throw new MissingParameterError( + String.format(Constants.ErrorMessages.MISSING_REQUIRED_PARAMETER, "carrier account type")); + } + + if (Constants.CarrierAccountTypes.CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH.contains(carrierAccountType)) { + return "carrier_account_oauth_registrations"; + } else { + return "carrier_account"; + } + } +} diff --git a/src/main/java/com/easypost/service/CarrierMetadataService.java b/src/main/java/com/easypost/service/CarrierMetadataService.java new file mode 100644 index 000000000..df3466d7b --- /dev/null +++ b/src/main/java/com/easypost/service/CarrierMetadataService.java @@ -0,0 +1,66 @@ +package com.easypost.service; + +import java.util.HashMap; +import java.util.List; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.CarrierMetadata; + +public class CarrierMetadataService { + private final EasyPostClient client; + + /** + * CarrierMetadataService constructor. + * + * @param client The client object. + */ + CarrierMetadataService(EasyPostClient client) { + this.client = client; + } + + /** + * Retrieves all carrier metadata. + * + * @return CarrierMetadata object + * @throws EasyPostException When the request fails. + */ + public CarrierMetadata retrieve() throws EasyPostException { + return retrieve(null); + } + + /** + * Retrieves carrier metadata for given carriers. + * + * @param carriers The list of carriers in string. + * @return CarrierMetadata object + * @throws EasyPostException When the request fails. + */ + public CarrierMetadata retrieve(List carriers) throws EasyPostException { + return retrieve(carriers, null); + } + + /** + * Retrieves carrier metadata for given carriers and types. + * + * @param carriers The list of carriers in string. + * @param types The list of types in string. + * @return CarrierMetadata object + * @throws EasyPostException When the request fails. + */ + public CarrierMetadata retrieve(List carriers, List types) throws EasyPostException { + HashMap params = new HashMap<>(); + + if (carriers != null && !carriers.isEmpty()) { + params.put("carriers", String.join(",", carriers)); + } + + if (types != null && !types.isEmpty()) { + params.put("types", String.join(",", types)); + } + + return Requestor.request(RequestMethod.GET, "metadata/carriers", params, + CarrierMetadata.class, client); + } +} diff --git a/src/main/java/com/easypost/service/CarrierTypeService.java b/src/main/java/com/easypost/service/CarrierTypeService.java new file mode 100644 index 000000000..c937cc898 --- /dev/null +++ b/src/main/java/com/easypost/service/CarrierTypeService.java @@ -0,0 +1,35 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.CarrierType; + +import java.util.Arrays; +import java.util.List; + +public class CarrierTypeService { + private final EasyPostClient client; + + /** + * CarrierTypeService constructor. + * + * @param client The client object. + */ + CarrierTypeService(EasyPostClient client) { + this.client = client; + } + + /** + * Retrieve a list of available carriers for the given account. + * + * @return list of carrier types that are available for the given account. + * @throws EasyPostException when the request fails. + */ + public List all() throws EasyPostException { + String endpoint = "carrier_types"; + + CarrierType[] response = Requestor.request(RequestMethod.GET, endpoint, null, CarrierType[].class, client); + return Arrays.asList(response); + } +} diff --git a/src/main/java/com/easypost/service/ClaimService.java b/src/main/java/com/easypost/service/ClaimService.java new file mode 100644 index 000000000..e16a008b2 --- /dev/null +++ b/src/main/java/com/easypost/service/ClaimService.java @@ -0,0 +1,116 @@ +package com.easypost.service; + +import java.util.Map; +import java.util.function.Function; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.Claim; +import com.easypost.model.ClaimCollection; + +import lombok.SneakyThrows; + +public class ClaimService { + private final EasyPostClient client; + + /** + * ClaimService constructor. + * + * @param client The client object. + */ + ClaimService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a new claim object from a map of parameters. + * + * @param params Map of parameters. + * @return Claim object + * @throws EasyPostException when the request fails. + */ + public Claim create(final Map params) throws EasyPostException { + String endpoint = "claims"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Claim.class, client); + } + + /** + * Retrieve an Claim from the API. + * + * @param id The ID of the Claim to retrieve. + * @return Claim object + * @throws EasyPostException when the request fails. + */ + public Claim retrieve(final String id) throws EasyPostException { + String endpoint = "claims/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Claim.class, client); + } + + /** + * Get a list of Claims. + * + * @param params a map of parameters + * @return ClaimCollection object + * @throws EasyPostException when the request fails. + */ + public ClaimCollection all(final Map params) throws EasyPostException { + String type = (String) params.get("type"); + String status = (String) params.get("status"); + params.remove(type); + params.remove(status); + String endpoint = "claims"; + + ClaimCollection claimCollection = + Requestor.request(RequestMethod.GET, endpoint, params, ClaimCollection.class, client); + claimCollection.setType(type); + claimCollection.setType(status); + + return claimCollection; + } + + /** + * Cancel an Claim from the API. + * + * @param id The ID of the Claim to cancel. + * @return Claim object + * @throws EasyPostException when the request fails. + */ + public Claim cancel(final String id) throws EasyPostException { + String endpoint = String.format("claims/%s/cancel", id); + + return Requestor.request(RequestMethod.POST, endpoint, null, Claim.class, client); + } + + /** + * Get the next page of an ClaimCollection. + * + * @param collection ClaimCollection to get next page of. + * @return ClaimCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ClaimCollection getNextPage(ClaimCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an ClaimCollection. + * + * @param collection ClaimCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return ClaimCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ClaimCollection getNextPage( + ClaimCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, ClaimCollection>() { + @Override @SneakyThrows + public ClaimCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getClaims(), pageSize); + } +} diff --git a/src/main/java/com/easypost/service/CustomerPortalService.java b/src/main/java/com/easypost/service/CustomerPortalService.java new file mode 100644 index 000000000..b5b5488a6 --- /dev/null +++ b/src/main/java/com/easypost/service/CustomerPortalService.java @@ -0,0 +1,34 @@ +package com.easypost.service; + +import java.util.Map; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.CustomerPortalAccountLink; + +public class CustomerPortalService { + private final EasyPostClient client; + + /** + * CustomerPortalService constructor. + * + * @param client The client object. + */ + CustomerPortalService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a CustomerPortalAccountLink from the API. + * + * @param params Map of parameters. + * @return CustomerPortalAccountLink object + * @throws EasyPostException when the request fails. + */ + public CustomerPortalAccountLink createAccountLink(final Map params) throws EasyPostException { + String endpoint = "customer_portal/account_link"; + + return Requestor.request(RequestMethod.POST, endpoint, params, CustomerPortalAccountLink.class, client); + } +} diff --git a/src/main/java/com/easypost/service/CustomsInfoService.java b/src/main/java/com/easypost/service/CustomsInfoService.java new file mode 100644 index 000000000..965da8206 --- /dev/null +++ b/src/main/java/com/easypost/service/CustomsInfoService.java @@ -0,0 +1,51 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.CustomsInfo; + +import java.util.HashMap; +import java.util.Map; + +public class CustomsInfoService { + private final EasyPostClient client; + + /** + * CustomsInfoService constructor. + * + * @param client The client object. + */ + CustomsInfoService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a CustomsInfo from a map of parameters. + * + * @param params Map of parameters. + * @return CustomsInfo object. + * @throws EasyPostException when the request fails. + */ + public CustomsInfo create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("customs_info", params); + + String endpoint = "customs_infos"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, CustomsInfo.class, client); + } + + /** + * Retrieve a CustomsInfo from the API. + * + * @param id The ID of the CustomsInfo to retrieve. + * @return CustomsInfo object. + * @throws EasyPostException when the request fails. + */ + public CustomsInfo retrieve(final String id) throws EasyPostException { + String endpoint = "customs_infos/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, CustomsInfo.class, client); + } +} diff --git a/src/main/java/com/easypost/service/CustomsItemService.java b/src/main/java/com/easypost/service/CustomsItemService.java new file mode 100644 index 000000000..89394c824 --- /dev/null +++ b/src/main/java/com/easypost/service/CustomsItemService.java @@ -0,0 +1,51 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.CustomsItem; + +import java.util.HashMap; +import java.util.Map; + +public class CustomsItemService { + private final EasyPostClient client; + + /** + * CustomsItemService constructor. + * + * @param client The client object. + */ + CustomsItemService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a CustomsItem from a map of parameters. + * + * @param params Map of parameters. + * @return CustomsItem object. + * @throws EasyPostException when the request fails. + */ + public CustomsItem create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("customs_item", params); + + String endpoint = "customs_items"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, CustomsItem.class, client); + } + + /** + * Retrieve a CustomsItem from the API. + * + * @param id The ID of the CustomsItem to retrieve. + * @return CustomsItem object. + * @throws EasyPostException when the request fails. + */ + public CustomsItem retrieve(final String id) throws EasyPostException { + String endpoint = "customs_items/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, CustomsItem.class, client); + } +} diff --git a/src/main/java/com/easypost/service/EasyPostClient.java b/src/main/java/com/easypost/service/EasyPostClient.java new file mode 100644 index 000000000..8b21287f9 --- /dev/null +++ b/src/main/java/com/easypost/service/EasyPostClient.java @@ -0,0 +1,218 @@ +package com.easypost.service; + +import java.util.function.Function; + +import com.easypost.Constants; +import com.easypost.exception.General.MissingParameterError; +import com.easypost.hooks.RequestHook; +import com.easypost.hooks.RequestHookResponses; +import com.easypost.hooks.ResponseHook; +import com.easypost.hooks.ResponseHookResponses; + +import lombok.Getter; + +public class EasyPostClient { + private final int connectTimeoutMilliseconds; + private final int readTimeoutMilliseconds; + private final String clientApiKey; // API key for all EasyPost API requests + private final String apiVersion = "v2"; + private final String apiBase; + // Services + public final AddressService address = new AddressService(this); + public final ApiKeyService apiKey = new ApiKeyService(this); + public final BatchService batch = new BatchService(this); + public final BetaRateService betaRate = new BetaRateService(this); + public final BetaReferralCustomerService betaReferralCustomer = new BetaReferralCustomerService(this); + public final BillingService billing = new BillingService(this); + public final CarrierAccountService carrierAccount = new CarrierAccountService(this); + public final CarrierMetadataService carrierMetadata = new CarrierMetadataService(this); + public final FedExRegistrationService fedexRegistration = new FedExRegistrationService(this); + public final CarrierTypeService carrierType = new CarrierTypeService(this); + public final ClaimService claim = new ClaimService(this); + public final CustomerPortalService customerPortal = new CustomerPortalService(this); + public final CustomsInfoService customsInfo = new CustomsInfoService(this); + public final CustomsItemService customsItem = new CustomsItemService(this); + public final EmbeddableService embeddable = new EmbeddableService(this); + public final EndShipperService endShipper = new EndShipperService(this); + public final EventService event = new EventService(this); + public final InsuranceService insurance = new InsuranceService(this); + public final LumaService luma = new LumaService(this); + public final OrderService order = new OrderService(this); + public final ParcelService parcel = new ParcelService(this); + public final PaymentMethodService paymentMethod = new PaymentMethodService(this); + public final PickupService pickup = new PickupService(this); + public final RateService rate = new RateService(this); + public final ReferralCustomerService referralCustomer = new ReferralCustomerService(this); + public final RefundService refund = new RefundService(this); + public final ReportService report = new ReportService(this); + public final ScanformService scanForm = new ScanformService(this); + public final ShipmentService shipment = new ShipmentService(this); + public final SmartRateService smartRate = new SmartRateService(this); + public final TrackerService tracker = new TrackerService(this); + public final UserService user = new UserService(this); + public final WebhookService webhook = new WebhookService(this); + @Getter + private RequestHook requestHooks = new RequestHook(); + @Getter + private ResponseHook responseHooks = new ResponseHook(); + + /** + * EasyPostClient constructor. + * + * @param apiKey API key for API calls. + * @throws MissingParameterError When the request fails. + */ + public EasyPostClient(String apiKey) throws MissingParameterError { + this(apiKey, Constants.Http.DEFAULT_CONNECT_TIMEOUT_MILLISECONDS); + } + + /** + * EasyPostClient constructor. + * + * @param apiKey API key for API calls. + * @param apiBase API base for API calls. + * @throws MissingParameterError When the request fails. + */ + public EasyPostClient(String apiKey, String apiBase) throws MissingParameterError { + this(apiKey, Constants.Http.DEFAULT_CONNECT_TIMEOUT_MILLISECONDS, + Constants.Http.DEFAULT_READ_TIMEOUT_MILLISECONDS, apiBase); + } + + /** + * EasyPostClient constructor. + * + * @param apiKey API key for API calls. + * @param connectTimeoutMilliseconds Timeout for connection. + * @throws MissingParameterError When the request fails. + */ + public EasyPostClient(String apiKey, int connectTimeoutMilliseconds) throws MissingParameterError { + this(apiKey, connectTimeoutMilliseconds, Constants.Http.API_BASE); + } + + /** + * EasyPostClient constructor. + * + * @param apiKey API key for API calls. + * @param connectTimeoutMilliseconds Timeout for connection. + * @param apiBase API base for API calls. + * @throws MissingParameterError When the request fails. + */ + public EasyPostClient(String apiKey, int connectTimeoutMilliseconds, String apiBase) throws MissingParameterError { + this(apiKey, connectTimeoutMilliseconds, Constants.Http.DEFAULT_READ_TIMEOUT_MILLISECONDS, apiBase); + } + + /** + * EasyPostClient constructor. + * + * @param apiKey API key for API calls. + * @param connectTimeoutMilliseconds Timeout for connection. + * @param readTimeoutMilliseconds Timeout for read. + * @throws MissingParameterError When the request fails. + */ + public EasyPostClient(String apiKey, int connectTimeoutMilliseconds, int readTimeoutMilliseconds) + throws MissingParameterError { + this(apiKey, connectTimeoutMilliseconds, readTimeoutMilliseconds, Constants.Http.API_BASE); + } + + /** + * EasyPostClient constructor. + * + * @param apiKey API key for API calls. + * @param connectTimeoutMilliseconds Timeout for connection. + * @param readTimeoutMilliseconds Timeout for read. + * @param apiBase API base for API calls. + * @throws MissingParameterError When the request fails. + */ + public EasyPostClient(String apiKey, int connectTimeoutMilliseconds, int readTimeoutMilliseconds, String apiBase) + throws MissingParameterError { + if (apiKey == null || apiKey.isEmpty()) { + throw new MissingParameterError("apiKey"); + } + + this.apiBase = apiBase; + this.clientApiKey = apiKey; + this.connectTimeoutMilliseconds = connectTimeoutMilliseconds; + this.readTimeoutMilliseconds = readTimeoutMilliseconds; + } + + /** + * Subscribes to a request hook from the given function. + * + * @param function The function to be subscribed to the request hook + */ + public void subscribeToRequestHook(Function function) { + this.requestHooks.addEventHandler(function); + } + + /** + * Unsubscribes to a request hook from the given function. + * + * @param function The function to be unsubscribed from the request hook + */ + public void unsubscribeFromRequestHook(Function function) { + this.requestHooks.removeEventHandler(function); + } + + /** + * Subscribes to a response hook from the given function. + * + * @param function The function to be subscribed to the response hook + */ + public void subscribeToResponseHook(Function function) { + this.responseHooks.addEventHandler(function); + } + + /** + * Unubscribes to a response hook from the given function. + * + * @param function The function to be unsubscribed from the response hook + */ + public void unsubscribeFromResponseHook(Function function) { + this.responseHooks.removeEventHandler(function); + } + + /** + * Get connection timeout milliseconds for this EasyPostClient object. + * + * @return the connection timeout for this EasyPostClient object + */ + public int getConnectionTimeoutMilliseconds() { + return connectTimeoutMilliseconds; + } + + /** + * Get read timeout milliseconds for this EasyPostClient object. + * + * @return the read timeout for this EasyPostClient object + */ + public int getReadTimeoutMilliseconds() { + return readTimeoutMilliseconds; + } + + /** + * Get API key for this EasyPostClient object. + * + * @return the API key for this EasyPostClient object + */ + public String getApiKey() { + return clientApiKey; + } + + /** + * Get API version for this EasyPostClient object. + * + * @return the API version for this EasyPostClient object. + */ + public String getApiVersion() { + return apiVersion; + } + + /** + * Get API base for this EasyPostClient object. + * + * @return the API base for this EasyPostClient object. + */ + public String getApiBase() { + return apiBase; + } +} diff --git a/src/main/java/com/easypost/service/EmbeddableService.java b/src/main/java/com/easypost/service/EmbeddableService.java new file mode 100644 index 000000000..af04f5b83 --- /dev/null +++ b/src/main/java/com/easypost/service/EmbeddableService.java @@ -0,0 +1,34 @@ +package com.easypost.service; + +import java.util.Map; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.EmbeddablesSession; + +public class EmbeddableService { + private final EasyPostClient client; + + /** + * EmbeddableService constructor. + * + * @param client The client object. + */ + EmbeddableService(EasyPostClient client) { + this.client = client; + } + + /** + * Create an EmbeddablesSession from the API. + * + * @param params Map of parameters. + * @return EmbeddablesSession object + * @throws EasyPostException when the request fails. + */ + public EmbeddablesSession createSession(final Map params) throws EasyPostException { + String endpoint = "embeddables/session"; + + return Requestor.request(RequestMethod.POST, endpoint, params, EmbeddablesSession.class, client); + } +} diff --git a/src/main/java/com/easypost/service/EndShipperService.java b/src/main/java/com/easypost/service/EndShipperService.java new file mode 100644 index 000000000..6a99f0c47 --- /dev/null +++ b/src/main/java/com/easypost/service/EndShipperService.java @@ -0,0 +1,86 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.EndShipper; +import com.easypost.model.EndShipperCollection; + +import java.util.HashMap; +import java.util.Map; + +public class EndShipperService { + private final EasyPostClient client; + + /** + * EndShipperService constructor. + * + * @param client The client object. + */ + EndShipperService(EasyPostClient client) { + this.client = client; + } + + /** + * Create EndShipper object from parameter map. + * + * @param params Map of EndShipper parameters. + * @return EndShipper object. + * @throws EasyPostException when the request fails. + */ + public EndShipper create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + + wrappedParams.put("address", params); + + String endpoint = "end_shippers"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, EndShipper.class, client); + } + + /** + * Retrieve EndShipper object from API. + * + * @param id ID of EndShipper to retrieve. + * @return EndShipper object. + * @throws EasyPostException when the request fails. + */ + public EndShipper retrieve(final String id) throws EasyPostException { + String endpoint = "end_shippers/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, EndShipper.class, client); + } + + /** + * List all EndShipper objects. + * + * @param params Map of parameters. + * @return EndShipperCollection object. + * @throws EasyPostException when the request fails. + */ + public EndShipperCollection all(final Map params) throws EasyPostException { + String endpoint = "end_shippers"; + + return Requestor.request(RequestMethod.GET, endpoint, params, EndShipperCollection.class, client); + } + + // TODO: Add getNextPage function when "before_id" is available for EndShipper All endpoint. + + /** + * Update an EndShipper object. + * + * @param id The ID of endshipper. + * @param params Map of parameters. + * @return EndShipper object. + * @throws EasyPostException when the request fails. + */ + public EndShipper update(final String id, final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + + wrappedParams.put("address", params); + + String endpoint = "end_shippers/" + id; + + return Requestor.request(RequestMethod.PUT, endpoint, wrappedParams, EndShipper.class, client); + } +} diff --git a/src/main/java/com/easypost/service/EventService.java b/src/main/java/com/easypost/service/EventService.java new file mode 100644 index 000000000..3981f996b --- /dev/null +++ b/src/main/java/com/easypost/service/EventService.java @@ -0,0 +1,114 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.EventCollection; +import com.easypost.model.Event; +import com.easypost.model.Payload; +import com.easypost.model.PayloadCollection; +import lombok.SneakyThrows; + +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +public class EventService { + private final EasyPostClient client; + + /** + * EventService constructor. + * + * @param client The client object. + */ + EventService(EasyPostClient client) { + this.client = client; + } + + /** + * Retrieve a Event from the API. + * + * @param id ID of the Event to retrieve + * @return Event object + * @throws EasyPostException when the request fails. + */ + public Event retrieve(final String id) throws EasyPostException { + String endpoint = "events/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Event.class, client); + } + + /** + * Get a list of Events. + * + * @param params A map of parameters to pass to the API. + * @return EventCollection object + * @throws EasyPostException when the request fails. + */ + public EventCollection all(final Map params) throws EasyPostException { + String endpoint = "events"; + + return Requestor.request(RequestMethod.GET, endpoint, params, EventCollection.class, client); + } + + /** + * Get the next page of an EventCollection. + * + * @param collection EventCollection to get next page of. + * @return EventCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public EventCollection getNextPage(EventCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an EventCollection. + * + * @param collection EventCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return EventCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public EventCollection getNextPage(EventCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, EventCollection>() { + @Override @SneakyThrows + public EventCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getEvents(), pageSize); + } + + /** + * Retrieve all payloads. + * + * @param eventId The ID of event. + * @return List of Payload objects. + * @throws EasyPostException when the request fails. + */ + public List retrieveAllPayloads(final String eventId) throws EasyPostException { + String endpoint = "events/" + eventId + "/payloads"; + + PayloadCollection payloads = + Requestor.request(RequestMethod.GET, endpoint, null, PayloadCollection.class, + client); + + return payloads.getPayloads(); + } + + /** + * Retrieve a payload. + * + * @param eventId The ID of event. + * @param payloadId The ID of payload. + * @return PayloadCollection object + * @throws EasyPostException when the request fails. + */ + public Payload retrievePayload(final String eventId, final String payloadId) throws EasyPostException { + String endpoint = "events/" + eventId + "/payloads/" + payloadId; + + return Requestor.request(RequestMethod.GET, endpoint, null, Payload.class, + client); + } +} diff --git a/src/main/java/com/easypost/service/FedExRegistrationService.java b/src/main/java/com/easypost/service/FedExRegistrationService.java new file mode 100644 index 000000000..3b92e220e --- /dev/null +++ b/src/main/java/com/easypost/service/FedExRegistrationService.java @@ -0,0 +1,188 @@ +package com.easypost.service; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.FedExAccountValidationResponse; +import com.easypost.model.FedExRequestPinResponse; + +public class FedExRegistrationService { + private final EasyPostClient client; + + /** + * FedExRegistrationService constructor. + * + * @param client The client object. + */ + FedExRegistrationService(EasyPostClient client) { + this.client = client; + } + + /** + * Register the billing address for a FedEx account. + * Advanced method for custom parameter structures. + * + * @param fedexAccountNumber The FedEx account number. + * @param params Map of parameters. + * @return FedExAccountValidationResponse object with next steps (PIN or invoice + * validation). + * @throws EasyPostException when the request fails. + */ + public FedExAccountValidationResponse registerAddress(final String fedexAccountNumber, + final Map params) throws EasyPostException { + Map wrappedParams = wrapAddressValidation(params); + String endpoint = String.format("fedex_registrations/%s/address", fedexAccountNumber); + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, FedExAccountValidationResponse.class, + client); + } + + /** + * Request a PIN for FedEx account verification. + * + * @param fedexAccountNumber The FedEx account number. + * @param pinMethodOption The PIN delivery method: "SMS", "CALL", or "EMAIL". + * @return FedExRequestPinResponse object confirming PIN was sent. + * @throws EasyPostException when the request fails. + */ + public FedExRequestPinResponse requestPin(final String fedexAccountNumber, final String pinMethodOption) + throws EasyPostException { + Map wrappedParams = new HashMap<>(); + Map pinMethodMap = new HashMap<>(); + pinMethodMap.put("option", pinMethodOption); + wrappedParams.put("pin_method", pinMethodMap); + String endpoint = String.format("fedex_registrations/%s/pin", fedexAccountNumber); + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, FedExRequestPinResponse.class, client); + } + + /** + * Validate the PIN entered by the user for FedEx account verification. + * + * @param fedexAccountNumber The FedEx account number. + * @param params Map of parameters. + * @return FedExAccountValidationResponse object. + * @throws EasyPostException when the request fails. + */ + public FedExAccountValidationResponse validatePin(final String fedexAccountNumber, final Map params) + throws EasyPostException { + Map wrappedParams = wrapPinValidation(params); + String endpoint = String.format("fedex_registrations/%s/pin/validate", fedexAccountNumber); + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, FedExAccountValidationResponse.class, + client); + } + + /** + * Submit invoice information to complete FedEx account registration. + * + * @param fedexAccountNumber The FedEx account number. + * @param params Map of parameters. + * @return FedExAccountValidationResponse object. + * @throws EasyPostException when the request fails. + */ + public FedExAccountValidationResponse submitInvoice(final String fedexAccountNumber, + final Map params) + throws EasyPostException { + Map wrappedParams = wrapInvoiceValidation(params); + String endpoint = String.format("fedex_registrations/%s/invoice", fedexAccountNumber); + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, FedExAccountValidationResponse.class, + client); + } + + /** + * Wraps address validation parameters and ensures the "name" field exists. + * If not present, generates a UUID (with hyphens removed) as the name. + * + * @param params The original parameters map. + * @return A new map with properly wrapped address_validation and + * easypost_details. + */ + @SuppressWarnings("unchecked") + private Map wrapAddressValidation(final Map params) { + Map wrappedParams = new HashMap<>(); + + if (params.containsKey("address_validation")) { + Map addressValidation = new HashMap<>( + (Map) params.get("address_validation")); + ensureNameField(addressValidation); + wrappedParams.put("address_validation", addressValidation); + } + + if (params.containsKey("easypost_details")) { + wrappedParams.put("easypost_details", params.get("easypost_details")); + } + + return wrappedParams; + } + + /** + * Wraps PIN validation parameters and ensures the "name" field exists. + * If not present, generates a UUID (with hyphens removed) as the name. + * + * @param params The original parameters map. + * @return A new map with properly wrapped pin_validation and easypost_details. + */ + @SuppressWarnings("unchecked") + private Map wrapPinValidation(final Map params) { + Map wrappedParams = new HashMap<>(); + + if (params.containsKey("pin_validation")) { + Map pinValidation = new HashMap<>( + (Map) params.get("pin_validation")); + ensureNameField(pinValidation); + wrappedParams.put("pin_validation", pinValidation); + } + + if (params.containsKey("easypost_details")) { + wrappedParams.put("easypost_details", params.get("easypost_details")); + } + + return wrappedParams; + } + + /** + * Wraps invoice validation parameters and ensures the "name" field exists. + * If not present, generates a UUID (with hyphens removed) as the name. + * + * @param params The original parameters map. + * @return A new map with properly wrapped invoice_validation and + * easypost_details. + */ + @SuppressWarnings("unchecked") + private Map wrapInvoiceValidation(final Map params) { + Map wrappedParams = new HashMap<>(); + + if (params.containsKey("invoice_validation")) { + Map invoiceValidation = new HashMap<>( + (Map) params.get("invoice_validation")); + ensureNameField(invoiceValidation); + wrappedParams.put("invoice_validation", invoiceValidation); + } + + if (params.containsKey("easypost_details")) { + wrappedParams.put("easypost_details", params.get("easypost_details")); + } + + return wrappedParams; + } + + /** + * Ensures the "name" field exists in the provided map. + * If not present, generates a UUID (with hyphens removed) as the name. + * This follows the pattern used in the web UI implementation. + * + * @param map The map to ensure the "name" field in. + */ + private void ensureNameField(final Map map) { + if (!map.containsKey("name") || map.get("name") == null) { + String uuid = UUID.randomUUID().toString().replace("-", ""); + map.put("name", uuid); + } + } +} diff --git a/src/main/java/com/easypost/service/InsuranceService.java b/src/main/java/com/easypost/service/InsuranceService.java new file mode 100644 index 000000000..2c54b87bd --- /dev/null +++ b/src/main/java/com/easypost/service/InsuranceService.java @@ -0,0 +1,110 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.InsuranceCollection; +import com.easypost.model.Insurance; +import lombok.SneakyThrows; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +public class InsuranceService { + private final EasyPostClient client; + + /** + * InsuranceService constructor. + * + * @param client The client object. + */ + InsuranceService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a new Insurance object from a map of parameters. + * + * @param params Map of parameters. + * @return Insurance object + * @throws EasyPostException when the request fails. + */ + public Insurance create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("insurance", params); + + String endpoint = "insurances"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Insurance.class, client); + } + + /** + * Retrieve an Insurance from the API. + * + * @param id The ID of the Insurance to retrieve. + * @return Insurance object + * @throws EasyPostException when the request fails. + */ + public Insurance retrieve(final String id) throws EasyPostException { + String endpoint = "insurances/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Insurance.class, client); + } + + /** + * Get a list of Insurances. + * + * @param params a map of parameters + * @return InsuranceCollection object + * @throws EasyPostException when the request fails. + */ + public InsuranceCollection all(final Map params) throws EasyPostException { + String endpoint = "insurances"; + + return Requestor.request(RequestMethod.GET, endpoint, params, InsuranceCollection.class, client); + } + + /** + * Refund an Insurance from the API. + * + * @param id The ID of the Insurance to refund. + * @return Insurance object + * @throws EasyPostException when the request fails. + */ + public Insurance refund(final String id) throws EasyPostException { + String endpoint = String.format("insurances/%s/refund", id); + + return Requestor.request(RequestMethod.POST, endpoint, null, Insurance.class, client); + } + + /** + * Get the next page of an InsuranceCollection. + * + * @param collection InsuranceCollection to get next page of. + * @return InsuranceCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public InsuranceCollection getNextPage(InsuranceCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an InsuranceCollection. + * + * @param collection InsuranceCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return InsuranceCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public InsuranceCollection getNextPage( + InsuranceCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, InsuranceCollection>() { + @Override @SneakyThrows + public InsuranceCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getInsurances(), pageSize); + } +} diff --git a/src/main/java/com/easypost/service/LumaService.java b/src/main/java/com/easypost/service/LumaService.java new file mode 100644 index 000000000..b2e67912f --- /dev/null +++ b/src/main/java/com/easypost/service/LumaService.java @@ -0,0 +1,41 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.LumaPromiseResponse; +import com.easypost.model.LumaInfo; + +import java.util.HashMap; +import java.util.Map; + +public class LumaService { + private final EasyPostClient client; + + /** + * LumaService constructor. + * + * @param client The client object. + */ + LumaService(EasyPostClient client) { + this.client = client; + } + + /** + * Get service recommendations from Luma that meet the criteria of your ruleset. + * + * @param params The map of parameters. + * @return LumaInfo object. + * @throws EasyPostException When the request fails. + */ + public LumaInfo getPromise(final Map params) + throws EasyPostException { + Map wrappedParams = new HashMap<>(); + wrappedParams.put("shipment", params); + String endpoint = "luma/promise"; + + LumaPromiseResponse response = Requestor.request(RequestMethod.POST, endpoint, wrappedParams, + LumaPromiseResponse.class, client); + return response.getLumaInfo(); + } +} diff --git a/src/main/java/com/easypost/service/OrderService.java b/src/main/java/com/easypost/service/OrderService.java new file mode 100644 index 000000000..6b011eb52 --- /dev/null +++ b/src/main/java/com/easypost/service/OrderService.java @@ -0,0 +1,107 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.Order; +import com.easypost.model.Rate; + +import java.util.HashMap; +import java.util.Map; + +public class OrderService { + private final EasyPostClient client; + + /** + * OrderService constructor. + * + * @param client The client object. + */ + OrderService(EasyPostClient client) { + this.client = client; + } + + /** + * Create an Order object from a map of parameters. + * + * @param params Map of parameters. + * @return Order object. + * @throws EasyPostException when the request fails. + */ + public Order create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("order", params); + + String endpoint = "orders"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Order.class, client); + } + + /** + * Retrieve an Order object from the API. + * + * @param id ID of the Order to retrieve. + * @return Order object. + * @throws EasyPostException when the request fails. + */ + public Order retrieve(final String id) throws EasyPostException { + String endpoint = "orders/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Order.class, client); + } + + /** + * Get new rates for this Order. + * + * @param id The ID of order. + * @return Order object. + * @throws EasyPostException when the request fails. + */ + public Order newRates(final String id) throws EasyPostException { + return this.newRates(id, null); + } + + /** + * Get new rates for this Order. + * + * @param id The ID of order. + * @param params Map of parameters. + * @return Order object. + * @throws EasyPostException when the request fails. + */ + public Order newRates(final String id, final Map params) throws EasyPostException { + String endpoint = "orders/" + id + "/rates"; + + return Requestor.request(RequestMethod.GET, endpoint, params, Order.class, client); + } + + /** + * Buy this Order. + * + * @param id The ID of order. + * @param params Map of parameters. + * @return Order object. + * @throws EasyPostException when the request fails. + */ + public Order buy(final String id, final Map params) throws EasyPostException { + String endpoint = "orders/" + id + "/buy"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Order.class, client); + } + + /** + * Buy this Order. + * + * @param id The ID of order. + * @param rate Rate to buy. + * @return Order object. + * @throws EasyPostException when the request fails. + */ + public Order buy(final String id, final Rate rate) throws EasyPostException { + Map params = new HashMap(); + params.put("carrier", rate.getCarrier()); + params.put("service", rate.getService()); + + return this.buy(id, params); + } +} diff --git a/src/main/java/com/easypost/service/ParcelService.java b/src/main/java/com/easypost/service/ParcelService.java new file mode 100644 index 000000000..89a29fd2a --- /dev/null +++ b/src/main/java/com/easypost/service/ParcelService.java @@ -0,0 +1,51 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.Parcel; + +import java.util.HashMap; +import java.util.Map; + +public class ParcelService { + private final EasyPostClient client; + + /** + * ParcelService constructor. + * + * @param client The client object. + */ + ParcelService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a Parcel from a map of parameters. + * + * @param params The map of the parameters to create a Parcel from. + * @return Parcel object. + * @throws EasyPostException when the request fails. + */ + public Parcel create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("parcel", params); + + String endpoint = "parcels"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Parcel.class, client); + } + + /** + * Retrieve a Parcel from the API. + * + * @param id The ID of the Parcel to retrieve. + * @return Parcel object. + * @throws EasyPostException when the request fails. + */ + public Parcel retrieve(final String id) throws EasyPostException { + String endpoint = "parcels/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Parcel.class, client); + } +} diff --git a/src/main/java/com/easypost/service/PaymentMethodService.java b/src/main/java/com/easypost/service/PaymentMethodService.java new file mode 100644 index 000000000..8216ee6c8 --- /dev/null +++ b/src/main/java/com/easypost/service/PaymentMethodService.java @@ -0,0 +1,14 @@ +package com.easypost.service; + +public class PaymentMethodService { + private final EasyPostClient client; + + /** + * PaymentMethodService constructor. + * + * @param client The client object. + */ + PaymentMethodService(EasyPostClient client) { + this.client = client; + } +} diff --git a/src/main/java/com/easypost/service/PickupService.java b/src/main/java/com/easypost/service/PickupService.java new file mode 100644 index 000000000..a5f974b26 --- /dev/null +++ b/src/main/java/com/easypost/service/PickupService.java @@ -0,0 +1,152 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.PickupCollection; +import com.easypost.model.Pickup; +import com.easypost.model.PickupRate; +import lombok.SneakyThrows; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +public class PickupService { + private final EasyPostClient client; + + /** + * PickupService constructor. + * + * @param client The client object. + */ + PickupService(EasyPostClient client) { + this.client = client; + } + + /** + * Get a list of all Pickup objects. + * + * @param params The options for the query. + * @return PickupCollection object + * @throws EasyPostException when the request fails. + */ + public PickupCollection all(final Map params) throws EasyPostException { + String endpoint = "pickups"; + + return Requestor.request(RequestMethod.GET, endpoint, params, PickupCollection.class, client); + } + + /** + * Get the next page of an PickupCollection. + * + * @param collection PickupCollection to get next page of. + * @return PickupCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public PickupCollection getNextPage(PickupCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an PickupCollection. + * + * @param collection PickupCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return PickupCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public PickupCollection getNextPage(PickupCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, PickupCollection>() { + @Override @SneakyThrows + public PickupCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getPickups(), pageSize); + } + + /** + * Create a new Pickup object from a map of parameters. + * + * @param params Map of parameters. + * @return Pickup object. + * @throws EasyPostException when the request fails. + */ + public Pickup create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("pickup", params); + + String endpoint = "pickups"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Pickup.class, client); + } + + /** + * Retrieve a Pickup from the API. + * + * @param id ID of Pickup to retrieve. + * @return Pickup object. + * @throws EasyPostException when the request fails. + */ + public Pickup retrieve(final String id) throws EasyPostException { + String endpoint = "pickups/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Pickup.class, client); + } + + /** + * Buy this Pickup. + * + * @param id The ID of pickup. + * @param params Map of parameters. + * @return Pickup object. + * @throws EasyPostException when the request fails. + */ + public Pickup buy(final String id, final Map params) throws EasyPostException { + String endpoint = "pickups/" + id + "/buy"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Pickup.class, client); + } + + /** + * Buy this Pickup. + * + * @param id The ID of pickup. + * @param pickupRate PickupRate to buy. + * @return Pickup object. + * @throws EasyPostException when the request fails. + */ + public Pickup buy(final String id, final PickupRate pickupRate) throws EasyPostException { + Map params = new HashMap(); + params.put("carrier", pickupRate.getCarrier()); + params.put("service", pickupRate.getService()); + + return this.buy(id, params); + } + + /** + * Cancel this Pickup. + * + * @param id The ID of pickup. + * @return Pickup object. + * @throws EasyPostException when the request fails. + */ + public Pickup cancel(final String id) throws EasyPostException { + return this.cancel(id, null); + } + + /** + * Cancel this Pickup. + * + * @param id The ID of pickup. + * @param params Map of parameters. + * @return Pickup object. + * @throws EasyPostException when the request fails. + */ + public Pickup cancel(final String id, final Map params) throws EasyPostException { + String endpoint = "pickups/" + id + "/cancel"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Pickup.class, client); + } +} diff --git a/src/main/java/com/easypost/service/RateService.java b/src/main/java/com/easypost/service/RateService.java new file mode 100644 index 000000000..84507ba8a --- /dev/null +++ b/src/main/java/com/easypost/service/RateService.java @@ -0,0 +1,32 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.Rate; + +public class RateService { + private final EasyPostClient client; + + /** + * RateService constructor. + * + * @param client The client object. + */ + RateService(EasyPostClient client) { + this.client = client; + } + + /** + * Retrieve a Rate from the API. + * + * @param id ID of the Rate to retrieve. + * @return Rate object. + * @throws EasyPostException when the request fails. + */ + public Rate retrieve(final String id) throws EasyPostException { + String endpoint = "rates/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Rate.class, client); + } +} diff --git a/src/main/java/com/easypost/service/ReferralCustomerService.java b/src/main/java/com/easypost/service/ReferralCustomerService.java new file mode 100644 index 000000000..e21f2320f --- /dev/null +++ b/src/main/java/com/easypost/service/ReferralCustomerService.java @@ -0,0 +1,324 @@ +package com.easypost.service; + +import com.easypost.Constants; +import com.easypost.EasyPost; +import com.easypost.exception.API.EncodingError; +import com.easypost.exception.API.ExternalApiError; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.ReferralCustomerCollection; +import com.easypost.model.PaymentMethod; +import com.easypost.model.PaymentMethodObject; +import com.easypost.model.ReferralCustomer; +import com.easypost.utils.InternalUtilities; +import lombok.SneakyThrows; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +public class ReferralCustomerService { + private final EasyPostClient client; + + /** + * ReferralCustomerService constructor. + * + * @param client The client object. + */ + ReferralCustomerService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a Referral Customer object from parameter map. This function requires + * the Partner User's API key. + * + * @param params Map of the referral user parameters. + * @return Referral object. + * @throws EasyPostException when the request fails. + */ + public ReferralCustomer create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap<>(); + wrappedParams.put("user", params); + + String endpoint = "referral_customers"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, ReferralCustomer.class, + client); + } + + /** + * Update a Referral object email. This function requires the Partner User's API + * key. + * + * @param email Email of the referral user to update. + * @param userId ID of the referral user to update. + * @throws EasyPostException when the request fails. + */ + public void updateEmail(final String email, final String userId) throws EasyPostException { + Map wrappedParams = new HashMap<>(); + Map params = new HashMap<>(); + params.put("email", email); + wrappedParams.put("user", params); + + String endpoint = "referral_customers/" + userId; + + Requestor.request(RequestMethod.PUT, endpoint, wrappedParams, ReferralCustomer.class, + client); + } + + /** + * List all Referral objects. This function requires the Partner User's API key. + * + * @param params Map of parameters. + * @return ReferralCustomerCollection object. + * @throws EasyPostException when the request fails. + */ + public ReferralCustomerCollection all(final Map params) throws EasyPostException { + String endpoint = "referral_customers"; + + return Requestor.request(RequestMethod.GET, endpoint, params, ReferralCustomerCollection.class, + client); + } + + /** + * Get the next page of an ReferralCustomerCollection. + * + * @param collection ReferralCustomerCollection to get next page of. + * @return ReferralCustomerCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ReferralCustomerCollection getNextPage(ReferralCustomerCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an ReferralCustomerCollection. + * + * @param collection ReferralCustomerCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return ReferralCustomerCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ReferralCustomerCollection getNextPage( + ReferralCustomerCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, ReferralCustomerCollection>() { + @Override @SneakyThrows + public ReferralCustomerCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getReferralCustomers(), pageSize); + } + + /** + * Add credit card to a referral user. This function requires the Referral + * User's API key. + * + * @param referralApiKey API key of the referral user. + * @param number Credit card number. + * @param expirationMonth Expiration month of the credit card. + * @param expirationYear Expiration year of the credit card. + * @param cvc CVC of the credit card. + * @return PaymentMethodObject object. + * @throws EasyPostException when the request fails. + */ + public PaymentMethodObject addCreditCardToUser(final String referralApiKey, final String number, + final int expirationMonth, final int expirationYear, + final String cvc) throws EasyPostException { + return addCreditCardToUser(referralApiKey, number, expirationMonth, expirationYear, cvc, + PaymentMethod.Priority.PRIMARY); + } + + /** + * Add credit card to a referral user. This function requires the Referral + * User's API key. + * + * @param referralApiKey API key of the referral user. + * @param number Credit card number. + * @param expirationMonth Expiration month of the credit card. + * @param expirationYear Expiration year of the credit card. + * @param cvc CVC of the credit card. + * @param priority Priority of this credit card. + * @return PaymentMethodObject object. + * @throws EasyPostException when the request fails. + */ + public PaymentMethodObject addCreditCardToUser(final String referralApiKey, final String number, + final int expirationMonth, final int expirationYear, + final String cvc, final PaymentMethod.Priority priority) + throws EasyPostException { + String easypostStripeApiKey = retrieveEasypostStripeApiKey(); + String stripeToken; + + try { + stripeToken = createStripeToken(number, expirationMonth, expirationYear, cvc, easypostStripeApiKey); + } catch (Exception e) { + throw new ExternalApiError(String.format(Constants.ErrorMessages.EXTERNAL_API_CALL_FAILED, "Stripe")); + } + + return createEasypostCreditCard(referralApiKey, stripeToken, priority.toString().toLowerCase()); + } + + /** + * Add a credit card to EasyPost for a ReferralCustomer with a payment method ID from Stripe. + * This function requires the ReferralCustomer User's API key. + * + * @param referralApiKey API key of the referral user. + * @param paymentMethodId Payment method ID from Stripe. + * @param priority Priority of the credit card (e.g., "primary" or "secondary"). + * @return PaymentMethodObject object. + * @throws EasyPostException when the request fails. + */ + public PaymentMethodObject addCreditCardFromStripe(final String referralApiKey, final String paymentMethodId, + final PaymentMethod.Priority priority) throws EasyPostException { + Map params = new HashMap<>(); + Map creditCardParams = new HashMap<>(); + creditCardParams.put("payment_method_id", paymentMethodId); + creditCardParams.put("priority", priority.toString().toLowerCase()); + params.put("credit_card", creditCardParams); + + EasyPostClient referralClient = new EasyPostClient(referralApiKey); + + String endpoint = "credit_cards"; + + return Requestor.request(RequestMethod.POST, endpoint, params, PaymentMethodObject.class, referralClient); + } + + /** + * Add a bank account to EasyPost for a ReferralCustomer. + * This function requires the ReferralCustomer User's API key. + * + * @param referralApiKey API key of the referral user. + * @param financialConnectionsId Financial connections ID from Stripe. + * @param mandateData Mandate data for the bank account. + * @param priority Priority of the bank account (e.g., "primary" or "secondary"). + * @return PaymentMethodObject object. + * @throws EasyPostException when the request fails. + */ + public PaymentMethodObject addBankAccountFromStripe(final String referralApiKey, + final String financialConnectionsId, + final Map mandateData, + final PaymentMethod.Priority priority) + throws EasyPostException { + Map params = new HashMap<>(); + params.put("financial_connections_id", financialConnectionsId); + params.put("mandate_data", mandateData); + params.put("priority", priority.toString().toLowerCase()); + + EasyPostClient referralClient = new EasyPostClient(referralApiKey); + + String endpoint = "bank_accounts"; + + return Requestor.request(RequestMethod.POST, endpoint, params, PaymentMethodObject.class, referralClient); + } + + /** + * Retrieve EasyPost Stripe API key. + * + * @return EasyPost Stripe API key. + * @throws EasyPostException when the request fails. + */ + private String retrieveEasypostStripeApiKey() throws EasyPostException { + String endpoint = "partners/stripe_public_key"; + + @SuppressWarnings ("unchecked") Map response = + Requestor.request(RequestMethod.GET, endpoint, null, Map.class, client); + + return response.getOrDefault("public_key", ""); + } + + /** + * Get credit card token from Stripe. + * + * @param number Credit card number. + * @param expirationMonth Expiration month of the credit card. + * @param expirationYear Expiration year of the credit card. + * @param cvc CVC of the credit card. + * @param easypostStripeApiKey EasyPost Stripe API key. + * @return Stripe token. + * @throws EncodingError when the request details could not be encoded. + * @throws IOException when the request fails. + */ + private static String createStripeToken(final String number, final int expirationMonth, final int expirationYear, + final String cvc, final String easypostStripeApiKey) + throws EncodingError, IOException { + String apiToken = String.format("%s %s", "Bearer", easypostStripeApiKey); + + Map params = new HashMap<>(); + params.put("number", number); + params.put("exp_month", String.valueOf(expirationMonth)); + params.put("exp_year", String.valueOf(expirationYear)); + params.put("cvc", cvc); + + String encodedURL = InternalUtilities.getEncodedURL(params, "card"); + URL stripeUrl = new URL("https://api.stripe.com/v1/tokens?" + encodedURL); + + HttpURLConnection conn; + if (EasyPost._vcrUrlFunction != null) { + conn = EasyPost._vcrUrlFunction.apply(stripeUrl.toString()); + } else { + conn = (HttpURLConnection) stripeUrl.openConnection(); + } + + conn.setRequestMethod("POST"); + conn.setRequestProperty("Authorization", apiToken); + conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + conn.setDoOutput(true); + + StringBuilder response; + + try (BufferedReader br = new BufferedReader( + new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) { + String line; + response = new StringBuilder(); + + while ((line = br.readLine()) != null) { + response.append(line); + response.append(System.lineSeparator()); + } + br.close(); + } finally { + conn.disconnect(); + } + + String responseBody = response.toString(); + + @SuppressWarnings ("unchecked") Map responseMap = + Constants.Http.GSON.fromJson(responseBody, Map.class); + + return responseMap.get("id").toString(); + } + + /** + * Submit Stripe credit card token to EasyPost. + * + * @param referralApiKey API key of the referral user. + * @param stripeObjectId Stripe token. + * @param priority Credit card priority. + * @return CreditCard object. + * @throws EasyPostException when the request fails. + */ + private PaymentMethodObject createEasypostCreditCard(final String referralApiKey, final String stripeObjectId, + final String priority) throws EasyPostException { + Map params = new HashMap<>(); + params.put("stripe_object_id", stripeObjectId); + params.put("priority", priority); + + Map wrappedParams = new HashMap<>(); + wrappedParams.put("credit_card", params); + + EasyPostClient referralClient = new EasyPostClient(referralApiKey); + + String endpoint = "credit_cards"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, PaymentMethodObject.class, + referralClient); + } +} diff --git a/src/main/java/com/easypost/service/RefundService.java b/src/main/java/com/easypost/service/RefundService.java new file mode 100644 index 000000000..49ac2638f --- /dev/null +++ b/src/main/java/com/easypost/service/RefundService.java @@ -0,0 +1,100 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.RefundCollection; +import com.easypost.model.Refund; +import lombok.SneakyThrows; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +public class RefundService { + private final EasyPostClient client; + + /** + * RefundService constructor. + * + * @param client The client object. + */ + RefundService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a Refund object from a map of parameters. + * + * @param params Map of parameters + * @return Refund object + * @throws EasyPostException when the request fails. + */ + public List create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("refund", params); + + String endpoint = "refunds"; + + Refund[] response = Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Refund[].class, client); + + return Arrays.asList(response); + } + + /** + * Retrieve a Refund object from the API. + * + * @param id ID of refund to retrieve + * @return Refund object + * @throws EasyPostException when the request fails. + */ + public Refund retrieve(final String id) throws EasyPostException { + String endpoint = "refunds/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Refund.class, client); + } + + /** + * List all Refunds objects. + * + * @param params Map of parameters + * @return RefundCollection object + * @throws EasyPostException when the request fails. + */ + public RefundCollection all(final Map params) throws EasyPostException { + String endpoint = "refunds"; + + return Requestor.request(RequestMethod.GET, endpoint, params, RefundCollection.class, client); + } + + /** + * Get the next page of an RefundCollection. + * + * @param collection RefundCollection to get next page of. + * @return RefundCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public RefundCollection getNextPage(RefundCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an RefundCollection. + * + * @param collection RefundCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return RefundCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public RefundCollection getNextPage(RefundCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, RefundCollection>() { + @Override @SneakyThrows + public RefundCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getRefunds(), pageSize); + } +} diff --git a/src/main/java/com/easypost/service/ReportService.java b/src/main/java/com/easypost/service/ReportService.java new file mode 100644 index 000000000..1e029eb83 --- /dev/null +++ b/src/main/java/com/easypost/service/ReportService.java @@ -0,0 +1,128 @@ +package com.easypost.service; + +import com.easypost.Constants; +import com.easypost.exception.API.EncodingError; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.exception.General.MissingParameterError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.ReportCollection; +import com.easypost.model.Report; +import lombok.SneakyThrows; + +import java.net.URLEncoder; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +public class ReportService { + private final EasyPostClient client; + + /** + * ReportService constructor. + * + * @param client The client object. + */ + ReportService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a Report from a map of parameters. + * + * @param params a map of parameters. + * @return Report object. + * @throws EncodingError if the parameters cannot be encoded. + * @throws MissingParameterError if required parameters are missing. + * @throws EasyPostException when the request fails. + */ + public Report create(final Map params) throws EasyPostException { + if (params.containsKey("type")) { + String type = (String) params.get("type"); + HashMap paramsWithoutType = new HashMap<>(params); + paramsWithoutType.remove("type"); + String endpoint = reportURL(type); + return Requestor.request(RequestMethod.POST, endpoint, paramsWithoutType, Report.class, client); + } else { + throw new MissingParameterError("type"); + } + } + + /** + * Generate a report URL. + * + * @param type the type of report to generate. + * @return the URL to generate the report. + * @throws EncodingError when the request cannot be encoded properly. + */ + protected String reportURL(final String type) throws EasyPostException { + try { + String urlType = URLEncoder.encode(type, "UTF-8").toLowerCase(); + return "reports/" + urlType; + } catch (java.io.UnsupportedEncodingException e) { + throw new EncodingError(String.format(Constants.ErrorMessages.ENCODED_ERROR, "report type"), e); + } + } + + /** + * Retrieve a Report from the API. + * + * @param id the ID of the Report to retrieve. + * @return Report object. + * @throws EasyPostException when the request fails. + */ + public Report retrieve(final String id) throws EasyPostException { + String endpoint = "reports/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Report.class, client); + } + + /** + * Get a list of Reports from the API. + * + * @param params a map of parameters. + * @return ReportCollection object. + * @throws EasyPostException when the request fails. + */ + public ReportCollection all(final Map params) throws EasyPostException { + String type = (String) params.get("type"); + params.remove(type); + String endpoint = reportURL(type); + + ReportCollection collection = + Requestor.request(RequestMethod.GET, endpoint, params, ReportCollection.class, client); + // we store the type of reports in this collection, for use in pagination + collection.setType(type); + return collection; + + } + + /** + * Get the next page of an ReportCollection. + * + * @param collection ReportCollection to get next page of. + * @return ReportCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ReportCollection getNextPage(ReportCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an ReportCollection. + * + * @param collection ReportCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return ReportCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ReportCollection getNextPage(ReportCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, ReportCollection>() { + @Override @SneakyThrows + public ReportCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getReports(), pageSize); + } +} diff --git a/src/main/java/com/easypost/service/ScanformService.java b/src/main/java/com/easypost/service/ScanformService.java new file mode 100644 index 000000000..a3f95e07a --- /dev/null +++ b/src/main/java/com/easypost/service/ScanformService.java @@ -0,0 +1,92 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.ScanFormCollection; +import com.easypost.model.ScanForm; +import lombok.SneakyThrows; + +import java.util.Map; +import java.util.function.Function; + +public class ScanformService { + private final EasyPostClient client; + + /** + * ScanformService constructor. + * + * @param client The client object. + */ + ScanformService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a ScanForm from a map of parameters. + * + * @param params the map of parameters. + * @return ScanForm object. + * @throws EasyPostException when the request fails. when the request fails. + */ + public ScanForm create(final Map params) throws EasyPostException { + String endpoint = "scan_forms"; + + return Requestor.request(RequestMethod.POST, endpoint, params, ScanForm.class, client); + } + + /** + * Retrieve a ScanForm from the API. + * + * @param id the id of the ScanForm to retrieve. + * @return ScanForm object. + * @throws EasyPostException when the request fails. when the request fails. + */ + public ScanForm retrieve(final String id) throws EasyPostException { + String endpoint = "scan_forms/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, ScanForm.class, client); + } + + /** + * Get a list of ScanForms from the API. + * + * @param params the parameters to send to the API. + * @return ScanFormCollection object. + * @throws EasyPostException when the request fails. when the request fails. + */ + public ScanFormCollection all(final Map params) throws EasyPostException { + String endpoint = "scan_forms"; + + return Requestor.request(RequestMethod.GET, endpoint, params, ScanFormCollection.class, client); + } + + /** + * Get the next page of an ScanFormCollection. + * + * @param collection ScanFormCollection to get next page of. + * @return ScanFormCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ScanFormCollection getNextPage(ScanFormCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an ScanFormCollection. + * + * @param collection ScanFormCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return ScanFormCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ScanFormCollection getNextPage(ScanFormCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, ScanFormCollection>() { + @Override @SneakyThrows + public ScanFormCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getScanForms(), pageSize); + } +} diff --git a/src/main/java/com/easypost/service/ShipmentService.java b/src/main/java/com/easypost/service/ShipmentService.java new file mode 100644 index 000000000..8c8b80c9b --- /dev/null +++ b/src/main/java/com/easypost/service/ShipmentService.java @@ -0,0 +1,447 @@ +package com.easypost.service; + +import com.easypost.Constants; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.exception.General.FilteringError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.ShipmentCollection; +import com.easypost.model.EstimatedDeliveryDate; +import com.easypost.model.EstimatedDeliveryDateResponse; +import com.easypost.model.Rate; +import com.easypost.model.RecommendShipDateForShipmentResult; +import com.easypost.model.RecommendShipDateResponse; +import com.easypost.model.Shipment; +import com.easypost.model.SmartRate; +import com.easypost.model.SmartRateAccuracy; +import com.easypost.model.SmartRateCollection; +import com.easypost.utils.InternalUtilities; +import lombok.SneakyThrows; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +public class ShipmentService { + private final EasyPostClient client; + + /** + * ShipmentService constructor. + * + * @param client The client object. + */ + ShipmentService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a new Shipment object from a map of parameters. + * + * @param params The map of parameters. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap<>(); + wrappedParams.put("shipment", params); + + String endpoint = "shipments"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Shipment.class, client); + } + + /** + * Retrieve a Shipment from the API. + * + * @param id The ID of the Shipment to retrieve. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment retrieve(final String id) throws EasyPostException { + String endpoint = "shipments/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Shipment.class, client); + } + + /** + * Get a list of all Shipment objects. + * + * @param params The options for the query. + * @return ShipmentCollection object + * @throws EasyPostException when the request fails. + */ + public ShipmentCollection all(final Map params) throws EasyPostException { + String endpoint = "shipments"; + + ShipmentCollection shipmentCollection = Requestor.request(RequestMethod.GET, endpoint, params, + ShipmentCollection.class, client); + // we store the params in the collection so that we can use them to get the next + // page + + shipmentCollection.setPurchased(InternalUtilities.getOrDefault(params, "purchased", null)); + shipmentCollection.setIncludeChildren(InternalUtilities.getOrDefault(params, "include_children", null)); + + return shipmentCollection; + } + + /** + * Get the next page of an ShipmentCollection. + * + * @param collection ShipmentCollection to get next page of. + * @return ShipmentCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ShipmentCollection getNextPage(ShipmentCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an ShipmentCollection. + * + * @param collection ShipmentCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return ShipmentCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ShipmentCollection getNextPage(ShipmentCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, ShipmentCollection>() { + @Override + @SneakyThrows + public ShipmentCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getShipments(), pageSize); + } + + /** + * Get new rates for this Shipment. + * + * @param id The ID of shipment. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment newRates(final String id) throws EasyPostException { + return this.newRates(id, new HashMap()); + } + + /** + * Get new rates for this Shipment. + * + * @param id The ID of shipment. + * @param params The options for the query. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment newRates(final String id, final Map params) throws EasyPostException { + String endpoint = "shipments/" + id + "/rerate"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Shipment.class, client); + } + + /** + * Get SmartRate for this Shipment. + * + * @param id The ID of shipment. + * @return List of SmartRate objects + * @throws EasyPostException when the request fails. + */ + public List smartRates(final String id) throws EasyPostException { + return this.smartRates(id, null); + } + + /** + * Get SmartRates for this Shipment. + * + * @param id The ID of shipment. + * @param params The options for the query. + * @return List of SmartRate objects + * @throws EasyPostException when the request fails. + */ + public List smartRates(final String id, final Map params) throws EasyPostException { + String endpoint = "shipments/" + id + "/smartrate"; + + SmartRateCollection smartRateCollection = Requestor.request(RequestMethod.GET, endpoint, params, + SmartRateCollection.class, client); + + return smartRateCollection.getSmartRates(); + } + + /** + * Buy this Shipment. + * + * @param id The ID of shipment. + * @param params The options for the query. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment buy(final String id, final Map params) throws EasyPostException { + return this.buy(id, params, null); + } + + /** + * Buy this Shipment. + * + * @param id The ID of shipment. + * @param rate The Rate to use for this Shipment. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment buy(final String id, final Rate rate) throws EasyPostException { + Map params = new HashMap<>(); + params.put("rate", rate); + + return this.buy(id, params, null); + } + + /** + * Buy this Shipment. + * + * @param id The ID of shipment. + * @param rate The Rate to use for this Shipment. + * @param endShipperId The id of the end shipper to use for this purchase. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment buy(final String id, final Rate rate, final String endShipperId) throws EasyPostException { + Map params = new HashMap<>(); + params.put("rate", rate); + + return this.buy(id, params, endShipperId); + } + + /** + * Buy this Shipment. + * + * @param id The ID of shipment. + * @param params The options for the query. + * @param endShipperId The id of the end shipper to use for this purchase. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment buy(final String id, final Map params, final String endShipperId) + throws EasyPostException { + if (endShipperId != null && !endShipperId.isEmpty()) { + params.put("end_shipper_id", endShipperId); + } + + String endpoint = "shipments/" + id + "/buy"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Shipment.class, client); + } + + /** + * Refund this Shipment. + * + * @param id The ID of shipment. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment refund(final String id) throws EasyPostException { + return this.refund(id, null); + } + + /** + * Refund this Shipment. + * + * @param id The ID of shipment. + * @param params The options for the query. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment refund(final String id, final Map params) throws EasyPostException { + String endpoint = "shipments/" + id + "/refund"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Shipment.class, client); + } + + /** + * Label this Shipment. + * + * @param params The options for the query. + * @param id The ID of shipment. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment label(final String id, final Map params) throws EasyPostException { + String endpoint = "shipments/" + id + "/label"; + + return Requestor.request(RequestMethod.GET, endpoint, params, Shipment.class, client); + } + + /** + * Insure this Shipment. + * + * @param params The options for the query. + * @param id The ID of shipment. + * @return Shipment object + * @throws EasyPostException when the request fails. + */ + public Shipment insure(final String id, final Map params) throws EasyPostException { + String endpoint = "shipments/" + id + "/insure"; + + return Requestor.request(RequestMethod.POST, endpoint, params, Shipment.class, client); + } + + /** + * Get the lowest SmartRate for this Shipment. + * + * @param id The ID of shipment. + * @param deliveryDay Delivery days restriction to use when filtering. + * @param deliveryAccuracy Delivery days accuracy restriction to use when + * filtering. + * @return lowest SmartRate object + * @throws EasyPostException when the request fails. + */ + public SmartRate lowestSmartRate(final String id, final int deliveryDay, SmartRateAccuracy deliveryAccuracy) + throws EasyPostException { + List smartrates = this.smartRates(id, null); + + SmartRate lowestSmartRate = findLowestSmartRate(smartrates, deliveryDay, deliveryAccuracy); + + return lowestSmartRate; + } + + /** + * Find the lowest SmartRate from a list of SmartRates. + * + * @param smartRates List of SmartRates to filter from. + * @param deliveryDay Delivery days restriction to use when filtering. + * @param deliveryAccuracy Delivery days accuracy restriction to use when + * filtering. + * @return lowest SmartRate object + * @throws EasyPostException when the request fails. + */ + public SmartRate findLowestSmartRate(final List smartRates, int deliveryDay, + SmartRateAccuracy deliveryAccuracy) throws EasyPostException { + SmartRate lowestSmartRate = null; + + for (SmartRate rate : smartRates) { + int smartrateDeliveryDay = rate.getTimeInTransit().getSmartRateAccuracy(deliveryAccuracy); + + if (smartrateDeliveryDay > deliveryDay) { + continue; + } else if (lowestSmartRate == null || rate.getRate() < lowestSmartRate.getRate()) { + lowestSmartRate = rate; + } + } + + if (lowestSmartRate == null) { + throw new FilteringError(String.format(Constants.ErrorMessages.NO_OBJECT_FOUND, "rate")); + } + + return lowestSmartRate; + } + + /** + * Generate a form for this shipment. + * + * @param id The ID of shipment. + * @param formType The form type for this shipment. + * @return Return a shipment object. + * @throws EasyPostException when the request fails. + */ + public Shipment generateForm(final String id, final String formType) throws EasyPostException { + return this.generateForm(id, formType, new HashMap<>()); + } + + /** + * Generate a form for this shipment. + * + * @param id The ID of shipment. + * @param formType The form type for this shipment. + * @param formOptions The form options for this shipment. + * @return Return a shipment object. + * @throws EasyPostException when the request fails. + */ + public Shipment generateForm(final String id, final String formType, final Map formOptions) + throws EasyPostException { + HashMap params = new HashMap<>(); + HashMap wrappedParams = new HashMap<>(); + + params.put("type", formType); + params.putAll(formOptions); + wrappedParams.put("form", params); + + String endpoint = "shipments/" + id + "/forms"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Shipment.class, + client); + } + + /** + * Retrieves the estimated delivery date of each Rate via SmartRate. + * + * @param id The id of the shipment. + * @param plannedShipDate The planned shipment date. + * @return List of EstimatedDeliveryDate objects. + * @throws EasyPostException When the request fails. + */ + public List retrieveEstimatedDeliveryDate(final String id, final String plannedShipDate) + throws EasyPostException { + HashMap params = new HashMap<>(); + params.put("planned_ship_date", plannedShipDate); + String endpoint = "shipments/" + id + "/smartrate/delivery_date"; + + EstimatedDeliveryDateResponse response = Requestor.request(RequestMethod.GET, endpoint, params, + EstimatedDeliveryDateResponse.class, client); + return response.getRates(); + } + + /** + * Retrieve a recommended ship date for an existing Shipment via the Precision + * Shipping API, + * based on a specific desired delivery date. + * + * @param id The id of the shipment. + * @param desiredDeliveryDate The desired delivery date. + * @return List of RecommendShipDateForShipmentResult objects. + * @throws EasyPostException When the request fails. + */ + public List recommendShipDate(final String id, final String desiredDeliveryDate) + throws EasyPostException { + HashMap params = new HashMap<>(); + params.put("desired_delivery_date", desiredDeliveryDate); + String endpoint = "shipments/" + id + "/smartrate/precision_shipping"; + + RecommendShipDateResponse response = Requestor.request(RequestMethod.GET, endpoint, params, + RecommendShipDateResponse.class, client); + return response.getRates(); + } + + /** + * Create and buy a Luma Shipment in one call. + * + * @param params The map of parameters. + * @return Shipment object. + * @throws EasyPostException When the request fails. + */ + public Shipment createAndBuyLuma(final Map params) + throws EasyPostException { + Map wrappedParams = new HashMap<>(); + wrappedParams.put("shipment", params); + String endpoint = "shipments/luma"; + + Shipment response = Requestor.request(RequestMethod.POST, endpoint, wrappedParams, + Shipment.class, client); + return response; + } + + /** + * Buy a Shipment with Luma. + * + * @param id The ID of shipment. + * @param params The map of parameters. + * @return Shipment object. + * @throws EasyPostException When the request fails. + */ + public Shipment buyLuma(final String id, final Map params) + throws EasyPostException { + String endpoint = "shipments/" + id + "/luma"; + + Shipment response = Requestor.request(RequestMethod.POST, endpoint, params, + Shipment.class, client); + return response; + } +} diff --git a/src/main/java/com/easypost/service/SmartRateService.java b/src/main/java/com/easypost/service/SmartRateService.java new file mode 100644 index 000000000..fdd92a169 --- /dev/null +++ b/src/main/java/com/easypost/service/SmartRateService.java @@ -0,0 +1,53 @@ +package com.easypost.service; + +import java.util.Map; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.EstimateDeliveryDateForZipPairResult; +import com.easypost.model.RecommendShipDateForZipPairResult; + +public class SmartRateService { + private final EasyPostClient client; + + /** + * TrackerService constructor. + * + * @param client The client object. + */ + SmartRateService(EasyPostClient client) { + this.client = client; + } + + /** + * Retrieve a recommended ship date for an existing Shipment via the Precision Shipping API, + * based on a specific desired delivery date. + * + * @param params Parameters to include on the API call. + * @return EstimatedDeliveryDate object. + * @throws EasyPostException When the request fails. + */ + public RecommendShipDateForZipPairResult recommendShipDate(final Map params) + throws EasyPostException { + String endpoint = "smartrate/deliver_on"; + + return Requestor.request(RequestMethod.POST, endpoint, params, RecommendShipDateForZipPairResult.class, client); + } + + /** + * Retrieve the estimated delivery date of each carrier-service level combination via the + * Smart Deliver By API, based on a specific ship date and origin-destination postal code pair. + * + * @param params Parameters to include on the API call. + * @return EstimatedDeliveryDate object. + * @throws EasyPostException When the request fails. + */ + public EstimateDeliveryDateForZipPairResult estimateDeliveryDate(final Map params) + throws EasyPostException { + String endpoint = "smartrate/deliver_by"; + + return Requestor.request(RequestMethod.POST, endpoint, params, + EstimateDeliveryDateForZipPairResult.class, client); + } +} diff --git a/src/main/java/com/easypost/service/TrackerService.java b/src/main/java/com/easypost/service/TrackerService.java new file mode 100644 index 000000000..9b2f73d2a --- /dev/null +++ b/src/main/java/com/easypost/service/TrackerService.java @@ -0,0 +1,131 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.TrackerCollection; +import com.easypost.model.Tracker; +import com.easypost.utils.InternalUtilities; +import lombok.SneakyThrows; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +public class TrackerService { + private final EasyPostClient client; + + /** + * TrackerService constructor. + * + * @param client The client object. + */ + TrackerService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a new Tracker object using a map of parameters. + * + * @param params Map of parameters used to create the Tracker. + * @return Tracker object. + * @throws EasyPostException when the request fails. + */ + public Tracker create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("tracker", params); + + String endpoint = "trackers"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Tracker.class, client); + } + + /** + * Retrieve a Tracker object from the API. + * + * @param id ID of the Tracker to retrieve. + * @return Tracker object. + * @throws EasyPostException when the request fails. + */ + public Tracker retrieve(final String id) throws EasyPostException { + String endpoint = "trackers/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Tracker.class, client); + } + + /** + * Get a list of all Tracker objects. + * + * @param params Map of parameters used to filter the list of Trackers. + * @return TrackerCollection object. + * @throws EasyPostException when the request fails. + */ + public TrackerCollection all(final Map params) throws EasyPostException { + String endpoint = "trackers"; + + TrackerCollection trackerCollection = + Requestor.request(RequestMethod.GET, endpoint, params, TrackerCollection.class, client); + // we store the params in the collection so that we can use them to get the next page + trackerCollection.setTrackingCode(InternalUtilities.getOrDefault(params, "tracking_code", null)); + trackerCollection.setCarrier(InternalUtilities.getOrDefault(params, "carrier", null)); + + return trackerCollection; + } + + /** + * Get the next page of an TrackerCollection. + * + * @param collection TrackerCollection to get next page of. + * @return TrackerCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public TrackerCollection getNextPage(TrackerCollection collection) throws EndOfPaginationError { + return getNextPage(collection, null); + } + + /** + * Get the next page of an TrackerCollection. + * + * @param collection TrackerCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return TrackerCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public TrackerCollection getNextPage(TrackerCollection collection, Integer pageSize) throws EndOfPaginationError { + return collection.getNextPage(new Function, TrackerCollection>() { + @Override @SneakyThrows + public TrackerCollection apply(Map parameters) { + return all(parameters); + } + }, collection.getTrackers(), pageSize); + } + + /** + * Retrieve a batch of Tracker objects. + * + * @param params Map of parameters used to filter the list of Trackers. + * @return TrackerCollection object. + * @throws EasyPostException when the request fails. + */ + public TrackerCollection retrieveBatch(final Map params) throws EasyPostException { + String endpoint = "trackers/batch"; + + TrackerCollection trackerCollection = + Requestor.request(RequestMethod.POST, endpoint, params, TrackerCollection.class, client); + + return trackerCollection; + } + + /** + * Delete a Tracker object. + * + * @param id ID of the Tracker to delete. + * @throws EasyPostException when the request fails. + */ + public void delete(final String id) throws EasyPostException { + String endpoint = String.format("trackers/%s", id); + + Requestor.request(RequestMethod.DELETE, endpoint, null, Tracker.class, client); + } +} diff --git a/src/main/java/com/easypost/service/UserService.java b/src/main/java/com/easypost/service/UserService.java new file mode 100644 index 000000000..d437b73d5 --- /dev/null +++ b/src/main/java/com/easypost/service/UserService.java @@ -0,0 +1,146 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.Brand; +import com.easypost.model.ChildUserCollection; +import com.easypost.model.User; + +import lombok.SneakyThrows; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +public class UserService { + private final EasyPostClient client; + + /** + * UserService constructor. + * + * @param client The client object. + */ + UserService(EasyPostClient client) { + this.client = client; + } + + /** + * Retrieve a User from the API. + * + * @param id The ID of the User to retrieve. + * @return User object. + * @throws EasyPostException when the request fails. + */ + public User retrieve(final String id) throws EasyPostException { + String endpoint = "users/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, User.class, client); + } + + /** + * Retrieve your User from the API. + * + * @return User object. + * @throws EasyPostException when the request fails. + */ + public User retrieveMe() throws EasyPostException { + String endpoint = "users"; + + return Requestor.request(RequestMethod.GET, endpoint, null, User.class, client); + } + + /** + * Create a User object with a map of parameters. + * + * @param params Map of User parameters. + * @return User object. + * @throws EasyPostException when the request fails. + */ + public User create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("user", params); + + String endpoint = "users"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, User.class, client); + } + + /** + * Update this User. + * + * @param id The ID of user. + * @param params Map of User parameters. + * @return User object. + * @throws EasyPostException when the request fails. + */ + public User update(final String id, final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("user", params); + + String endpoint = "users/" + id; + + return Requestor.request(RequestMethod.PUT, endpoint, wrappedParams, User.class, client); + } + + /** + * Delete this User. + * + * @param id The ID of the user. + * @throws EasyPostException when the request fails. + */ + public void delete(final String id) throws EasyPostException { + String endpoint = "users/" + id; + + Requestor.request(RequestMethod.DELETE, endpoint, null, User.class, client); + } + + /** + * Update the user brand. + * + * @param id The ID of user. + * @param params Map of parameters. + * @return Brand object. + * @throws EasyPostException when the request fails. + */ + public Brand updateBrand(final String id, final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("brand", params); + + String endpoint = "users/" + id + "/brand"; + + return Requestor.request(RequestMethod.PUT, endpoint, wrappedParams, Brand.class, client); + } + + /** + * Retrieve the paginated list of child users for the authenticated user. + * + * @param params Map of parameters. + * @return ChildUserCollection object. + * @throws EasyPostException when the request fails. + */ + public ChildUserCollection allChildren(final Map params) throws EasyPostException { + String endpoint = "users/children"; + + return Requestor.request(RequestMethod.GET, endpoint, params, ChildUserCollection.class, client); + } + + /** + * Get the next page of a ChildUserCollection. + * + * @param collection ChildUserCollection to get next page of. + * @param pageSize The number of results to return on the next page. + * @return ChildUserCollection object. + * @throws EndOfPaginationError when there are no more pages to retrieve. + */ + public ChildUserCollection getNextPage(ChildUserCollection collection, Integer pageSize) + throws EndOfPaginationError { + return collection.getNextPage(new Function, ChildUserCollection>() { + @Override @SneakyThrows + public ChildUserCollection apply(Map parameters) { + return allChildren(parameters); + } + }, collection.getChildren(), pageSize); + } +} diff --git a/src/main/java/com/easypost/service/WebhookService.java b/src/main/java/com/easypost/service/WebhookService.java new file mode 100644 index 000000000..19c2d5032 --- /dev/null +++ b/src/main/java/com/easypost/service/WebhookService.java @@ -0,0 +1,115 @@ +package com.easypost.service; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.Webhook; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.List; + +public class WebhookService { + private final EasyPostClient client; + + /** + * WebhookService constructor. + * + * @param client The client object. + */ + WebhookService(EasyPostClient client) { + this.client = client; + } + + /** + * Create a Webhook object from a map of parameters. + * + * @param params the map of parameters + * @return Webhook object + * @throws EasyPostException when the request fails. + */ + public Webhook create(final Map params) throws EasyPostException { + Map wrappedParams = new HashMap(); + wrappedParams.put("webhook", params); + + String endpoint = "webhooks"; + + return Requestor.request(RequestMethod.POST, endpoint, wrappedParams, Webhook.class, client); + } + + /** + * Retrieve a Webhook object from the API. + * + * @param id the ID of the Webhook to retrieve + * @return Webhook object + * @throws EasyPostException when the request fails. + */ + public Webhook retrieve(final String id) throws EasyPostException { + String endpoint = "webhooks/" + id; + + return Requestor.request(RequestMethod.GET, endpoint, null, Webhook.class, client); + } + + /** + * Get a list of all Webhook objects. + * + * @return List of Webhook objects. + * @throws EasyPostException when the request fails. + */ + public List all() throws EasyPostException { + return all(null); + } + + /** + * Get a list of all Webhook objects. + * + * @param params params for request + * @return List of Webhook objects. + * @throws EasyPostException when the request fails. + */ + public List all(final Map params) throws EasyPostException { + String endpoint = "webhooks"; + + Webhook[] response = Requestor.request(RequestMethod.GET, endpoint, params, Webhook[].class, client); + return Arrays.asList(response); + } + + /** + * Delete this Webhook. + * + * @param id The ID of webhook. + * @throws EasyPostException when the request fails. + */ + public void delete(final String id) throws EasyPostException { + String endpoint = "webhooks/" + id; + + Requestor.request(RequestMethod.DELETE, endpoint, null, Webhook.class, client); + } + + /** + * Update this webhook. + * + * @param id The ID of webhook. + * @return Webhook object + * @throws EasyPostException when the request fails. + */ + public Webhook update(final String id) throws EasyPostException { + Map params = new HashMap(); + return this.update(id, params); + } + + /** + * Update this webhook. + * + * @param id The ID of webhook. + * @param params Map of parameters + * @return Webhook object + * @throws EasyPostException when the request fails. + */ + public Webhook update(final String id, final Map params) throws EasyPostException { + String endpoint = "webhooks/" + id; + + return Requestor.request(RequestMethod.PUT, endpoint, params, Webhook.class, client); + } +} diff --git a/src/main/java/com/easypost/service/package-info.java b/src/main/java/com/easypost/service/package-info.java new file mode 100644 index 000000000..ee3b8a066 --- /dev/null +++ b/src/main/java/com/easypost/service/package-info.java @@ -0,0 +1,9 @@ +/** + * Interact with the EasyPost API in Java. + * + * @author EasyPost developers + * @version 6.0 + * @see EasyPost API documentation + * @since 6.0 + */ +package com.easypost.service; diff --git a/src/main/java/com/easypost/utils/ApachePatch.java b/src/main/java/com/easypost/utils/ApachePatch.java new file mode 100644 index 000000000..c5baa3259 --- /dev/null +++ b/src/main/java/com/easypost/utils/ApachePatch.java @@ -0,0 +1,105 @@ +package com.easypost.utils; + +/** + * This class is a collection of Apache functions that have been extracted for use in this application. + * This class is required because Apache's libraries are notorious for security vulnerabilities, so we'll only + * extract the safe functions that we need, rather than importing an entire vulnerable dependency. + *

+ * A lot of the functions in here are lifted straight from Apache's source code with minor alterations, + * so any janky code complaints should be directed at the Apache developers who wrote them probably 20 years ago. + */ +public abstract class ApachePatch { + + /** + * This class was lifted and modified from + * + * common-codec:common-codec version 1.15, + * namespace org.apache.commons.codec.binary.Hex, + * released under the Apache License 2.0. + */ + public static class Hex { + private static final char[] DIGITS_LOWER; + private static final char[] DIGITS_UPPER; + + /** + * Encode a byte array into a hex char array. + * + * @param data the byte array to encode + * @return the hex encoded char array + */ + public static char[] encodeHex(byte[] data) { + return encodeHex(data, true); + } + + /** + * Encode a byte array into a hex char array. + * + * @param data the byte array to encode + * @param toLowerCase {@code true} converts to lowercase, {@code false} to uppercase + * @return the hex encoded char array + */ + public static char[] encodeHex(byte[] data, boolean toLowerCase) { + return encodeHex(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER); + } + + /** + * Encode a byte array into a hex char array. + * + * @param data the byte array to encode + * @param toDigits map of elements to convert to digits + * @return the hex encoded char array + */ + protected static char[] encodeHex(byte[] data, char[] toDigits) { + int l = data.length; + char[] out = new char[l << 1]; + int i = 0; + + for (int j = 0; i < l; ++i) { + out[j++] = toDigits[(240 & data[i]) >>> 4]; + out[j++] = toDigits[15 & data[i]]; + } + + return out; + } + + static { + DIGITS_LOWER = new char[] { + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f' + }; + DIGITS_UPPER = new char[] { + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F' + }; + } + } + +} diff --git a/src/main/java/com/easypost/utils/Cryptography.java b/src/main/java/com/easypost/utils/Cryptography.java new file mode 100644 index 000000000..1c23c1769 --- /dev/null +++ b/src/main/java/com/easypost/utils/Cryptography.java @@ -0,0 +1,116 @@ +package com.easypost.utils; + +import com.easypost.utils.ApachePatch.Hex; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.text.Normalizer; + +/** + * Class for various cryptography utilities. + */ +public abstract class Cryptography { + /** + * Enums for the supported HMAC algorithms. + */ + public enum HmacAlgorithm { + MD5("HmacMD5"), + SHA1("HmacSHA1"), + SHA256("HmacSHA256"), + SHA512("HmacSHA512"); + + private final String algorithmString; + + /** + * Constructor. + * + * @param algorithmString the algorithm string + */ + HmacAlgorithm(String algorithmString) { + this.algorithmString = algorithmString; + } + } + + /** + * Hex-encode a byte array to a string. + * + * @param bytes the byte array to hex-encode. + * @return the hex-encoded byte array string. + */ + public static String hexEncodeToString(byte @NotNull [] bytes) { + return new String(Hex.encodeHex(bytes)); + } + + /** + * Calculate the HMAC-SHA256 hex digest of a string. + * + * @param data Data to calculate hex digest for. + * @param key Key to use in HMAC calculation. + * @param normalizationForm {@link Normalizer.Form} to use when normalizing key. No normalization when null. + * @return Hex digest of data. + */ + public static String toHMACSHA256HexDigest(byte @NotNull [] data, @NotNull String key, + Normalizer.@Nullable Form normalizationForm) { + if (normalizationForm != null) { + key = Normalizer.normalize(key, normalizationForm); + } + + byte[] hmacBytes = createHMAC(data, key, HmacAlgorithm.SHA256); + return hexEncodeToString(hmacBytes); + } + + /** + * Calculate the HMAC hex digest of a string. + * + * @param data Data to calculate hex digest for. + * @param key Key to use in HMAC calculation. + * @param algorithm {@link HmacAlgorithm} to use to calculate HMAC. + * @return Hex digest of data. + */ + public static byte[] createHMAC(byte @NotNull [] data, @NotNull String key, @NotNull HmacAlgorithm algorithm) { + // create HMAC-SHA256 generator and compute hash of data + byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8); + SecretKeySpec keyHash = new SecretKeySpec(keyBytes, algorithm.algorithmString); + + try { + Mac hmac = Mac.getInstance(algorithm.algorithmString); + hmac.init(keyHash); + return hmac.doFinal(data); + } catch (InvalidKeyException | NoSuchAlgorithmException e) { + throw new IllegalStateException("Cannot initialize Mac Generator", e); + } + } + + /** + * Check whether two signatures match. This is safe against timing attacks. + * + * @param signature1 First signature to check. + * @param signature2 Second signature to check. + * @return True if signatures match, false otherwise. + */ + public static boolean signaturesMatch(byte @NotNull [] signature1, byte @NotNull [] signature2) { + // after Java SE 6 Update 17, MessageDigest.isEqual() is safe against timing attacks. + // see: https://codahale.com//a-lesson-in-timing-attacks/ + return MessageDigest.isEqual(signature1, signature2); + } + + /** + * Check whether two signatures match. This is safe against timing attacks. + * + * @param signature1 First signature to check. + * @param signature2 Second signature to check. + * @return True if signatures match, false otherwise. + */ + public static boolean signaturesMatch(@NotNull String signature1, @NotNull String signature2) { + byte[] signature1Bytes = signature1.getBytes(StandardCharsets.UTF_8); + byte[] signature2Bytes = signature2.getBytes(StandardCharsets.UTF_8); + return signaturesMatch(signature1Bytes, signature2Bytes); + } +} + diff --git a/src/main/java/com/easypost/utils/InternalUtilities.java b/src/main/java/com/easypost/utils/InternalUtilities.java new file mode 100644 index 000000000..7c42c73ca --- /dev/null +++ b/src/main/java/com/easypost/utils/InternalUtilities.java @@ -0,0 +1,55 @@ +package com.easypost.utils; + +import com.easypost.exception.API.EncodingError; + +import java.net.URLEncoder; + +import java.util.Map; + +public abstract class InternalUtilities { + /** + * Create Encoded URL from a Map. + * + * @param params Map of parameters to be encoded. + * @param parentKey Parent key in the encoded URL. + * @return Encoded URL for Stripe API call. + * @throws EncodingError when the URL encoding fails. + */ + public static String getEncodedURL(Map params, String parentKey) throws EncodingError { + StringBuilder result = new StringBuilder(); + boolean first = true; + + try { + for (Map.Entry entry : params.entrySet()) { + if (first) { + first = false; + } else { + result.append("&"); + } + + result.append(URLEncoder.encode(parentKey + "[" + entry.getKey() + "]", "UTF-8")); + result.append("="); + result.append(URLEncoder.encode(entry.getValue(), "UTF-8")); + } + } catch (Exception e) { + throw new EncodingError("Something went wrong during the URL encoding."); + } + + return result.toString(); + } + + /** + * Extract a value from a Map, or return a default value if the key is not present. + * @param map Map to extract from + * @param key Key to extract + * @param defaultValue Default value to return if the key is not present + * @return Value from the map, or the default value if the key is not present + * @param Type of the value to extract + */ + @SuppressWarnings("unchecked") + public static TElement getOrDefault(Map map, String key, TElement defaultValue) { + // The built-in Map.getOrDefault() method extracts a value of type Object, + // so this handles the cast. + return (TElement) map.getOrDefault(key, defaultValue); + } +} diff --git a/src/main/java/com/easypost/utils/Utilities.java b/src/main/java/com/easypost/utils/Utilities.java new file mode 100644 index 000000000..80d6545d9 --- /dev/null +++ b/src/main/java/com/easypost/utils/Utilities.java @@ -0,0 +1,171 @@ +package com.easypost.utils; + +import com.easypost.Constants; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.FilteringError; +import com.easypost.exception.General.SignatureVerificationError; +import com.easypost.model.Event; +import com.easypost.model.Rate; +import com.easypost.model.SmartRate; +import com.easypost.model.SmartRateAccuracy; +import com.easypost.model.StatelessRate; + +import java.util.List; +import java.util.Map; +import java.nio.charset.StandardCharsets; +import java.text.Normalizer; + +public abstract class Utilities { + /** + * Get the lowest stateless rate from a list of stateless rates. + * + * @param rates the list of stateless rates. + * @param carriers the carriers to use in the filter. + * @param services the services to use in the filter. + * @return lowest StatelessRate object + * @throws FilteringError when the filters could not be applied. + */ + public static StatelessRate getLowestStatelessRate(List rates, List carriers, + List services) + throws FilteringError, NumberFormatException { + StatelessRate lowestRate = null; + + if (carriers != null) { + carriers.replaceAll(String::toLowerCase); + } + + if (services != null) { + services.replaceAll(String::toLowerCase); + } + + for (StatelessRate rate : rates) { + if ((carriers != null && !carriers.contains(rate.getCarrier().toLowerCase())) || + (services != null && !services.contains(rate.getService().toLowerCase()))) { + continue; + } + + if (lowestRate == null || Float.parseFloat(rate.getRate()) < Float.parseFloat(lowestRate.getRate())) { + lowestRate = rate; + } + } + + if (lowestRate == null) { + throw new FilteringError(String.format( + Constants.ErrorMessages.NO_OBJECT_FOUND, "rates")); + } + + return lowestRate; + } + + /** + * Get the lowest rate from a list of rates. + * + * @param rates the list of rates. + * @param carriers the carriers to use in the filter. + * @param services the services to use in the filter. + * @return lowest Rate object + * @throws FilteringError when the filters could not be applied. + */ + public static Rate getLowestObjectRate(List rates, List carriers, List services) + throws FilteringError { + Rate lowestRate = null; + + if (carriers != null) { + carriers.replaceAll(String::toLowerCase); + } + + if (services != null) { + services.replaceAll(String::toLowerCase); + } + + for (Rate rate : rates) { + if ((carriers != null && !carriers.contains(rate.getCarrier().toLowerCase())) || + (services != null && !services.contains(rate.getService().toLowerCase()))) { + continue; + } + + if (lowestRate == null || rate.getRate() < lowestRate.getRate()) { + lowestRate = rate; + } + } + + if (lowestRate == null) { + throw new FilteringError(String.format( + Constants.ErrorMessages.NO_OBJECT_FOUND, "rates")); + } + + return lowestRate; + } + + /** + * Validate a webhook by comparing the HMAC signature header sent from EasyPost + * to your shared secret. + * If the signatures do not match, an error will be raised signifying + * the webhook either did not originate from EasyPost or the secrets do not + * match. + * If the signatures do match, the `event_body` will be returned as JSON. + * + * @param eventBody Data to validate + * @param headers Headers received from the webhook + * @param webhookSecret Shared secret to use in validation + * @return JSON string of the event body if the signatures match, otherwise an + * error will be raised. + * @throws EasyPostException when the request fails. + */ + public static Event validateWebhook(byte[] eventBody, Map headers, String webhookSecret) + throws EasyPostException { + + String providedSignature = null; + try { + providedSignature = headers.get("X-Hmac-Signature").toString(); + } catch (NullPointerException ignored) { // catch error raised if header key doesn't exist + } + + if (providedSignature != null) { + String calculatedDigest = Cryptography.toHMACSHA256HexDigest(eventBody, webhookSecret, + Normalizer.Form.NFKD); + String calculatedSignature = "hmac-sha256-hex=" + calculatedDigest; + + if (Cryptography.signaturesMatch(providedSignature, calculatedSignature)) { + // Serialize data into a JSON string, then into an Event object + String json = new String(eventBody, StandardCharsets.UTF_8); + return Constants.Http.GSON.fromJson(json, Event.class); + } else { + throw new SignatureVerificationError(Constants.ErrorMessages.WEBHOOK_DOES_NOT_MATCH); + } + } else { + throw new SignatureVerificationError(Constants.ErrorMessages.INVALID_WEBHOOK_SIGNATURE); + } + } + + /** + * Find the lowest SmartRate from a list of SmartRates. + * + * @param smartRates List of SmartRates to filter from. + * @param deliveryDay Delivery days restriction to use when filtering. + * @param deliveryAccuracy Delivery days accuracy restriction to use when + * filtering. + * @return lowest SmartRate object + * @throws EasyPostException when the request fails. + */ + public static SmartRate findLowestSmartRate(final List smartRates, int deliveryDay, + SmartRateAccuracy deliveryAccuracy) throws EasyPostException { + SmartRate lowestSmartRate = null; + + for (SmartRate rate : smartRates) { + int smartrateDeliveryDay = rate.getTimeInTransit().getSmartRateAccuracy(deliveryAccuracy); + + if (smartrateDeliveryDay > deliveryDay) { + continue; + } else if (lowestSmartRate == null || rate.getRate() < lowestSmartRate.getRate()) { + lowestSmartRate = rate; + } + } + + if (lowestSmartRate == null) { + throw new FilteringError(String.format(Constants.ErrorMessages.NO_OBJECT_FOUND, "rate")); + } + + return lowestSmartRate; + } +} diff --git a/src/main/java/com/easypost/utils/package-info.java b/src/main/java/com/easypost/utils/package-info.java new file mode 100644 index 000000000..d4b3b19f8 --- /dev/null +++ b/src/main/java/com/easypost/utils/package-info.java @@ -0,0 +1,9 @@ +/** + * Utility classes for the EasyPost API Java client library. + * + * @author EasyPost developers + * @version 1.0 + * @see EasyPost API + * @since 1.0 + */ +package com.easypost.utils; diff --git a/src/test/cassettes/address/all.json b/src/test/cassettes/address/all.json new file mode 100644 index 000000000..aa7e2af0c --- /dev/null +++ b/src/test/cassettes/address/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823868, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"addresses\": [\n {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"created_at\": \"2024-08-16T15:57:48+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": false,\n \"details\": {},\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n },\n \"zip4\": {\n \"success\": false,\n \"details\": null,\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"id\": \"adr_48a452065be811efa361ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"created_at\": \"2024-08-16T15:57:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"id\": \"adr_486606135be811efa22bac1f6bc53342\",\n \"street2\": null,\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_3eff5a295be811efa09cac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:30+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_3e2c6e065be811ef9b30ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:30+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_3e29d0d95be811ef9c55ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2807" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76fce786bd450035cf4d" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.038266" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 240 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/create.json b/src/test/cassettes/address/create.json new file mode 100644 index 000000000..2b1f4a5cd --- /dev/null +++ b/src/test/cassettes/address/create.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823871, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:51+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:51+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_4ab82e265be811efa827ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "461" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76ffe786c07a0035d1fe" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.101153" + ], + "location": [ + "/api/v2/addresses/adr_4ab82e265be811efa827ac1f6bc539ae" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 315 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/create_and_verify.json b/src/test/cassettes/address/create_and_verify.json new file mode 100644 index 000000000..dfabd9a16 --- /dev/null +++ b/src/test/cassettes/address/create_and_verify.json @@ -0,0 +1,97 @@ +[ + { + "recordedAt": 1723823869, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses/create_and_verify" + }, + "response": { + "body": "{\n \"address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:49+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:49+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_4958dfd85be811ef926b3cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "658" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76fde786bd470035cfb7" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.065712" + ], + "location": [ + "/api/v2/addresses/adr_4958dfd85be811ef926b3cecef1b359e" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses/create_and_verify" + }, + "duration": 282 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/create_and_verify_carrier.json b/src/test/cassettes/address/create_and_verify_carrier.json new file mode 100644 index 000000000..eced704d3 --- /dev/null +++ b/src/test/cassettes/address/create_and_verify_carrier.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1762540176, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"phone\": \"REDACTED\",\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\"\n },\n \"verify_carrier\": \"UPS\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses/create_and_verify" + }, + "response": { + "body": "{\n \"address\": {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"NOT A CITY\",\n \"created_at\": \"2025-11-07T18:29:36Z\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": null,\n \"time_zone\": null,\n \"longitude\": null\n },\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n },\n \"verify_carrier\": \"ups\",\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-11-07T18:29:36Z\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EASYPOST\",\n \"street1\": \"000 UNKNOWN STREET\",\n \"id\": \"adr_b6c1cfd0bc0711f0ac45ac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"ZZ\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "820" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "bcd43725690e3a8fe786bc4002abc67c" + ], + "x-proxied": [ + "intlb6nuq c0061e0a2e", + "extlb2nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.795785" + ], + "location": [ + "/api/v2/addresses/adr_b6c1cfd0bc0711f0ac45ac1f6bc539ae" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202511071754-85836cab32-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses/create_and_verify" + }, + "duration": 968 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/create_verify.json b/src/test/cassettes/address/create_verify.json new file mode 100644 index 000000000..196183145 --- /dev/null +++ b/src/test/cassettes/address/create_verify.json @@ -0,0 +1,189 @@ +[ + { + "recordedAt": 1723823867, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"phone\": \"REDACTED\",\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"created_at\": \"2024-08-16T15:57:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"id\": \"adr_486606135be811efa22bac1f6bc53342\",\n \"street2\": null,\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "453" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76fbe786bd290035ce40" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.036976" + ], + "location": [ + "/api/v2/addresses/adr_486606135be811efa22bac1f6bc53342" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 237 + }, + { + "recordedAt": 1723823868, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"phone\": \"REDACTED\",\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\"\n },\n \"verify\": true\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"created_at\": \"2024-08-16T15:57:48+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": false,\n \"details\": {},\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n },\n \"zip4\": {\n \"success\": false,\n \"details\": null,\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"id\": \"adr_48a452065be811efa361ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "750" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76fce786bd420035cea9" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.061490" + ], + "location": [ + "/api/v2/addresses/adr_48a452065be811efa361ac1f6bc539aa" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 265 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/create_verify_array.json b/src/test/cassettes/address/create_verify_array.json new file mode 100644 index 000000000..53a7c3550 --- /dev/null +++ b/src/test/cassettes/address/create_verify_array.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1723823870, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"phone\": \"REDACTED\",\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"created_at\": \"2024-08-16T15:57:50+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:50+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"id\": \"adr_4a30f2475be811efa41cac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "453" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76fee786c05f0035d125" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.033907" + ], + "location": [ + "/api/v2/addresses/adr_4a30f2475be811efa41cac1f6bc539aa" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 229 + }, + { + "recordedAt": 1723823871, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"phone\": \"REDACTED\",\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\"\n },\n \"verify\": [\n true\n ]\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"created_at\": \"2024-08-16T15:57:51+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": false,\n \"details\": {},\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n },\n \"zip4\": {\n \"success\": false,\n \"details\": null,\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:51+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"id\": \"adr_4a6efddb5be811efa440ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "750" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76ffe786c0610035d191" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.058390" + ], + "location": [ + "/api/v2/addresses/adr_4a6efddb5be811efa440ac1f6bc539aa" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 318 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/create_verify_carrier.json b/src/test/cassettes/address/create_verify_carrier.json new file mode 100644 index 000000000..c68a1aa0e --- /dev/null +++ b/src/test/cassettes/address/create_verify_carrier.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1762540174, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"phone\": \"REDACTED\",\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\"\n },\n \"verify\": true,\n \"verify_carrier\": \"UPS\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"NOT A CITY\",\n \"created_at\": \"2025-11-07T18:29:35Z\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": null,\n \"time_zone\": null,\n \"longitude\": null\n },\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n },\n \"verify_carrier\": \"ups\",\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-11-07T18:29:35Z\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EASYPOST\",\n \"street1\": \"000 UNKNOWN STREET\",\n \"id\": \"adr_b5db9a37bc0711f0967fac1f6bc53342\",\n \"street2\": \"\",\n \"state\": \"ZZ\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "808" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "bcd43726690e3a8ee786bc3b02abc094" + ], + "x-proxied": [ + "intlb6nuq c0061e0a2e", + "extlb2nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.780863" + ], + "location": [ + "/api/v2/addresses/adr_b5db9a37bc0711f0967fac1f6bc53342" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202511071754-85836cab32-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 998 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/create_verify_strict.json b/src/test/cassettes/address/create_verify_strict.json new file mode 100644 index 000000000..21349d8d0 --- /dev/null +++ b/src/test/cassettes/address/create_verify_strict.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823869, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"verify_strict\": true\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:49+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:49+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_499784985be811ef92833cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "646" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76fde786bd4a0035d018" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.068571" + ], + "location": [ + "/api/v2/addresses/adr_499784985be811ef92833cecef1b359e" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 271 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/error_address_creation.json b/src/test/cassettes/address/error_address_creation.json new file mode 100644 index 000000000..9d777e7e1 --- /dev/null +++ b/src/test/cassettes/address/error_address_creation.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1762540339, + "request": { + "body": "{\n \"address\": {}\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses/create_and_verify" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"PARAMETER.REQUIRED\",\n \"message\": \"Missing required parameter.\",\n \"errors\": [\n {\n \"field\": \"address\",\n \"message\": \"cannot be blank\"\n }\n ]\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 422 Unprocessable Entity" + ], + "content-length": [ + "138" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb67nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "bcd43726690e3b33e786c9e602acee37" + ], + "x-proxied": [ + "intlb4nuq c0061e0a2e", + "extlb2nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.018362" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202511071754-85836cab32-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 422, + "message": "Unprocessable Entity" + }, + "uri": "https://api.easypost.com/v2/addresses/create_and_verify" + }, + "duration": 199 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/get_next_page.json b/src/test/cassettes/address/get_next_page.json new file mode 100644 index 000000000..b616b9212 --- /dev/null +++ b/src/test/cassettes/address/get_next_page.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1723823868, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"addresses\": [\n {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"created_at\": \"2024-08-16T15:57:48+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": false,\n \"details\": {},\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n },\n \"zip4\": {\n \"success\": false,\n \"details\": null,\n \"errors\": [\n {\n \"code\": \"E.ADDRESS.NOT_FOUND\",\n \"field\": \"address\",\n \"suggestion\": null,\n \"message\": \"Address not found\"\n }\n ]\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"id\": \"adr_48a452065be811efa361ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"00001\",\n \"country\": \"US\",\n \"city\": \"Not A City\",\n \"created_at\": \"2024-08-16T15:57:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"EasyPost\",\n \"street1\": \"000 unknown street\",\n \"id\": \"adr_486606135be811efa22bac1f6bc53342\",\n \"street2\": null,\n \"state\": \"ZZ\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_3eff5a295be811efa09cac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:30+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_3e2c6e065be811ef9b30ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:30+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_3e29d0d95be811ef9c55ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2807" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76fce786bd430035cee6" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.034749" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 242 + }, + { + "recordedAt": 1723823868, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%61%64%72%5F%33%65%32%39%64%30%64%39%35%62%65%38%31%31%65%66%39%63%35%35%61%63%31%66%36%62%63%35%33%39%61%61" + }, + "response": { + "body": "{\n \"addresses\": [\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:29+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:29+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_3d90bd935be811ef9fc3ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:28+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:28+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_3cac30125be811ef9a64ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:28+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:28+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_3ca9d5f95be811ef8a453cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:24+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:24+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_3a8de5545be811ef993dac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:23+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:23+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_39b43bf05be811ef88a33cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2524" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76fce786bd440035cf1e" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.039206" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%61%64%72%5F%33%65%32%39%64%30%64%39%35%62%65%38%31%31%65%66%39%63%35%35%61%63%31%66%36%62%63%35%33%39%61%61" + }, + "duration": 248 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/retrieve.json b/src/test/cassettes/address/retrieve.json new file mode 100644 index 000000000..6a7fcc7a4 --- /dev/null +++ b/src/test/cassettes/address/retrieve.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1723823870, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:50+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:50+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_49d21efa5be811efa3f2ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "461" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76fee786c05b0035d086" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.058309" + ], + "location": [ + "/api/v2/addresses/adr_49d21efa5be811efa3f2ac1f6bc539aa" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 264 + }, + { + "recordedAt": 1723823870, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/addresses/adr_49d21efa5be811efa3f2ac1f6bc539aa" + }, + "response": { + "body": "{\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:50+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:50+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_49d21efa5be811efa3f2ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "461" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf76fee786c05d0035d0ca" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.030323" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses/adr_49d21efa5be811efa3f2ac1f6bc539aa" + }, + "duration": 231 + } +] \ No newline at end of file diff --git a/src/test/cassettes/address/verify.json b/src/test/cassettes/address/verify.json new file mode 100644 index 000000000..e425dfd97 --- /dev/null +++ b/src/test/cassettes/address/verify.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1723823872, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:52+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_4af720155be811ef93383cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "461" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76ffe786c07c0035d27d" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.038375" + ], + "location": [ + "/api/v2/addresses/adr_4af720155be811ef93383cecef1b359e" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 239 + }, + { + "recordedAt": 1723823872, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/addresses/adr_4af720155be811ef93383cecef1b359e/verify" + }, + "response": { + "body": "{\n \"address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:52+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_4b20eb305be811efa4afac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "658" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf7700e786c07d0035d2c5" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.079549" + ], + "location": [ + "/api/v2/addresses/adr_4b20eb305be811efa4afac1f6bc539aa" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses/adr_4af720155be811ef93383cecef1b359e/verify" + }, + "duration": 277 + } +] \ No newline at end of file diff --git a/src/test/cassettes/api_key/all_api_keys.json b/src/test/cassettes/api_key/all_api_keys.json new file mode 100644 index 000000000..7355579d2 --- /dev/null +++ b/src/test/cassettes/api_key/all_api_keys.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823856, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/api_keys" + }, + "response": { + "body": "{\n \"children\": [\n {\n \"children\": [],\n \"keys\": [],\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\"\n }\n ],\n \"keys\": [],\n \"id\": \"user_04ad194774a54f6c97d1385715721091\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "926" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76f0e786bcc10035c2cc" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.086966" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/api_keys" + }, + "duration": 296 + } +] \ No newline at end of file diff --git a/src/test/cassettes/api_key/api_keys.json b/src/test/cassettes/api_key/api_keys.json new file mode 100644 index 000000000..61e64abf1 --- /dev/null +++ b/src/test/cassettes/api_key/api_keys.json @@ -0,0 +1,343 @@ +[ + { + "recordedAt": 1770070890, + "request": { + "body": "{\n \"user\": {\n \"name\": \"Test User\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/users" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2026-02-02T22:21:30Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_ff4fd488b4e545c98a14a4caa598b41e\",\n \"api_keys\": [],\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "691" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "2e56ccec6981236ae2bcd1da02e3ef84" + ], + "x-proxied": [ + "intlb5nuq d9379ca146", + "extlb2nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.456456" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202602022023-e2aafa4ad5-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/users" + }, + "duration": 571 + }, + { + "recordedAt": 1770070890, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/api_keys" + }, + "response": { + "body": "{\n \"children\": [\n {\n \"children\": [],\n \"keys\": [],\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\"\n },\n {\n \"children\": [],\n \"keys\": [],\n \"id\": \"user_ff4fd488b4e545c98a14a4caa598b41e\"\n }\n ],\n \"keys\": [],\n \"id\": \"user_04ad194774a54f6c97d1385715721091\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1390" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb66nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "2e56ccf06981236ae2bcd1df02e3f0a2" + ], + "x-proxied": [ + "intlb5nuq d9379ca146", + "extlb2nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.036304" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202602022023-e2aafa4ad5-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/api_keys" + }, + "duration": 143 + }, + { + "recordedAt": 1770070891, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_ff4fd488b4e545c98a14a4caa598b41e" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2026-02-02T22:21:30Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_ff4fd488b4e545c98a14a4caa598b41e\",\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "284" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb59nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "2e56cced6981236be2bcd1f702e3f0d9" + ], + "x-proxied": [ + "intlb3nuq d9379ca146", + "extlb2nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.047953" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202602022023-e2aafa4ad5-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/user_ff4fd488b4e545c98a14a4caa598b41e" + }, + "duration": 152 + }, + { + "recordedAt": 1770070891, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_ff4fd488b4e545c98a14a4caa598b41e" + }, + "response": { + "body": "", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 204 No Content" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "2e56ccef6981236be2bcd1f802e3f120" + ], + "x-proxied": [ + "intlb3nuq d9379ca146", + "extlb2nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.100315" + ], + "x-version-label": [ + "easypost-202602022023-e2aafa4ad5-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "uri": "https://api.easypost.com/v2/users/user_ff4fd488b4e545c98a14a4caa598b41e" + }, + "duration": 207 + } +] \ No newline at end of file diff --git a/src/test/cassettes/api_key/lifecycle.json b/src/test/cassettes/api_key/lifecycle.json new file mode 100644 index 000000000..32de0f860 --- /dev/null +++ b/src/test/cassettes/api_key/lifecycle.json @@ -0,0 +1,349 @@ +[ + { + "recordedAt": 1738528358, + "request": { + "body": "{\n \"mode\": \"production\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/api_keys" + }, + "response": { + "body": "{\"object\":\"ApiKey\",\"key\":\"REDACTED\",\"mode\":\"production\",\"created_at\":\"2026-02-02T20:32:38Z\",\"active\":true,\"id\":\"ak_2df46e55f8434c3882b40f7c99c8b64f\"}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "199" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb66nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age=31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "cfd5bd42698109e6e2b988370270e6e6" + ], + "x-proxied": [ + "intlb5nuq d9379ca146", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.119875" + ], + "content-type": [ + "application/json; charset=utf-8" + ], + "x-version-label": [ + "easypost-202602021944-8c5966c6f9-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/api_keys" + }, + "duration": 295 + }, + { + "recordedAt": 1738528359, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/api_keys/ak_2df46e55f8434c3882b40f7c99c8b64f/disable" + }, + "response": { + "body": "{\"object\":\"ApiKey\",\"key\":\"REDACTED\",\"mode\":\"production\",\"created_at\":\"2026-02-02T20:32:38Z\",\"active\":false,\"id\":\"ak_2df46e55f8434c3882b40f7c99c8b64f\"}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "200" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age=31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "cfd5bd41698109e6e2b988380270e748" + ], + "x-proxied": [ + "intlb4nuq d9379ca146", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.143682" + ], + "content-type": [ + "application/json; charset=utf-8" + ], + "x-version-label": [ + "easypost-202602021944-8c5966c6f9-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/api_keys/ak_2df46e55f8434c3882b40f7c99c8b64f/disable" + }, + "duration": 258 + }, + { + "recordedAt": 1738528360, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/api_keys/ak_2df46e55f8434c3882b40f7c99c8b64f/enable" + }, + "response": { + "body": "{\"object\":\"ApiKey\",\"key\":\"REDACTED\",\"mode\":\"production\",\"created_at\":\"2026-02-02T20:32:38Z\",\"active\":true,\"id\":\"ak_2df46e55f8434c3882b40f7c99c8b64f\"}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "199" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age=31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "cfd5bd41698109e6e2b988390270e7ae" + ], + "x-proxied": [ + "intlb5nuq d9379ca146", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.116097" + ], + "content-type": [ + "application/json; charset=utf-8" + ], + "x-version-label": [ + "easypost-202602021944-8c5966c6f9-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/api_keys/ak_2df46e55f8434c3882b40f7c99c8b64f/enable" + }, + "duration": 227 + }, + { + "recordedAt": 1738528361, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/api_keys/ak_2df46e55f8434c3882b40f7c99c8b64f" + }, + "response": { + "body": "", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 204 No Content" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age=31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode=block" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "cfd5bd44698109e6e2b9883a0270e816" + ], + "x-proxied": [ + "intlb3nuq d9379ca146", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.259319" + ], + "x-version-label": [ + "easypost-202602021944-8c5966c6f9-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "uri": "https://api.easypost.com/v2/api_keys/ak_2df46e55f8434c3882b40f7c99c8b64f" + }, + "duration": 359 + } +] diff --git a/src/test/cassettes/api_key/retrieve_child_user_api_keys.json b/src/test/cassettes/api_key/retrieve_child_user_api_keys.json new file mode 100644 index 000000000..15e43e09a --- /dev/null +++ b/src/test/cassettes/api_key/retrieve_child_user_api_keys.json @@ -0,0 +1,343 @@ +[ + { + "recordedAt": 1723823854, + "request": { + "body": "{\n \"user\": {\n \"name\": \"Test User\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/users" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:34Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_be3e8e064b094079b60311d3b310f738\",\n \"api_keys\": [],\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "691" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76eee786bca40035c092" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.554784" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/users" + }, + "duration": 771 + }, + { + "recordedAt": 1723823855, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/api_keys" + }, + "response": { + "body": "{\n \"children\": [\n {\n \"children\": [],\n \"keys\": [],\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\"\n },\n {\n \"children\": [],\n \"keys\": [],\n \"id\": \"user_be3e8e064b094079b60311d3b310f738\"\n }\n ],\n \"keys\": [],\n \"id\": \"user_04ad194774a54f6c97d1385715721091\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1390" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76efe786bcbd0035c19d" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.082161" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/api_keys" + }, + "duration": 277 + }, + { + "recordedAt": 1723823855, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_be3e8e064b094079b60311d3b310f738" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:34Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_be3e8e064b094079b60311d3b310f738\",\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "284" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76efe786bcbe0035c1d4" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.241655" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/user_be3e8e064b094079b60311d3b310f738" + }, + "duration": 444 + }, + { + "recordedAt": 1723823856, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_be3e8e064b094079b60311d3b310f738" + }, + "response": { + "body": "", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 204 No Content" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76f0e786bcbf0035c241" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.137383" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "uri": "https://api.easypost.com/v2/users/user_be3e8e064b094079b60311d3b310f738" + }, + "duration": 351 + } +] \ No newline at end of file diff --git a/src/test/cassettes/batch/add_remove_shipment_with_list.json b/src/test/cassettes/batch/add_remove_shipment_with_list.json new file mode 100644 index 000000000..7f3ea6820 --- /dev/null +++ b/src/test/cassettes/batch/add_remove_shipment_with_list.json @@ -0,0 +1,361 @@ +[ + { + "recordedAt": 1723823998, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:57Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:58Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:57Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:57Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_dfebcd01b0d644f294cd3db8dad5d6b0\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:59:58Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"tracking_code\": \"9400100105807076063423\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzQyYWM4NzkyOWUzOTRkMzA5Zjc4MmY1YTQzZGYxNGEx\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:58Z\",\n \"signed_by\": null,\n \"id\": \"trk_42ac87929e394d309f782f5a43df14a1\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:57+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:57+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_95b568985be811ef8afbac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:57+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:57+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_95b568985be811ef8afbac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:57Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e82f9cd9f4b8d447589005f569e021af98.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:58Z\",\n \"id\": \"pl_efda2a9245f24edcb9602a90e3565860\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:57Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:57Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:57Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_86cce04bea5d427faa79d20d58d04690\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:57+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:57+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_95b313315be811ef8e49ac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:57Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:57Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0a7a1343ccb94890b38c91cbdd8f6a83\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:57Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:57Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_52fa488dca8c432195b39c25056b10ef\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:57Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:57Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_dfebcd01b0d644f294cd3db8dad5d6b0\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:57+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:57+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_95b313315be811ef8e49ac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063423\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf777de786c9e900365668" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.996851" + ], + "location": [ + "/api/v2/shipments/shp_209960eee8504245ae2b6669c5dca941" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1198 + }, + { + "recordedAt": 1723823998, + "request": { + "body": "{}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:58Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 0.0,\n \"updated_at\": \"2024-08-16T15:59:58Z\",\n \"id\": \"batch_32532c59d9be47a49d2e6049b4c41cd0\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "383" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf777ee786c9eb003657f6" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.035130" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "duration": 234 + }, + { + "recordedAt": 1723823999, + "request": { + "body": "{\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_86cce04bea5d427faa79d20d58d04690\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 1.0,\n \"listRate\": 33.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 33.1,\n \"deliveryDays\": 1.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"currency\": \"USD\",\n \"id\": \"rate_0a7a1343ccb94890b38c91cbdd8f6a83\",\n \"retailRate\": 37.9,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.25,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 6.9,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"currency\": \"USD\",\n \"id\": \"rate_52fa488dca8c432195b39c25056b10ef\",\n \"retailRate\": 9.8,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"currency\": \"USD\",\n \"id\": \"rate_dfebcd01b0d644f294cd3db8dad5d6b0\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ],\n \"trackingCode\": \"9400100105807076063423\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_95b313315be811ef8e49ac1f6bc539ae\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_95b568985be811ef8afbac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"currency\": \"USD\",\n \"id\": \"rate_dfebcd01b0d644f294cd3db8dad5d6b0\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_95b313315be811ef8e49ac1f6bc539ae\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100105807076063423\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzQyYWM4NzkyOWUzOTRkMzA5Zjc4MmY1YTQzZGYxNGEx\",\n \"trackingDetails\": [],\n \"id\": \"trk_42ac87929e394d309f782f5a43df14a1\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_95b568985be811ef8afbac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"id\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"postageLabel\": {\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_efda2a9245f24edcb9602a90e3565860\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e82f9cd9f4b8d447589005f569e021af98.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ]\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_32532c59d9be47a49d2e6049b4c41cd0/add_shipments" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:58Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"postage_purchased\",\n \"id\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"tracking_code\": \"9400100105807076063423\"\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:58Z\",\n \"id\": \"batch_32532c59d9be47a49d2e6049b4c41cd0\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 1.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "542" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf777fe786ca040036584a" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.070567" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_32532c59d9be47a49d2e6049b4c41cd0/add_shipments" + }, + "duration": 300 + }, + { + "recordedAt": 1723823999, + "request": { + "body": "{\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_86cce04bea5d427faa79d20d58d04690\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 1.0,\n \"listRate\": 33.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 33.1,\n \"deliveryDays\": 1.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"currency\": \"USD\",\n \"id\": \"rate_0a7a1343ccb94890b38c91cbdd8f6a83\",\n \"retailRate\": 37.9,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.25,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 6.9,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"currency\": \"USD\",\n \"id\": \"rate_52fa488dca8c432195b39c25056b10ef\",\n \"retailRate\": 9.8,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"currency\": \"USD\",\n \"id\": \"rate_dfebcd01b0d644f294cd3db8dad5d6b0\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ],\n \"trackingCode\": \"9400100105807076063423\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_95b313315be811ef8e49ac1f6bc539ae\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_95b568985be811ef8afbac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"currency\": \"USD\",\n \"id\": \"rate_dfebcd01b0d644f294cd3db8dad5d6b0\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_95b313315be811ef8e49ac1f6bc539ae\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100105807076063423\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzQyYWM4NzkyOWUzOTRkMzA5Zjc4MmY1YTQzZGYxNGEx\",\n \"trackingDetails\": [],\n \"id\": \"trk_42ac87929e394d309f782f5a43df14a1\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_95b568985be811ef8afbac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"id\": \"shp_209960eee8504245ae2b6669c5dca941\",\n \"postageLabel\": {\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_efda2a9245f24edcb9602a90e3565860\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e82f9cd9f4b8d447589005f569e021af98.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ]\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_32532c59d9be47a49d2e6049b4c41cd0/remove_shipments" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:58Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 0.0,\n \"updated_at\": \"2024-08-16T15:59:59Z\",\n \"id\": \"batch_32532c59d9be47a49d2e6049b4c41cd0\",\n \"state\": \"purchased\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "385" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf777fe786ca06003658cd" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.047641" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_32532c59d9be47a49d2e6049b4c41cd0/remove_shipments" + }, + "duration": 248 + } +] \ No newline at end of file diff --git a/src/test/cassettes/batch/add_remove_shipment_with_map.json b/src/test/cassettes/batch/add_remove_shipment_with_map.json new file mode 100644 index 000000000..0af6e5819 --- /dev/null +++ b/src/test/cassettes/batch/add_remove_shipment_with_map.json @@ -0,0 +1,361 @@ +[ + { + "recordedAt": 1723823973, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:31Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:32Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:32Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6f187941cc744ddeba300caed1f517d7\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:59:33Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"tracking_code\": \"9400100105807076063324\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzMxZDFiMWZhOTNlZjQ2ZDk5YmNiM2M4MWNkZTRhZjAy\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:33Z\",\n \"signed_by\": null,\n \"id\": \"trk_31d1b1fa93ef46d99bcb3c81cde4af02\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_868370035be811ef8236ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_868370035be811ef8236ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:32Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8df39525deb9a48a9bee2a3e38a617c82.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:32Z\",\n \"id\": \"pl_34f9fa2c9a254ba4b2fe7659d0a68772\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:32Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:31Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:31Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_3dc3ae89dbbf4f6f8275bce8f2cf9db7\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:31+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_86811cde5be811ef8234ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:32Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6f187941cc744ddeba300caed1f517d7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:32Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_37285dab027f4ba88387b382cb30703f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:32Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e24f25fa6dba4dda9b4ab9ee2bbe497b\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:31+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_86811cde5be811ef8234ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063324\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7763e786c9250036362b" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.158487" + ], + "location": [ + "/api/v2/shipments/shp_82dc86571c3b41029c4c3cd15d5c9e97" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1356 + }, + { + "recordedAt": 1723823973, + "request": { + "body": "{}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:33Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 0.0,\n \"updated_at\": \"2024-08-16T15:59:33Z\",\n \"id\": \"batch_905dc7cc141d416c901a58d570018cb0\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "383" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7765e786c966003637d8" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.168914" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "duration": 369 + }, + { + "recordedAt": 1723823973, + "request": { + "body": "{\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_3dc3ae89dbbf4f6f8275bce8f2cf9db7\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"currency\": \"USD\",\n \"id\": \"rate_6f187941cc744ddeba300caed1f517d7\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 1.0,\n \"listRate\": 33.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 33.1,\n \"deliveryDays\": 1.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"currency\": \"USD\",\n \"id\": \"rate_37285dab027f4ba88387b382cb30703f\",\n \"retailRate\": 37.9,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.25,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 6.9,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"currency\": \"USD\",\n \"id\": \"rate_e24f25fa6dba4dda9b4ab9ee2bbe497b\",\n \"retailRate\": 9.8,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ],\n \"trackingCode\": \"9400100105807076063324\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_86811cde5be811ef8234ac1f6bc539aa\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_868370035be811ef8236ac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"currency\": \"USD\",\n \"id\": \"rate_6f187941cc744ddeba300caed1f517d7\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_86811cde5be811ef8234ac1f6bc539aa\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100105807076063324\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzMxZDFiMWZhOTNlZjQ2ZDk5YmNiM2M4MWNkZTRhZjAy\",\n \"trackingDetails\": [],\n \"id\": \"trk_31d1b1fa93ef46d99bcb3c81cde4af02\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_868370035be811ef8236ac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"id\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"postageLabel\": {\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_34f9fa2c9a254ba4b2fe7659d0a68772\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8df39525deb9a48a9bee2a3e38a617c82.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ]\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_905dc7cc141d416c901a58d570018cb0/add_shipments" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:33Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"postage_purchased\",\n \"id\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"tracking_code\": \"9400100105807076063324\"\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:33Z\",\n \"id\": \"batch_905dc7cc141d416c901a58d570018cb0\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 1.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "542" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7765e786c9820036387d" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.054066" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_905dc7cc141d416c901a58d570018cb0/add_shipments" + }, + "duration": 253 + }, + { + "recordedAt": 1723823974, + "request": { + "body": "{\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_3dc3ae89dbbf4f6f8275bce8f2cf9db7\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"currency\": \"USD\",\n \"id\": \"rate_6f187941cc744ddeba300caed1f517d7\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 1.0,\n \"listRate\": 33.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 33.1,\n \"deliveryDays\": 1.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"currency\": \"USD\",\n \"id\": \"rate_37285dab027f4ba88387b382cb30703f\",\n \"retailRate\": 37.9,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.25,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 6.9,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"currency\": \"USD\",\n \"id\": \"rate_e24f25fa6dba4dda9b4ab9ee2bbe497b\",\n \"retailRate\": 9.8,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ],\n \"trackingCode\": \"9400100105807076063324\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_86811cde5be811ef8234ac1f6bc539aa\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_868370035be811ef8236ac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"currency\": \"USD\",\n \"id\": \"rate_6f187941cc744ddeba300caed1f517d7\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_86811cde5be811ef8234ac1f6bc539aa\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100105807076063324\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzMxZDFiMWZhOTNlZjQ2ZDk5YmNiM2M4MWNkZTRhZjAy\",\n \"trackingDetails\": [],\n \"id\": \"trk_31d1b1fa93ef46d99bcb3c81cde4af02\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_868370035be811ef8236ac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"id\": \"shp_82dc86571c3b41029c4c3cd15d5c9e97\",\n \"postageLabel\": {\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_34f9fa2c9a254ba4b2fe7659d0a68772\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8df39525deb9a48a9bee2a3e38a617c82.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ]\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_905dc7cc141d416c901a58d570018cb0/remove_shipments" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:33Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 0.0,\n \"updated_at\": \"2024-08-16T15:59:33Z\",\n \"id\": \"batch_905dc7cc141d416c901a58d570018cb0\",\n \"state\": \"purchased\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "385" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7766e786c984003638ed" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.058040" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_905dc7cc141d416c901a58d570018cb0/remove_shipments" + }, + "duration": 262 + } +] \ No newline at end of file diff --git a/src/test/cassettes/batch/all.json b/src/test/cassettes/batch/all.json new file mode 100644 index 000000000..b9167aded --- /dev/null +++ b/src/test/cassettes/batch/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823970, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/batches?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"batches\": [\n {\n \"scan_form\": null,\n \"created_at\": \"2024-07-24T22:21:27Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": \"USPS does not offer service First for this shipment.\",\n \"batch_status\": \"postage_purchase_failed\",\n \"id\": \"shp_6b935070283e4a4e8cdf55677d2dd086\",\n \"tracking_code\": null\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-07-24T22:21:27Z\",\n \"id\": \"batch_6abcdca312c5424f8599c648d8ca0c35\",\n \"state\": \"purchase_failed\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 1.0,\n \"creation_failed\": 0.0\n }\n },\n {\n \"scan_form\": null,\n \"created_at\": \"2024-07-24T22:21:28Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": \"USPS does not offer service First for this shipment.\",\n \"batch_status\": \"postage_purchase_failed\",\n \"id\": \"shp_1be5051c63f7403d851092c64ba0e213\",\n \"tracking_code\": null\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-07-24T22:21:29Z\",\n \"id\": \"batch_2076c41e12864aa9b438e18eacebe0c1\",\n \"state\": \"purchase_failed\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 1.0,\n \"creation_failed\": 0.0\n }\n },\n {\n \"scan_form\": null,\n \"created_at\": \"2024-07-24T22:21:39Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": \"USPS does not offer service First for this shipment.\",\n \"batch_status\": \"postage_purchase_failed\",\n \"id\": \"shp_ef47049f32724f51ab82aad43194e33c\",\n \"tracking_code\": null\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-07-24T22:21:39Z\",\n \"id\": \"batch_3e9ce59f09034312bb60cd13145574ae\",\n \"state\": \"purchase_failed\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 1.0,\n \"creation_failed\": 0.0\n }\n },\n {\n \"scan_form\": null,\n \"created_at\": \"2024-07-24T22:21:50Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"created\",\n \"id\": \"shp_0da23c3065634446bce64f6db7292a5c\",\n \"tracking_code\": null\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-07-24T22:21:50Z\",\n \"id\": \"batch_51dd8920014c49569f710db7aa0881ea\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 1.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n },\n {\n \"scan_form\": null,\n \"created_at\": \"2024-07-24T22:21:51Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"created\",\n \"id\": \"shp_516d97578c504a40bc05f6f4a00d5f89\",\n \"tracking_code\": null\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-07-24T22:21:51Z\",\n \"id\": \"batch_04b64176ffc44dd78052db5253c1cef4\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 1.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2816" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7762e786c920003634ec" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.121264" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 350 + } +] \ No newline at end of file diff --git a/src/test/cassettes/batch/buy.json b/src/test/cassettes/batch/buy.json new file mode 100644 index 000000000..304e9660a --- /dev/null +++ b/src/test/cassettes/batch/buy.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1723823971, + "request": { + "body": "{\n \"batch\": {\n \"shipments\": [\n {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:31Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:31Z\",\n \"id\": \"batch_0b0335aea46d4e4bbdacca9633c286a5\",\n \"state\": \"creating\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "384" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf7763e786c92200363572" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.044899" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "duration": 247 + }, + { + "recordedAt": 1723823971, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_0b0335aea46d4e4bbdacca9633c286a5/buy" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:31Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"queued_for_purchase\",\n \"id\": \"shp_d927805e6e3e4fd3be839a732c102ca4\",\n \"tracking_code\": null\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:31Z\",\n \"id\": \"batch_0b0335aea46d4e4bbdacca9633c286a5\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 1.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "524" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7763e786c923003635b5" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.114827" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_0b0335aea46d4e4bbdacca9633c286a5/buy" + }, + "duration": 311 + } +] \ No newline at end of file diff --git a/src/test/cassettes/batch/create.json b/src/test/cassettes/batch/create.json new file mode 100644 index 000000000..b6e9828e5 --- /dev/null +++ b/src/test/cassettes/batch/create.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823999, + "request": { + "body": "{\n \"batch\": {\n \"shipments\": [\n {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:59Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:59Z\",\n \"id\": \"batch_4d0fb517d86c4977bb299c25c4ef0b83\",\n \"state\": \"creating\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "384" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf777fe786ca0800365941" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.046577" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "duration": 243 + } +] \ No newline at end of file diff --git a/src/test/cassettes/batch/create_scanform.json b/src/test/cassettes/batch/create_scanform.json new file mode 100644 index 000000000..99af1e377 --- /dev/null +++ b/src/test/cassettes/batch/create_scanform.json @@ -0,0 +1,263 @@ +[ + { + "recordedAt": 1723823974, + "request": { + "body": "{\n \"batch\": {\n \"shipments\": [\n {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:34Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:34Z\",\n \"id\": \"batch_5e771df3d7cd47d2a9710fa069146f28\",\n \"state\": \"creating\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "384" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7766e786c9860036395b" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.048454" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "duration": 246 + }, + { + "recordedAt": 1723823975, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_5e771df3d7cd47d2a9710fa069146f28/buy" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:34Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"queued_for_purchase\",\n \"id\": \"shp_424ccb82964d434ea6806b14905811aa\",\n \"tracking_code\": null\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:34Z\",\n \"id\": \"batch_5e771df3d7cd47d2a9710fa069146f28\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 1.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "524" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7766e786c987003639a4" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.063973" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_5e771df3d7cd47d2a9710fa069146f28/buy" + }, + "duration": 260 + }, + { + "recordedAt": 1723823985, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_5e771df3d7cd47d2a9710fa069146f28/scan_form" + }, + "response": { + "body": "{\n \"scan_form\": {\n \"address\": null,\n \"updated_at\": \"2024-08-16T15:59:45Z\",\n \"form_url\": null,\n \"form_file_type\": null,\n \"batch_id\": \"batch_5e771df3d7cd47d2a9710fa069146f28\",\n \"created_at\": \"2024-08-16T15:59:45Z\",\n \"id\": \"sf_6eaa7fc503d54c268f98f9bfc867c05d\",\n \"confirmation\": null,\n \"message\": null,\n \"tracking_codes\": [],\n \"object\": \"ScanForm\",\n \"status\": \"creating\"\n },\n \"created_at\": \"2024-08-16T15:59:34Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"postage_purchased\",\n \"id\": \"shp_424ccb82964d434ea6806b14905811aa\",\n \"tracking_code\": \"9400100105807076063331\"\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:45Z\",\n \"id\": \"batch_5e771df3d7cd47d2a9710fa069146f28\",\n \"state\": \"purchased\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 1.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "856" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf7771e786c9a1003646c4" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.078079" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_5e771df3d7cd47d2a9710fa069146f28/scan_form" + }, + "duration": 303 + } +] \ No newline at end of file diff --git a/src/test/cassettes/batch/label.json b/src/test/cassettes/batch/label.json new file mode 100644 index 000000000..8892f1ca7 --- /dev/null +++ b/src/test/cassettes/batch/label.json @@ -0,0 +1,269 @@ +[ + { + "recordedAt": 1723823985, + "request": { + "body": "{\n \"batch\": {\n \"shipments\": [\n {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:45Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:45Z\",\n \"id\": \"batch_ca23e4ea94e0452295bb39e8806f1870\",\n \"state\": \"creating\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "384" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7771e786c9a30036475b" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.041031" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "duration": 249 + }, + { + "recordedAt": 1723823985, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_ca23e4ea94e0452295bb39e8806f1870/buy" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:45Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"queued_for_purchase\",\n \"id\": \"shp_2999a3973d6348258e336164f9caeaee\",\n \"tracking_code\": null\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:45Z\",\n \"id\": \"batch_ca23e4ea94e0452295bb39e8806f1870\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 1.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "524" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7771e786c9a4003647ae" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.057373" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_ca23e4ea94e0452295bb39e8806f1870/buy" + }, + "duration": 251 + }, + { + "recordedAt": 1723823996, + "request": { + "body": "{\n \"file_format\": \"ZPL\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_ca23e4ea94e0452295bb39e8806f1870/label" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:45Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"postage_purchased\",\n \"id\": \"shp_2999a3973d6348258e336164f9caeaee\",\n \"tracking_code\": \"9400100105807076063379\"\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:56Z\",\n \"id\": \"batch_ca23e4ea94e0452295bb39e8806f1870\",\n \"state\": \"label_generating\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 1.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "551" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf777ce786c9e4003654fd" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.055082" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_ca23e4ea94e0452295bb39e8806f1870/label" + }, + "duration": 277 + } +] \ No newline at end of file diff --git a/src/test/cassettes/batch/retrieve.json b/src/test/cassettes/batch/retrieve.json new file mode 100644 index 000000000..f0d62d058 --- /dev/null +++ b/src/test/cassettes/batch/retrieve.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1723823996, + "request": { + "body": "{\n \"batch\": {\n \"shipments\": [\n {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:56Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:56Z\",\n \"id\": \"batch_2a9d80a7c2414978bf8437dbb1814668\",\n \"state\": \"creating\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "384" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf777ce786c9e6003655a8" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.043709" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "duration": 253 + }, + { + "recordedAt": 1723823997, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/batches/batch_2a9d80a7c2414978bf8437dbb1814668" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:59:56Z\",\n \"pickup\": null,\n \"shipments\": [\n {\n \"reference\": null,\n \"batch_message\": null,\n \"batch_status\": \"created\",\n \"id\": \"shp_d39f50cc35b147f1a3d36b472654b704\",\n \"tracking_code\": null\n }\n ],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:59:56Z\",\n \"id\": \"batch_2a9d80a7c2414978bf8437dbb1814668\",\n \"state\": \"created\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 1.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "512" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf777ce786c9e700365604" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.027883" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches/batch_2a9d80a7c2414978bf8437dbb1814668" + }, + "duration": 231 + } +] \ No newline at end of file diff --git a/src/test/cassettes/beta_referral_customer/add_payment_method.json b/src/test/cassettes/beta_referral_customer/add_payment_method.json new file mode 100644 index 000000000..929b3f55d --- /dev/null +++ b/src/test/cassettes/beta_referral_customer/add_payment_method.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823830, + "request": { + "body": "{\n \"payment_method\": {\n \"stripe_customer_id\": \"cus_123\",\n \"payment_method_reference\": \"ba_123\",\n \"priority\": \"PRIMARY\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/beta/referral_customers/payment_method" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"BILLING.INVALID_PAYMENT_GATEWAY_REFERENCE\",\n \"message\": \"Invalid connect integration.\",\n \"errors\": []\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 422 Unprocessable Entity" + ], + "content-length": [ + "115" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "vary": [ + "Origin" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf76d6e786bc210035a7c5" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.051163" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 422, + "message": "Unprocessable Entity" + }, + "uri": "https://api.easypost.com/beta/referral_customers/payment_method" + }, + "duration": 269 + } +] \ No newline at end of file diff --git a/src/test/cassettes/beta_referral_customer/create_bank_account_client_secret.json b/src/test/cassettes/beta_referral_customer/create_bank_account_client_secret.json new file mode 100644 index 000000000..b884ece5c --- /dev/null +++ b/src/test/cassettes/beta_referral_customer/create_bank_account_client_secret.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1742502951, + "request": { + "body": "{}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/beta/financial_connections_sessions" + }, + "response": { + "body": "{\n \"client_secret\": \"fcsess_client_secret_TGjLr3f2VIuNe5Nm7otCKq4a\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "65" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "vary": [ + "Origin" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "64f5803467dc7c26e2ba8772002bb9ad" + ], + "x-proxied": [ + "intlb4nuq 284c5d344a", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.463688" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202503202010-5de35d6868-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/beta/financial_connections_sessions" + }, + "duration": 580 + } +] \ No newline at end of file diff --git a/src/test/cassettes/beta_referral_customer/create_credit_card_client_secret.json b/src/test/cassettes/beta_referral_customer/create_credit_card_client_secret.json new file mode 100644 index 000000000..d8e427da9 --- /dev/null +++ b/src/test/cassettes/beta_referral_customer/create_credit_card_client_secret.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1742502952, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/beta/setup_intents" + }, + "response": { + "body": "{\n \"client_secret\": \"seti_0R4pohDqT4huGUvdzzsjybrJ_secret_RynPW651kwMzuL7DNOr8EdW7vvLqQJ8\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "88" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "vary": [ + "Origin" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "64f5803467dc7c27e2ba8776002bbab8" + ], + "x-proxied": [ + "intlb3nuq 284c5d344a", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.586783" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202503202010-5de35d6868-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/beta/setup_intents" + }, + "duration": 697 + } +] \ No newline at end of file diff --git a/src/test/cassettes/beta_referral_customer/refund_by_amount.json b/src/test/cassettes/beta_referral_customer/refund_by_amount.json new file mode 100644 index 000000000..03fbcb3ef --- /dev/null +++ b/src/test/cassettes/beta_referral_customer/refund_by_amount.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823829, + "request": { + "body": "{\n \"refund_amount\": 2000.0\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/beta/referral_customers/refunds" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"TRANSACTION.AMOUNT_INVALID\",\n \"message\": \"Refund amount is invalid. Please use a valid amount or escalate to finance.\",\n \"errors\": []\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 422 Unprocessable Entity" + ], + "content-length": [ + "147" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "vary": [ + "Origin" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76d4e786bc1d0035a64a" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.457739" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 422, + "message": "Unprocessable Entity" + }, + "uri": "https://api.easypost.com/beta/referral_customers/refunds" + }, + "duration": 662 + } +] \ No newline at end of file diff --git a/src/test/cassettes/beta_referral_customer/refund_by_payment_log_id.json b/src/test/cassettes/beta_referral_customer/refund_by_payment_log_id.json new file mode 100644 index 000000000..dde6e4c36 --- /dev/null +++ b/src/test/cassettes/beta_referral_customer/refund_by_payment_log_id.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823829, + "request": { + "body": "{\n \"payment_log_id\": \"paylog_123\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/beta/referral_customers/refunds" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"TRANSACTION.DOES_NOT_EXIST\",\n \"message\": \"We could not find a transaction with that id.\",\n \"errors\": []\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 422 Unprocessable Entity" + ], + "content-length": [ + "117" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "vary": [ + "Origin" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76d5e786bc1f0035a756" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.025786" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 422, + "message": "Unprocessable Entity" + }, + "uri": "https://api.easypost.com/beta/referral_customers/refunds" + }, + "duration": 227 + } +] \ No newline at end of file diff --git a/src/test/cassettes/beta_stateless_rate/retrieve_lowest_stateless_rate.json b/src/test/cassettes/beta_stateless_rate/retrieve_lowest_stateless_rate.json new file mode 100644 index 000000000..92ff1ec1f --- /dev/null +++ b/src/test/cassettes/beta_stateless_rate/retrieve_lowest_stateless_rate.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823795, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/beta/rates" + }, + "response": { + "body": "{\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"object\": \"Rate\"\n }\n ],\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2816" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "vary": [ + "Origin" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76b2e786b7fe00358441" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.569245" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/beta/rates" + }, + "duration": 778 + } +] \ No newline at end of file diff --git a/src/test/cassettes/beta_stateless_rate/retrieve_stateless_rates.json b/src/test/cassettes/beta_stateless_rate/retrieve_stateless_rates.json new file mode 100644 index 000000000..3478293e2 --- /dev/null +++ b/src/test/cassettes/beta_stateless_rate/retrieve_stateless_rates.json @@ -0,0 +1,97 @@ +[ + { + "recordedAt": 1723823796, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/beta/rates" + }, + "response": { + "body": "{\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"object\": \"Rate\"\n }\n ],\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2816" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "vary": [ + "Origin" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76b3e786b80000358520" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.498125" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/beta/rates" + }, + "duration": 704 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/all.json b/src/test/cassettes/carrier_account/all.json new file mode 100644 index 000000000..6a9b6d131 --- /dev/null +++ b/src/test/cassettes/carrier_account/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823786, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "response": { + "body": "[\n {\n \"readable\": \"USPS\",\n \"credentials\": {},\n \"created_at\": \"2022-02-02T20:31:54Z\",\n \"description\": \"USPS Account\",\n \"type\": \"UspsAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-02-16T22:22:42Z\",\n \"clone\": false,\n \"billing_type\": \"easypost\",\n \"logo\": null,\n \"id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"DHL Express\",\n \"credentials\": {},\n \"created_at\": \"2022-02-02T20:31:54Z\",\n \"description\": \"DHL Express Account\",\n \"type\": \"DhlExpressDefaultAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-02-02T20:31:54Z\",\n \"clone\": false,\n \"billing_type\": \"easypost\",\n \"logo\": null,\n \"id\": \"ca_fe24b01a1fbf483ab470da57c47b98a8\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"LSO\",\n \"credentials\": {},\n \"created_at\": \"2022-02-02T20:31:54Z\",\n \"description\": \"LSO Account\",\n \"type\": \"LsoDefaultAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-02-02T20:31:54Z\",\n \"clone\": false,\n \"billing_type\": \"easypost\",\n \"logo\": null,\n \"id\": \"ca_4b2d10b88eb240f4af47ff83587a6b8e\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2022-05-13T18:53:19Z\",\n \"description\": \"My custom description\",\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-05-13T18:53:19Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2022-05-13T18:53:31Z\",\n \"description\": \"My custom description\",\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-05-13T18:53:31Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2022-05-26T19:37:42Z\",\n \"description\": \"UPS Account\",\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-05-26T19:37:42Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2022-05-26T19:37:44Z\",\n \"description\": \"My custom description\",\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-05-26T19:37:45Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2022-05-26T19:54:50Z\",\n \"description\": \"UPS Account\",\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-05-26T19:54:50Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2022-05-26T19:54:51Z\",\n \"description\": \"My custom description\",\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-05-26T19:54:52Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2022-06-02T04:49:07Z\",\n \"description\": \"My custom description\",\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-06-02T04:49:07Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n },\n {\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2022-06-02T18:51:25Z\",\n \"description\": \"UPS Account\",\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2022-06-02T18:51:25Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n }\n]", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7287" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76a9e786b49e00357a3f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.165513" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "duration": 387 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/create.json b/src/test/cassettes/carrier_account/create.json new file mode 100644 index 000000000..3ea4b902c --- /dev/null +++ b/src/test/cassettes/carrier_account/create.json @@ -0,0 +1,269 @@ +[ + { + "recordedAt": 1723823791, + "request": { + "body": "{\n \"carrier_account\": {\n \"test_credentials\": {},\n \"credentials\": {},\n \"type\": \"DhlEcsAccount\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "response": { + "body": "{\n \"readable\": \"DHL eCommerce Solutions\",\n \"test_credentials\": {},\n \"credentials\": {},\n \"created_at\": \"2024-08-16T15:56:31Z\",\n \"description\": \"DHL eCommerce Solutions Account\",\n \"type\": \"DhlEcsAccount\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:31Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_fa4318d6a2744659b1e0e5be7ecd5f3a\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1469" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76afe786b7d800358043" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.065530" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "duration": 276 + }, + { + "recordedAt": 1723823791, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_fa4318d6a2744659b1e0e5be7ecd5f3a" + }, + "response": { + "body": "{\n \"readable\": \"DHL eCommerce Solutions\",\n \"test_credentials\": {},\n \"credentials\": {},\n \"created_at\": \"2024-08-16T15:56:31Z\",\n \"description\": \"DHL eCommerce Solutions Account\",\n \"type\": \"DhlEcsAccount\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:31Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_fa4318d6a2744659b1e0e5be7ecd5f3a\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1469" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76afe786b7d900358095" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.034806" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_fa4318d6a2744659b1e0e5be7ecd5f3a" + }, + "duration": 243 + }, + { + "recordedAt": 1723823791, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_fa4318d6a2744659b1e0e5be7ecd5f3a" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf76afe786b7da003580df" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.055079" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_fa4318d6a2744659b1e0e5be7ecd5f3a" + }, + "duration": 251 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/create_with_amazon.json b/src/test/cassettes/carrier_account/create_with_amazon.json new file mode 100644 index 000000000..070044b8d --- /dev/null +++ b/src/test/cassettes/carrier_account/create_with_amazon.json @@ -0,0 +1,263 @@ +[ + { + "recordedAt": 1744665939, + "request": { + "body": "{\n \"carrier_account_oauth_registrations\": {\n \"type\": \"AmazonShippingAccount\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/register_oauth" + }, + "response": { + "body": "{\n \"readable\": \"Amazon Shipping\",\n \"credentials\": {},\n \"created_at\": \"2025-04-14T21:25:39Z\",\n \"description\": null,\n \"type\": \"AmazonShippingAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-04-14T21:25:39Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_490363c69ed34e26a8b8e74a5238170a\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1432" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb54nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "1a43adb967fd7d53e2bc3d1c003c98d6" + ], + "x-proxied": [ + "intlb4nuq 284c5d344a", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.074536" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202504111751-33c61fb414-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/register_oauth" + }, + "duration": 185 + }, + { + "recordedAt": 1744665939, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_490363c69ed34e26a8b8e74a5238170a" + }, + "response": { + "body": "{\n \"readable\": \"Amazon Shipping\",\n \"credentials\": {},\n \"created_at\": \"2025-04-14T21:25:39Z\",\n \"description\": null,\n \"type\": \"AmazonShippingAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-04-14T21:25:39Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_490363c69ed34e26a8b8e74a5238170a\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1432" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "1a43adb967fd7d53e2bc3d1d003c991e" + ], + "x-proxied": [ + "intlb4nuq 284c5d344a", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.032996" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202504111751-33c61fb414-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_490363c69ed34e26a8b8e74a5238170a" + }, + "duration": 140 + }, + { + "recordedAt": 1744665939, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_490363c69ed34e26a8b8e74a5238170a" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "1a43adb967fd7d53e2bc3d35003c994c" + ], + "x-proxied": [ + "intlb4nuq 284c5d344a", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.052300" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202504111751-33c61fb414-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_490363c69ed34e26a8b8e74a5238170a" + }, + "duration": 164 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/create_with_custom_workflow.json b/src/test/cassettes/carrier_account/create_with_custom_workflow.json new file mode 100644 index 000000000..aa82d0448 --- /dev/null +++ b/src/test/cassettes/carrier_account/create_with_custom_workflow.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823789, + "request": { + "body": "{\n \"carrier_account\": {\n \"registration_data\": {\n \"some\": \"data\"\n },\n \"type\": \"FedexAccount\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/register" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"UNPROCESSABLE_ENTITY\",\n \"message\": \"The request was understood, but cannot be processed.\",\n \"errors\": [\n {\n \"field\": \"shipping_streets\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"shipping_city\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"shipping_state\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"shipping_postal_code\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"shipping_country_code\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_first_name\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_last_name\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_job_title\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_company_name\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_phone_number\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_email_address\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_streets\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_city\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_state\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_postal_code\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"corporate_country_code\",\n \"message\": \"must be present and a string\"\n },\n {\n \"field\": \"account_number\",\n \"message\": \"must be present and a string\"\n }\n ]\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 422 Unprocessable Entity" + ], + "content-length": [ + "1347" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76ade786b4c400357e8f" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.025001" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 422, + "message": "Unprocessable Entity" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/register" + }, + "duration": 229 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/create_with_ups.json b/src/test/cassettes/carrier_account/create_with_ups.json new file mode 100644 index 000000000..84c28fdf4 --- /dev/null +++ b/src/test/cassettes/carrier_account/create_with_ups.json @@ -0,0 +1,263 @@ +[ + { + "recordedAt": 1748029863, + "request": { + "body": "{\n \"carrier_account_oauth_registrations\": {\n \"account_number\": \"123456789\",\n \"type\": \"UpsAccount\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/register_oauth" + }, + "response": { + "body": "{\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2025-05-23T19:51:03Z\",\n \"description\": null,\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-05-23T19:51:03Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_4e02b530040d413399f4c5d4216632ea\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1404" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb55nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f76830d1a7e787bc810049d1d5" + ], + "x-proxied": [ + "intlb4nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.093783" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/register_oauth" + }, + "duration": 301 + }, + { + "recordedAt": 1748029863, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4e02b530040d413399f4c5d4216632ea" + }, + "response": { + "body": "{\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2025-05-23T19:51:03Z\",\n \"description\": null,\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-05-23T19:51:03Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_4e02b530040d413399f4c5d4216632ea\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1404" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f36830d1a7e787bc820049d225" + ], + "x-proxied": [ + "intlb3nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.030623" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4e02b530040d413399f4c5d4216632ea" + }, + "duration": 255 + }, + { + "recordedAt": 1748029864, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4e02b530040d413399f4c5d4216632ea" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f66830d1a7e787bc830049d25e" + ], + "x-proxied": [ + "intlb3nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.074559" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4e02b530040d413399f4c5d4216632ea" + }, + "duration": 282 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/delete.json b/src/test/cassettes/carrier_account/delete.json new file mode 100644 index 000000000..c09cc3811 --- /dev/null +++ b/src/test/cassettes/carrier_account/delete.json @@ -0,0 +1,266 @@ +[ + { + "recordedAt": 1723823792, + "request": { + "body": "{\n \"carrier_account\": {\n \"test_credentials\": {},\n \"credentials\": {},\n \"type\": \"DhlEcsAccount\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "response": { + "body": "{\n \"readable\": \"DHL eCommerce Solutions\",\n \"test_credentials\": {},\n \"credentials\": {},\n \"created_at\": \"2024-08-16T15:56:32Z\",\n \"description\": \"DHL eCommerce Solutions Account\",\n \"type\": \"DhlEcsAccount\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:32Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_720352f88fce4ebbb7e8fb4306826bbf\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1469" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76b0e786b7dc00358160" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.066992" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "duration": 284 + }, + { + "recordedAt": 1723823792, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_720352f88fce4ebbb7e8fb4306826bbf" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76b0e786b7dd003581b4" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.088331" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_720352f88fce4ebbb7e8fb4306826bbf" + }, + "duration": 298 + }, + { + "recordedAt": 1723823792, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_720352f88fce4ebbb7e8fb4306826bbf" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"NOT_FOUND\",\n \"message\": \"The requested resource could not be found.\",\n \"errors\": []\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 404 Not Found" + ], + "content-length": [ + "97" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76b0e786b7de003581fb" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.040782" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 404, + "message": "Not Found" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_720352f88fce4ebbb7e8fb4306826bbf" + }, + "duration": 247 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/retrieve.json b/src/test/cassettes/carrier_account/retrieve.json new file mode 100644 index 000000000..043a21bb8 --- /dev/null +++ b/src/test/cassettes/carrier_account/retrieve.json @@ -0,0 +1,263 @@ +[ + { + "recordedAt": 1723823788, + "request": { + "body": "{\n \"carrier_account\": {\n \"test_credentials\": {},\n \"credentials\": {},\n \"type\": \"DhlEcsAccount\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "response": { + "body": "{\n \"readable\": \"DHL eCommerce Solutions\",\n \"test_credentials\": {},\n \"credentials\": {},\n \"created_at\": \"2024-08-16T15:56:28Z\",\n \"description\": \"DHL eCommerce Solutions Account\",\n \"type\": \"DhlEcsAccount\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:28Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_c1e538cb1abd4566923eec60ff6e62d7\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1469" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76ace786b4bf00357d09" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.086179" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "duration": 294 + }, + { + "recordedAt": 1723823789, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_c1e538cb1abd4566923eec60ff6e62d7" + }, + "response": { + "body": "{\n \"readable\": \"DHL eCommerce Solutions\",\n \"test_credentials\": {},\n \"credentials\": {},\n \"created_at\": \"2024-08-16T15:56:28Z\",\n \"description\": \"DHL eCommerce Solutions Account\",\n \"type\": \"DhlEcsAccount\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:28Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_c1e538cb1abd4566923eec60ff6e62d7\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1469" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76ade786b4c100357db6" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.040342" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_c1e538cb1abd4566923eec60ff6e62d7" + }, + "duration": 247 + }, + { + "recordedAt": 1723823789, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_c1e538cb1abd4566923eec60ff6e62d7" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76ade786b4c200357e11" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.059900" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_c1e538cb1abd4566923eec60ff6e62d7" + }, + "duration": 265 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/types.json b/src/test/cassettes/carrier_account/types.json new file mode 100644 index 000000000..216f68d39 --- /dev/null +++ b/src/test/cassettes/carrier_account/types.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823786, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_types" + }, + "response": { + "body": "[\n {\n \"readable\": \"Accurate\",\n \"logo\": null,\n \"type\": \"AccurateAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Amazon MWS\",\n \"logo\": null,\n \"type\": \"AmazonMwsAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"APC\",\n \"logo\": null,\n \"type\": \"ApcAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Asendia USA\",\n \"logo\": null,\n \"type\": \"AsendiaUsaAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Australia Post\",\n \"logo\": null,\n \"type\": \"AustraliaPostAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Better Trucks\",\n \"logo\": null,\n \"type\": \"BetterTrucksAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Bluestreak\",\n \"logo\": null,\n \"type\": \"BluestreakAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Canada Post\",\n \"logo\": null,\n \"type\": \"CanadaPostAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {},\n \"custom_workflow\": true\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Canpar\",\n \"logo\": null,\n \"type\": \"CanparAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"CDL Last Mile Solutions\",\n \"logo\": null,\n \"type\": \"ColumbusLastMileAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Courier Express\",\n \"logo\": null,\n \"type\": \"CourierExpressAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"CouriersPlease\",\n \"logo\": null,\n \"type\": \"CouriersPleaseAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"CSLogistics\",\n \"logo\": null,\n \"type\": \"CSLogisticsAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Dai Post\",\n \"logo\": null,\n \"type\": \"DaiPostAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Deliver-It\",\n \"logo\": null,\n \"type\": \"DeliverItAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Deutsche Post UK\",\n \"logo\": null,\n \"type\": \"DeutschePostUKAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"DHL eCommerce Solutions\",\n \"logo\": null,\n \"type\": \"DhlEcsAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"DHL Express\",\n \"logo\": null,\n \"type\": \"DhlExpressAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"DHL Paket\",\n \"logo\": null,\n \"type\": \"DhlPaketAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"DHL Parcel\",\n \"logo\": null,\n \"type\": \"DhlParcelAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"DoorDash\",\n \"logo\": null,\n \"type\": \"DoorDashAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Douglas\",\n \"logo\": null,\n \"type\": \"DouglasAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"DPD\",\n \"logo\": null,\n \"type\": \"DpdAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"DPD UK\",\n \"logo\": null,\n \"type\": \"DpdUkAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"DPD NL\",\n \"logo\": null,\n \"type\": \"DpdNlAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"EPost Global V2\",\n \"logo\": null,\n \"type\": \"EPostGlobalV2Account\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Estafeta\",\n \"logo\": null,\n \"type\": \"EstafetaAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"FedEx\",\n \"logo\": null,\n \"type\": \"FedexAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {},\n \"creation_fields\": {\n \"company_information\": {\n \"corporate_company_name\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Name\"\n },\n \"corporate_job_title\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Contact Job Title\"\n },\n \"corporate_state\": {\n \"visibility\": \"visible\",\n \"label\": \"Company State\"\n },\n \"corporate_city\": {\n \"visibility\": \"visible\",\n \"label\": \"Company City\"\n },\n \"corporate_first_name\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Contact First Name\"\n },\n \"corporate_country_code\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Country Code\"\n },\n \"corporate_last_name\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Contact Last Name\"\n },\n \"corporate_email_address\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Email\"\n },\n \"corporate_postal_code\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Postal Code\"\n },\n \"corporate_phone_number\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Phone\"\n },\n \"corporate_streets\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Street\"\n }\n },\n \"credential_information\": {\n \"account_number\": {\n \"visibility\": \"visible\",\n \"label\": \"FedEx Account #\"\n }\n },\n \"address_information\": {\n \"shipping_state\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping State\"\n },\n \"shipping_city\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping City\"\n },\n \"shipping_streets\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Street\"\n },\n \"shipping_country_code\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Country Code\"\n },\n \"shipping_postal_code\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Postal Code \"\n }\n }\n },\n \"custom_workflow\": true\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"FedEx Cross Border\",\n \"logo\": null,\n \"type\": \"FedexCrossBorderAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"FedEx MailView\",\n \"logo\": null,\n \"type\": \"FedexMailviewAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"FedEx SmartPost\",\n \"logo\": null,\n \"type\": \"FedexSmartpostAccount\",\n \"fields\": {\n \"credentials\": {},\n \"creation_fields\": {\n \"company_information\": {\n \"corporate_company_name\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Name\"\n },\n \"corporate_job_title\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Contact Job Title\"\n },\n \"corporate_state\": {\n \"visibility\": \"visible\",\n \"label\": \"Company State\"\n },\n \"corporate_city\": {\n \"visibility\": \"visible\",\n \"label\": \"Company City\"\n },\n \"corporate_first_name\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Contact First Name\"\n },\n \"corporate_country_code\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Country Code\"\n },\n \"corporate_last_name\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Contact Last Name\"\n },\n \"corporate_email_address\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Email\"\n },\n \"corporate_postal_code\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Postal Code\"\n },\n \"corporate_phone_number\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Phone\"\n },\n \"corporate_streets\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Street\"\n }\n },\n \"credential_information\": {\n \"account_number\": {\n \"visibility\": \"visible\",\n \"label\": \"FedEx SmartPost Account #\"\n },\n \"hub_id\": {\n \"visibility\": \"visible\",\n \"label\": \"FedEx SmartPost Hub ID\"\n }\n },\n \"address_information\": {\n \"shipping_state\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping State\"\n },\n \"shipping_city\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping City\"\n },\n \"shipping_streets\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Street\"\n },\n \"shipping_country_code\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Country Code\"\n },\n \"shipping_postal_code\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Postal Code \"\n }\n }\n },\n \"custom_workflow\": true\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"First Choice\",\n \"logo\": null,\n \"type\": \"FirstChoiceAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"First Mile\",\n \"logo\": null,\n \"type\": \"FirstMileConciseAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Flexport\",\n \"logo\": null,\n \"type\": \"FlexportAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Gio\",\n \"logo\": null,\n \"type\": \"GioAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"GSO\",\n \"logo\": null,\n \"type\": \"GsoAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Hailify\",\n \"logo\": null,\n \"type\": \"HailifyAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Henry\",\n \"logo\": null,\n \"type\": \"HenryAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Evri\",\n \"logo\": null,\n \"type\": \"HermesAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Interlink Express\",\n \"logo\": null,\n \"type\": \"InterlinkExpressAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Jet\",\n \"logo\": null,\n \"type\": \"JetAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Jitsu\",\n \"logo\": null,\n \"type\": \"JitsuAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"LaserShipV2\",\n \"logo\": null,\n \"type\": \"LasershipV2Account\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Loomis Express\",\n \"logo\": null,\n \"type\": \"LoomisExpressAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"LSO\",\n \"logo\": null,\n \"type\": \"LsoAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"OmniParcel\",\n \"logo\": null,\n \"type\": \"OmniParcelAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"OnTrac\",\n \"logo\": null,\n \"type\": \"OntracAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"OnTrac V3\",\n \"logo\": null,\n \"type\": \"OntracV3Account\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Optima\",\n \"logo\": null,\n \"type\": \"OptimaAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"OSM Worldwide\",\n \"logo\": null,\n \"type\": \"OsmWorldwideAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Pandion\",\n \"logo\": null,\n \"type\": \"PandionAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Parcel Force\",\n \"logo\": null,\n \"type\": \"ParcelForceAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Cirro E-Commerce\",\n \"logo\": null,\n \"type\": \"ParcllAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Passport Global\",\n \"logo\": null,\n \"type\": \"PassportGlobalAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Purolator\",\n \"logo\": null,\n \"type\": \"PurolatorAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Quick\",\n \"logo\": null,\n \"type\": \"QuickAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Royal Mail\",\n \"logo\": null,\n \"type\": \"RoyalMailAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"ePost Global\",\n \"logo\": null,\n \"type\": \"RRDonnelleyAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Sendle\",\n \"logo\": null,\n \"type\": \"SendleAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"SF Express\",\n \"logo\": null,\n \"type\": \"SfExpressAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"SmartKargo\",\n \"logo\": null,\n \"type\": \"SmartKargoAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Sonic\",\n \"logo\": null,\n \"type\": \"SonicAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Spee-Dee\",\n \"logo\": null,\n \"type\": \"SpeedeeAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Swyft\",\n \"logo\": null,\n \"type\": \"SwyftAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Tcc\",\n \"logo\": null,\n \"type\": \"TccAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"TForce\",\n \"logo\": null,\n \"type\": \"TforceConciseAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Toll\",\n \"logo\": null,\n \"type\": \"TollAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"UDS\",\n \"logo\": null,\n \"type\": \"UdsAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"UPS\",\n \"logo\": null,\n \"type\": \"UpsAccount\",\n \"fields\": {\n \"credentials\": {},\n \"creation_fields\": {\n \"registration_data\": {\n \"account_number\": {\n \"visibility\": \"visible\",\n \"label\": \"UPS Account Number\"\n },\n \"country\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Country\"\n },\n \"website\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Website\"\n },\n \"city\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping City\"\n },\n \"invoice_control_id\": {\n \"visibility\": \"visible\",\n \"label\": \"UPS Invoice Control ID\"\n },\n \"title\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Contact Job Title\"\n },\n \"invoice_amount\": {\n \"visibility\": \"visible\",\n \"label\": \"UPS Invoice Amount\"\n },\n \"invoice_date\": {\n \"visibility\": \"visible\",\n \"label\": \"UPS Invoice Date\"\n },\n \"phone\": {},\n \"name\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Contact Name\"\n },\n \"client_ip\": {},\n \"company\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Name\"\n },\n \"street1\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Street 1\"\n },\n \"street2\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Street 2\"\n },\n \"state\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping State\"\n },\n \"postal_code\": {\n \"visibility\": \"visible\",\n \"label\": \"Shipping Postal Code\"\n },\n \"invoice_currency\": {\n \"visibility\": \"visible\",\n \"label\": \"UPS Invoice Currency\"\n },\n \"invoice_number\": {\n \"visibility\": \"visible\",\n \"label\": \"UPS Invoice Number\"\n },\n \"email\": {\n \"visibility\": \"visible\",\n \"label\": \"Company Email\"\n }\n }\n },\n \"custom_workflow\": true\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"UPS i-Parcel\",\n \"logo\": null,\n \"type\": \"UpsIparcelAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"UPS Mail Innovations\",\n \"logo\": null,\n \"type\": \"UpsMailInnovationsAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"USPS\",\n \"logo\": null,\n \"type\": \"UspsAccount\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n },\n {\n \"readable\": \"Veho\",\n \"logo\": null,\n \"type\": \"VehoAccount\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierType\"\n }\n]", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "41628" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76aae786b49f00357aa1" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.067673" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_types" + }, + "duration": 268 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/update.json b/src/test/cassettes/carrier_account/update.json new file mode 100644 index 000000000..237bdeb4e --- /dev/null +++ b/src/test/cassettes/carrier_account/update.json @@ -0,0 +1,358 @@ +[ + { + "recordedAt": 1748029864, + "request": { + "body": "{\n \"carrier_account\": {\n \"test_credentials\": {},\n \"credentials\": {},\n \"type\": \"DhlEcsAccount\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "response": { + "body": "{\n \"readable\": \"DHL eCommerce\",\n \"test_credentials\": {},\n \"credentials\": {},\n \"created_at\": \"2025-05-23T19:51:04Z\",\n \"description\": \"DHL eCommerce Account\",\n \"type\": \"DhlEcsAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-05-23T19:51:04Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_4aee2085dbb2411e9c77740c63ea548d\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1369" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f16830d1a8e787bf960049d31a" + ], + "x-proxied": [ + "intlb4nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.062564" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts" + }, + "duration": 269 + }, + { + "recordedAt": 1748029865, + "request": { + "body": "{\n \"carrier_account\": {\n \"description\": \"My custom description\"\n }\n}", + "method": "PUT", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4aee2085dbb2411e9c77740c63ea548d" + }, + "response": { + "body": "{\n \"readable\": \"DHL eCommerce\",\n \"test_credentials\": {},\n \"credentials\": {},\n \"created_at\": \"2025-05-23T19:51:04Z\",\n \"description\": \"My custom description\",\n \"type\": \"DhlEcsAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-05-23T19:51:05Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_4aee2085dbb2411e9c77740c63ea548d\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1369" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f16830d1a9e787bf980049d393" + ], + "x-proxied": [ + "intlb3nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.090270" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4aee2085dbb2411e9c77740c63ea548d" + }, + "duration": 316 + }, + { + "recordedAt": 1748029865, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4aee2085dbb2411e9c77740c63ea548d" + }, + "response": { + "body": "{\n \"readable\": \"DHL eCommerce\",\n \"test_credentials\": {},\n \"credentials\": {},\n \"created_at\": \"2025-05-23T19:51:04Z\",\n \"description\": \"My custom description\",\n \"type\": \"DhlEcsAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-05-23T19:51:05Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_4aee2085dbb2411e9c77740c63ea548d\",\n \"fields\": {\n \"test_credentials\": {},\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1369" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f26830d1a9e787bf9a0049d410" + ], + "x-proxied": [ + "intlb3nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.033165" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4aee2085dbb2411e9c77740c63ea548d" + }, + "duration": 242 + }, + { + "recordedAt": 1748029865, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4aee2085dbb2411e9c77740c63ea548d" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb55nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f46830d1a9e787bf9b0049d449" + ], + "x-proxied": [ + "intlb4nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.054416" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_4aee2085dbb2411e9c77740c63ea548d" + }, + "duration": 258 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_account/update_ups.json b/src/test/cassettes/carrier_account/update_ups.json new file mode 100644 index 000000000..52977e65b --- /dev/null +++ b/src/test/cassettes/carrier_account/update_ups.json @@ -0,0 +1,352 @@ +[ + { + "recordedAt": 1748029861, + "request": { + "body": "{\n \"carrier_account_oauth_registrations\": {\n \"account_number\": \"123456789\",\n \"type\": \"UpsAccount\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/register_oauth" + }, + "response": { + "body": "{\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2025-05-23T19:51:01Z\",\n \"description\": null,\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-05-23T19:51:01Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_ee686a5ce36748d7b8af5f15097d13d4\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1404" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb54nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f36830d1a5e787bc610049cfde" + ], + "x-proxied": [ + "intlb3nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.083741" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/register_oauth" + }, + "duration": 297 + }, + { + "recordedAt": 1748029862, + "request": { + "body": "{\n \"carrier_account\": {\n \"account_number\": \"987654321\"\n }\n}", + "method": "PUT", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_ee686a5ce36748d7b8af5f15097d13d4" + }, + "response": { + "body": "{\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2025-05-23T19:51:01Z\",\n \"description\": null,\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-05-23T19:51:02Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_ee686a5ce36748d7b8af5f15097d13d4\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1404" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f16830d1a5e787bc630049d05b" + ], + "x-proxied": [ + "intlb4nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.076048" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_ee686a5ce36748d7b8af5f15097d13d4" + }, + "duration": 292 + }, + { + "recordedAt": 1748029862, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_ee686a5ce36748d7b8af5f15097d13d4" + }, + "response": { + "body": "{\n \"readable\": \"UPS\",\n \"credentials\": {},\n \"created_at\": \"2025-05-23T19:51:01Z\",\n \"description\": null,\n \"type\": \"UpsAccount\",\n \"reference\": null,\n \"updated_at\": \"2025-05-23T19:51:02Z\",\n \"clone\": false,\n \"billing_type\": \"carrier\",\n \"logo\": null,\n \"id\": \"ca_ee686a5ce36748d7b8af5f15097d13d4\",\n \"fields\": {\n \"credentials\": {}\n },\n \"object\": \"CarrierAccount\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1404" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f26830d1a6e787bc640049d0af" + ], + "x-proxied": [ + "intlb4nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.029771" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_ee686a5ce36748d7b8af5f15097d13d4" + }, + "duration": 245 + }, + { + "recordedAt": 1748029862, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_ee686a5ce36748d7b8af5f15097d13d4" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6be4a8f46830d1a6e787bc650049d0eb" + ], + "x-proxied": [ + "intlb4nuq 668d3fc830", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.193067" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202505231841-d89645a184-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/carrier_accounts/ca_ee686a5ce36748d7b8af5f15097d13d4" + }, + "duration": 408 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_metadata/retrieve_carrier_metadata.json b/src/test/cassettes/carrier_metadata/retrieve_carrier_metadata.json new file mode 100644 index 000000000..b92a4a0d0 --- /dev/null +++ b/src/test/cassettes/carrier_metadata/retrieve_carrier_metadata.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823830, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/metadata/carriers" + }, + "response": { + "body": "{\n \"carriers\": [\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"accurate\",\n \"max_weight\": null,\n \"name\": \"Route\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"accurate\",\n \"human_readable\": \"Accurate\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"amazonmws\",\n \"max_weight\": null,\n \"name\": \"UPS Rates\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"amazonmws\",\n \"max_weight\": null,\n \"name\": \"USPS Rates\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"amazonmws\",\n \"max_weight\": null,\n \"name\": \"FedEx Rates\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"amazonmws\",\n \"max_weight\": null,\n \"name\": \"UPS Labels\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"amazonmws\",\n \"max_weight\": null,\n \"name\": \"USPS Labels\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"amazonmws\",\n \"max_weight\": null,\n \"name\": \"FedEx Labels\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"amazonmws\",\n \"max_weight\": null,\n \"name\": \"UPS Tracking\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"amazonmws\",\n \"max_weight\": null,\n \"name\": \"USPS Tracking\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"amazonmws\",\n \"max_weight\": null,\n \"name\": \"FedEx Tracking\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"amazonmws\",\n \"human_readable\": \"Amazon MWS\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectBookService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectExpeditedDDP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectExpeditedDDU\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectPriorityDDP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectPriorityDDPDelcon\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectPriorityDDU\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectPriorityDDUDelcon\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectPriorityDDUPQW\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectStandardDDU\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectStandardDDUPQW\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"apc\",\n \"max_weight\": null,\n \"name\": \"parcelConnectPacketDDU\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"apc\",\n \"human_readable\": \"APC\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ADS\",\n \"description\": null,\n \"human_readable\": \"ADS\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AirFreightInbound\",\n \"description\": null,\n \"human_readable\": \"Air Freight Inbound\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AirFreightOutbound\",\n \"description\": null,\n \"human_readable\": \"Air Freight Outbound\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticBoundPrinterMatterExpedited\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Bound Printed Matter Expedited\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticBoundPrinterMatterGround\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Bound Printed Matter Ground\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticFlatsExpedited\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Flats Expedited\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticFlatsGround\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Flats Ground\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticParcelGroundOver1lb\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Parcel Ground Over 1 Lb\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticParcelGroundUnder1lb\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Parcel Ground Under 1 Lb\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticParcelMAXOver1lb\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Parcel MAX Over 1 Lb\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticParcelMAXUnder1lb\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Parcel MAX Under 1 Lb\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticParcelOver1lbExpedited\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Parcel Over 1 Lb Expedited\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticParcelUnder1lbExpedited\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Parcel Under 1 Lb Expedited\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticPromoParcelExpedited\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Promo Parcel Expedited\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"AsendiaDomesticPromoParcelGround\",\n \"description\": null,\n \"human_readable\": \"Asendia Domestic Promo Parcel Ground\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BulkFreight\",\n \"description\": null,\n \"human_readable\": \"Bulk Freight\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailCanadaLettermail\",\n \"description\": null,\n \"human_readable\": \"Business Mail Canada Lettermail\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailCanadaLettermailMachineable\",\n \"description\": null,\n \"human_readable\": \"Business Mail Canada Lettermail Machineable\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailEconomy\",\n \"description\": null,\n \"human_readable\": \"Business Mail Economy\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailEconomyLPWholesale\",\n \"description\": null,\n \"human_readable\": \"Business Mail Economy LP Wholesale\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailEconomySPWholesale\",\n \"description\": null,\n \"human_readable\": \"Business Mail Economy SP Wholesale\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailIPA\",\n \"description\": null,\n \"human_readable\": \"Business Mail International Priority Airmail\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailISAL\",\n \"description\": null,\n \"human_readable\": \"Business Mail International Surface Air Lift\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailPriority\",\n \"description\": null,\n \"human_readable\": \"Business Mail Priority\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailPriorityLPWholesale\",\n \"description\": null,\n \"human_readable\": \"Business Mail Priority LP Wholesale\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"BusinessMailPrioritySPWholesale\",\n \"description\": null,\n \"human_readable\": \"Business Mail Priority SP Wholesale\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"MarketingMailCanadaPersonalizedLCP\",\n \"description\": null,\n \"human_readable\": \"Marketing Mail Canada Personalized Letter Carrier Presort\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"MarketingMailCanadaPersonalizedMachineable\",\n \"description\": null,\n \"human_readable\": \"Marketing Mail Canada Personalized Machineable\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"MarketingMailCanadaPersonalizedNDG\",\n \"description\": null,\n \"human_readable\": \"Marketing Mail Canada Personalized Non-Dangerous Goods\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"MarketingMailEconomy\",\n \"description\": null,\n \"human_readable\": \"Marketing Mail Economy\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"MarketingMailIPA\",\n \"description\": null,\n \"human_readable\": \"Marketing Mail International Priority Airmail\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"MarketingMailISAL\",\n \"description\": null,\n \"human_readable\": \"MarketingMail International Surface Air Lift\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"MarketingMailPriority\",\n \"description\": null,\n \"human_readable\": \"Marketing Mail Priority\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"PublicationsCanadaLCP\",\n \"description\": null,\n \"human_readable\": \"Publications Canada Letter Carrier Presort\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"PublicationsCanadaNDG\",\n \"description\": null,\n \"human_readable\": \"Publications Canada Non-Dangerous Goods\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"PublicationsEconomy\",\n \"description\": null,\n \"human_readable\": \"Publications Economy\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"PublicationsIPA\",\n \"description\": null,\n \"human_readable\": \"Publications International Priority Airmail\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"PublicationsISAL\",\n \"description\": null,\n \"human_readable\": \"Publications International Surface Air Lift\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"PublicationsPriority\",\n \"description\": null,\n \"human_readable\": \"Publications Priority\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQElite\",\n \"description\": null,\n \"human_readable\": \"ePAQ Elite\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQEliteCustom\",\n \"description\": null,\n \"human_readable\": \"ePAQ Elite Custom\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQEliteDAP\",\n \"description\": null,\n \"human_readable\": \"ePAQElite Delivered At Place\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQEliteDDP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Elite Delivered Duty Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQEliteDDPOversized\",\n \"description\": null,\n \"human_readable\": \"ePAQ Elite Delivered Duty Paid Oversized\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQEliteDPD\",\n \"description\": null,\n \"human_readable\": \"ePAQ Elite DPD\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQEliteDirectAccessCanadaDDP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Elite Direct Access Canada Delivered Duty Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQEliteOversized\",\n \"description\": null,\n \"human_readable\": \"ePAQ Elite Oversized\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlus\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlusCustom\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus Custom\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlusCustomsPrepaid\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus Customs Pre-Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlusDAP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus Delivered At Place\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlusDDP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus Delivered Duty Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlusEconomy\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus Economy\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlusWholesale\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus Wholesale\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlusePacket\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus ePacket\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlusePacketCanadaCustomsPrePaid\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus ePacket Canada Customs Pre-Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQPlusePacketCanadaDDP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Plus ePacket Canada Delivered Duty Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQReturnsDomestic\",\n \"description\": null,\n \"human_readable\": \"ePAQ Returns Domestic\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQReturnsInternational\",\n \"description\": null,\n \"human_readable\": \"ePAQ Returns International\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelect\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectCustom\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Custom\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectCustomsPrepaidByShopper\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Customs Pre-Paid By Shopper\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectDAP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Delivered At Place\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectDDP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Delivered Duty Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectDDPDirectAccess\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Delivered Duty Paid Direct Access\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectDirectAccess\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Direct Access\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectDirectAccessCanadaDDP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Direct Access Canada Delivered Duty Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectEconomy\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Economy\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectOversized\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Oversized\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectOversizedDDP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Oversized Delivered Duty Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectPMEI\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select PMEI\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectPMEICanadaCustomsPrePaid\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select PMEI Canada Customs Pre-Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectPMEIPCPostage\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select PMEIPC Postage\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectPMI\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Priority Mail International\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectPMICanadaCustomsPrepaid\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Priority Mail International Canada Customs Pre-Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectPMICanadaDDP\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Priority Mail International Canada Delivered Duty Paid\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectPMINonPresort\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select Priority Mail International Non-Presort\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectPMIPCPostage\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select PMIPC Postage\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQStandard\",\n \"description\": null,\n \"human_readable\": \"ePAQ Standard\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQStandardCustom\",\n \"description\": null,\n \"human_readable\": \"ePAQ Standard Custom\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQStandardEconomy\",\n \"description\": null,\n \"human_readable\": \"ePAQ Standard Economy\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQStandardIPA\",\n \"description\": null,\n \"human_readable\": \"ePAQ Standard International Priority Airmail\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQStandardISAL\",\n \"description\": null,\n \"human_readable\": \"ePAQ Standard International Surface Air Lift\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePaqSelectPMEINonPresort\",\n \"description\": null,\n \"human_readable\": \"ePaq Select PMEI Non-Presort\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"asendiausa\",\n \"max_weight\": null,\n \"name\": \"ePAQSelectDDPDG\",\n \"description\": null,\n \"human_readable\": \"ePAQ Select DDP DG\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"asendiausa\",\n \"human_readable\": \"Asendia USA\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"ParcelPost\",\n \"description\": \"Specific service availability is determined by your AustraliaPost account.\",\n \"human_readable\": \"Parcel Post\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"ExpressPost\",\n \"description\": \"Specific service availability is determined by your AustraliaPost account.\",\n \"human_readable\": \"Express Post\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"International\",\n \"description\": \"Specific service availability is determined by your AustraliaPost account.International returns not supported.\",\n \"human_readable\": \"International\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"Commercial\",\n \"description\": \"Specific service availability is determined by your AustraliaPost account.\",\n \"human_readable\": \"Commercial\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"CARTON\",\n \"description\": null,\n \"human_readable\": \"Carton\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"PALLET\",\n \"description\": null,\n \"human_readable\": \"Pallet\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"SATCHEL\",\n \"description\": null,\n \"human_readable\": \"Satchel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"BAG\",\n \"description\": null,\n \"human_readable\": \"Bag\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"ENVELOPE\",\n \"description\": null,\n \"human_readable\": \"Envelope\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"ITEM\",\n \"description\": null,\n \"human_readable\": \"Item\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"JIFFYBAG\",\n \"description\": null,\n \"human_readable\": \"Jiffy Bag\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"australiapost\",\n \"max_weight\": null,\n \"name\": \"SKID\",\n \"description\": \"Up to 500kg\",\n \"human_readable\": \"Skid\",\n \"dimensions\": []\n }\n ],\n \"supported_features\": [\n {\n \"carrier\": \"australiapost\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": \"Not available with Print as You Go.\",\n \"supported\": true\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"bill_on_manifest\",\n \"description\": \"Daily manifesting when using Print as You Go.\",\n \"supported\": true\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"returns\",\n \"description\": \"Domestic only.\",\n \"supported\": true\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"australiapost\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"australiapost\",\n \"human_readable\": \"Australia Post\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"bettertrucks\",\n \"max_weight\": null,\n \"name\": \"NEXT_DAY\",\n \"description\": null,\n \"human_readable\": \"Next Day\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"bettertrucks\",\n \"max_weight\": null,\n \"name\": \"EXPRESS\",\n \"description\": null,\n \"human_readable\": \"Express\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"bettertrucks\",\n \"human_readable\": \"Better Trucks\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"bluestreak\",\n \"max_weight\": null,\n \"name\": \"N5\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"bluestreak\",\n \"human_readable\": \"Bluestreak\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"RegularParcel\",\n \"description\": \"Up to 3 days for local delivery, up to 6 days for regional delivery and up to 10 days for national delivery\",\n \"human_readable\": \"Regular Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"ExpeditedParcel\",\n \"description\": \"Up to 2 days for local delivery, up to 4 days for regional delivery and up to 8 days for national delivery\",\n \"human_readable\": \"Expedited Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"Xpresspost\",\n \"description\": \"Next-day and 2-day delivery\",\n \"human_readable\": \"Xpresspost\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"Priority\",\n \"description\": \"Next-day delivery with signature\",\n \"human_readable\": \"Priority\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"ExpeditedParcelUSA\",\n \"description\": \"Delivery in as little as 4 business days for larger parcels\",\n \"human_readable\": \"Expedited Parcel USA\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"SmallPacketUSAAir\",\n \"description\": \"Delivery in as little as 5 business days for small and lightweight items\",\n \"human_readable\": \"Small Packet USA Air\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"TrackedPacketUSA\",\n \"description\": \"Delivery in as little as 4 business days for small and lightweight items\",\n \"human_readable\": \"Tracked Packet USA\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"TrackedPacketUSALVM\",\n \"description\": null,\n \"human_readable\": \"Tracked Packet USA LVM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"XpresspostUSA\",\n \"description\": \"Delivery in 2 and 3 business days\",\n \"human_readable\": \"Xpresspost USA\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"XpresspostInternational\",\n \"description\": \"Delivery in as little as 4 business days\",\n \"human_readable\": \"Xpresspost International\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"InternationalParcelAir\",\n \"description\": \"Delivery in as little as 6 business days for larger parcels\",\n \"human_readable\": \"International Parcel Air\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"InternationalParcelSurface\",\n \"description\": \"Delivery in 1 month and up to 3 months\",\n \"human_readable\": \"International Parcel Surface\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"SmallPacketInternationalAir\",\n \"description\": \"Delivery in as little as 6 business days for small and lightweight items\",\n \"human_readable\": \"Small Packet International Air\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"SmallPacketInternationalSurface\",\n \"description\": \"Delivery in 1 month and up to 3 months for small and lightweight items\",\n \"human_readable\": \"Small Packet International Surface\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"TrackedPacketInternational\",\n \"description\": \"Delivery in as little as 6 business days\",\n \"human_readable\": \"Tracked Packet International\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canadapost\",\n \"max_weight\": null,\n \"name\": \"ExpeditedParcelPlus\",\n \"description\": \"Up to 3 days for local delivery, up to 6 days for regional delivery and up to 10 days for national delivery\",\n \"human_readable\": \"Expedited Parcel Plus\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"canadapost\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"canadapost\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"canadapost\",\n \"human_readable\": \"Canada Post\"\n },\n {\n \"shipment_options\": [\n {\n \"carrier\": \"canpar\",\n \"deprecated\": false,\n \"name\": \"additional_handling\",\n \"description\": null,\n \"human_readable\": \"Additional Handling\",\n \"type\": \"boolean\"\n },\n {\n \"carrier\": \"canpar\",\n \"deprecated\": false,\n \"name\": \"carrier_insurance_amount\",\n \"description\": null,\n \"human_readable\": \"Carrier Insurance Amount\",\n \"type\": \"float\"\n },\n {\n \"carrier\": \"canpar\",\n \"deprecated\": false,\n \"name\": \"handling_instructions\",\n \"description\": null,\n \"human_readable\": \"Handling Instructions\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"canpar\",\n \"deprecated\": false,\n \"name\": \"label_format\",\n \"description\": null,\n \"human_readable\": \"Label Format\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"canpar\",\n \"deprecated\": false,\n \"name\": \"label_size\",\n \"description\": null,\n \"human_readable\": \"Label Size\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"canpar\",\n \"deprecated\": false,\n \"name\": \"delivery_confirmation\",\n \"description\": null,\n \"human_readable\": \"Delivery Confirmation\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"canpar\",\n \"deprecated\": false,\n \"name\": \"cod_amount\",\n \"description\": null,\n \"human_readable\": \"Cod Amount\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"canpar\",\n \"deprecated\": false,\n \"name\": \"cod_method\",\n \"description\": null,\n \"human_readable\": \"Cod Method\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"canpar\",\n \"deprecated\": true,\n \"name\": \"date_advance\",\n \"description\": null,\n \"human_readable\": \"Date Advance\",\n \"type\": \"integer\"\n },\n {\n \"carrier\": \"canpar\",\n \"deprecated\": false,\n \"name\": \"billing_ref\",\n \"description\": null,\n \"human_readable\": \"Billing Ref\",\n \"type\": \"string\"\n }\n ],\n \"service_levels\": [\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"Ground\",\n \"description\": null,\n \"human_readable\": \"Ground\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"USA\",\n \"description\": null,\n \"human_readable\": \"USA\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"SelectLetter\",\n \"description\": null,\n \"human_readable\": \"Select Letter\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"SelectPak\",\n \"description\": null,\n \"human_readable\": \"Select Pak\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"Select\",\n \"description\": null,\n \"human_readable\": \"Select\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"OvernightLetter\",\n \"description\": null,\n \"human_readable\": \"Overnight Letter\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"OvernightPak\",\n \"description\": null,\n \"human_readable\": \"Overnight Pak\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"Overnight\",\n \"description\": null,\n \"human_readable\": \"Overnight\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"USALetter\",\n \"description\": null,\n \"human_readable\": \"USA Letter\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"USAPak\",\n \"description\": null,\n \"human_readable\": \"USA Pak\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"SelectUSA\",\n \"description\": null,\n \"human_readable\": \"Select USA\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"canpar\",\n \"max_weight\": null,\n \"name\": \"International\",\n \"description\": null,\n \"human_readable\": \"International\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"canpar\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"returns\",\n \"description\": \"Subject to regular pricing.\",\n \"supported\": false\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"canpar\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"canpar\",\n \"human_readable\": \"Canpar\"\n },\n {\n \"shipment_options\": [\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": false,\n \"name\": \"delivery_max_datetime\",\n \"description\": null,\n \"human_readable\": \"Delivery Max Datetime\",\n \"type\": \"datetime\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": false,\n \"name\": \"delivery_min_datetime\",\n \"description\": null,\n \"human_readable\": \"Delivery Min Datetime\",\n \"type\": \"datetime\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": false,\n \"name\": \"handling_instructions\",\n \"description\": null,\n \"human_readable\": \"Handling Instructions\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": false,\n \"name\": \"invoice_number\",\n \"description\": null,\n \"human_readable\": \"Invoice Number\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": false,\n \"name\": \"label_format\",\n \"description\": null,\n \"human_readable\": \"Label Format\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": false,\n \"name\": \"pickup_max_datetime\",\n \"description\": null,\n \"human_readable\": \"Pickup Max Datetime\",\n \"type\": \"datetime\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": false,\n \"name\": \"pickup_min_datetime\",\n \"description\": null,\n \"human_readable\": \"Pickup Min Datetime\",\n \"type\": \"datetime\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": true,\n \"name\": \"print_custom_1\",\n \"description\": null,\n \"human_readable\": \"Print Custom 1\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": true,\n \"name\": \"print_custom_1_barcode\",\n \"description\": null,\n \"human_readable\": \"Print Custom 1 Barcode\",\n \"type\": \"boolean\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": true,\n \"name\": \"print_custom_2\",\n \"description\": null,\n \"human_readable\": \"Print Custom 2\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"deprecated\": true,\n \"name\": \"print_custom_2_barcode\",\n \"description\": null,\n \"human_readable\": \"Print Custom 2 Barcode\",\n \"type\": \"boolean\"\n }\n ],\n \"service_levels\": [\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"max_weight\": null,\n \"name\": \"DISTRIBUTION\",\n \"description\": null,\n \"human_readable\": \"DISTRIBUTION\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"max_weight\": null,\n \"name\": \"Same Day\",\n \"description\": null,\n \"human_readable\": \"Same Day\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"cdllastmilesolutions\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"cdllastmilesolutions\",\n \"human_readable\": \"CDL Last Mile Solutions\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"chronopost\",\n \"human_readable\": \"Chronopost\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"CADOECOEA (CA Domestic Economy East)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"CADOECOWE (CA Domestic Economy West)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"CAECOCE (US to CA Economy)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"CAECONE (US to CA Economy)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"CAECOWE (US to CA Economy)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"ECOCE (Economy Central)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"ECOEA (Economy East)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"ECONE (Economy Northeast)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"ECOSO (Economy South)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"ECOWE (Economy West)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"EUECOWE (US to Europe Economy)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"EXPBNE (Expedited Northeast)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"EXPWE (Expedited West)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"REGCE (Regional Central)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"REGEA (Regional East)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"REGNE (Regional Northeast)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"REGSO (Regional South)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cirroecommerce\",\n \"max_weight\": null,\n \"name\": \"REGWE (Regional West)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"cirroecommerce\",\n \"human_readable\": \"Cirro E-Commerce\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"courierexpress\",\n \"max_weight\": null,\n \"name\": \"BASIC_PARCEL\",\n \"description\": null,\n \"human_readable\": \"Basic Parcel\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"courierexpress\",\n \"human_readable\": \"Courier Express\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"RoadExpress\",\n \"description\": null,\n \"human_readable\": \"Road Express\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggExpAtlP10\",\n \"description\": null,\n \"human_readable\": \"Agg Exp Authority To Leave P10\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggExpAtlP25\",\n \"description\": null,\n \"human_readable\": \"Agg Exp Authority To Leave P25\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggExpAtlBaseandKilo\",\n \"description\": null,\n \"human_readable\": \"Agg Exp Authority To Leave Base \\u0026 Kilo\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggExpAtlP0\",\n \"description\": null,\n \"human_readable\": \"Agg Exp Authority To Leave 09\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggExpAtlP1\",\n \"description\": null,\n \"human_readable\": \"Agg Exp Authority To Leave P1\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggExpAtlP3\",\n \"description\": null,\n \"human_readable\": \"Agg Exp Authority To Leave P3\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggExpAtlP5\",\n \"description\": null,\n \"human_readable\": \"Agg Exp Authority To Leave P5\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggDropOffHubbedBaseandKilo\",\n \"description\": null,\n \"human_readable\": \"Agg Drop Off Hubbed Based \\u0026 Kilo\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggDropOffHubbedP0\",\n \"description\": null,\n \"human_readable\": \"Agg Drop Off Hubbed P0\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggDropOffHubbedP1\",\n \"description\": null,\n \"human_readable\": \"Agg Drop Off Hubbed P1\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggDropOffHubbedP3\",\n \"description\": null,\n \"human_readable\": \"Agg Drop Off Hubbed P3\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggDropOffHubbedP5\",\n \"description\": null,\n \"human_readable\": \"Agg Drop Off Hubbed P5\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggStdAtlP10\",\n \"description\": null,\n \"human_readable\": \"Agg STD Authority To Leave P10\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggStdAtlBaseandKilo\",\n \"description\": null,\n \"human_readable\": \"Agg STD Authority To Leave Base \\u0026 Kilo\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggStdAtlP0\",\n \"description\": null,\n \"human_readable\": \"Agg STD Authority To Leave P0\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggStdAtlP1\",\n \"description\": null,\n \"human_readable\": \"Agg STD Authority To Leave P1\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggStdAtlP3\",\n \"description\": null,\n \"human_readable\": \"Agg STD Authority To Leave P3\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggStdAtlP5\",\n \"description\": null,\n \"human_readable\": \"Agg STD Authority To Leave P5\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggEcomBaseandKilo\",\n \"description\": null,\n \"human_readable\": \"Agg Ecommerce Base \\u0026 Kilo\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggEcomP0\",\n \"description\": null,\n \"human_readable\": \"Agg Ecommerce Base \\u0026 Kilo\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggEcomP1\",\n \"description\": null,\n \"human_readable\": \"Agg Ecommerce P1\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggEcomP3\",\n \"description\": null,\n \"human_readable\": \"Agg Ecommerce P3\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggEcomP5\",\n \"description\": null,\n \"human_readable\": \"Agg Ecommerce P5\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggDropOffHubbedP10\",\n \"description\": null,\n \"human_readable\": \"Agg Drop Off Hubbed P10\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggDropOffHubbedP25\",\n \"description\": null,\n \"human_readable\": \"Agg Drop Off Hubbed P25\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggStdAtlP25\",\n \"description\": null,\n \"human_readable\": \"Agg STD Authority To Leave P25\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggEcomP10\",\n \"description\": null,\n \"human_readable\": \"Agg Ecommerce P10\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AggEcomP25\",\n \"description\": null,\n \"human_readable\": \"Agg Ecommerce P25\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AustralianCityExpress\",\n \"description\": null,\n \"human_readable\": \"Australian City Express\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DropShip500GramParcel\",\n \"description\": null,\n \"human_readable\": \"Drop Ship 500 Gram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DropShip1KgParcel\",\n \"description\": null,\n \"human_readable\": \"Drop Ship 1 Kilogram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DropShip3KgParcel\",\n \"description\": null,\n \"human_readable\": \"Drop Ship 3Kilogram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DropShip5KgParcel\",\n \"description\": null,\n \"human_readable\": \"Drop Ship 5 Kilogram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DomesticPriority\",\n \"description\": null,\n \"human_readable\": \"Domestic Priority\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DropShip10KgParcel\",\n \"description\": null,\n \"human_readable\": \"Drop Ship 10 Kilogram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DropShip20KgParcel\",\n \"description\": null,\n \"human_readable\": \"Drop Ship 20 Kilogram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DomesticPrioritySignature\",\n \"description\": null,\n \"human_readable\": \"Domestic Priority Signature\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"GoldDomestic\",\n \"description\": null,\n \"human_readable\": \"Gold Domestic\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"RoadExpressNoDelivery\",\n \"description\": null,\n \"human_readable\": \"Road Express No Delivery\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"RoadExpressNoPickUp\",\n \"description\": null,\n \"human_readable\": \"Road Express No Pick Up\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"500GramParcel\",\n \"description\": null,\n \"human_readable\": \"500 Gram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"500GramParcelATL\",\n \"description\": null,\n \"human_readable\": \"500 Gram Parcel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"10KgParcel\",\n \"description\": null,\n \"human_readable\": \"10 Kilogram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"10KgParcelATL\",\n \"description\": null,\n \"human_readable\": \"10 Kilogram Parcel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"15KgParcel\",\n \"description\": null,\n \"human_readable\": \"15 Kilogram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"15KgParcelATL\",\n \"description\": null,\n \"human_readable\": \"15 Kilogram Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"1KgParcelATL\",\n \"description\": null,\n \"human_readable\": \"1 Kilogram Parcel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"2KgParcel\",\n \"description\": null,\n \"human_readable\": \"2 Kilogram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"25KgParcel\",\n \"description\": null,\n \"human_readable\": \"25 Kilogram Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"25KgParcelATL\",\n \"description\": null,\n \"human_readable\": \"25 Kilogram Parcel Authority To Leaave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"2KgParcelATL\",\n \"description\": null,\n \"human_readable\": \"2 Kilogram Parcel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"3KgParcelATL\",\n \"description\": null,\n \"human_readable\": \"3 Kilogram Parcel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"5Kg Parcel ATL\",\n \"description\": null,\n \"human_readable\": \"5 Kilogram Parcel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"AustralianCityExpressSignature\",\n \"description\": null,\n \"human_readable\": \"Australian City Express Signature\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DomesticSaverSignature\",\n \"description\": null,\n \"human_readable\": \"Domestic Saver Signature\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DomesticOffPeak\",\n \"description\": null,\n \"human_readable\": \"Domestic Off Peak\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DomesticSaver\",\n \"description\": null,\n \"human_readable\": \"Domestic Saver\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"DomesticOffPeakSignature\",\n \"description\": null,\n \"human_readable\": \"Dometic Off Peak Signature\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"GoldDomesticSignature\",\n \"description\": null,\n \"human_readable\": \"Gold Domestic Signature\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"1KgSatchelATL\",\n \"description\": null,\n \"human_readable\": \"1 Kilogram Satchel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"1KgSatchel\",\n \"description\": null,\n \"human_readable\": \"1 Kilogram Satchel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"3KgSatchel\",\n \"description\": null,\n \"human_readable\": \"3 Kilogram Satchel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"5KgSatchel\",\n \"description\": null,\n \"human_readable\": \"5 Kilogram Satchel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"3KgSatchelATL\",\n \"description\": null,\n \"human_readable\": \"3 Kilogram Satchel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"5KgSatchelATL\",\n \"description\": null,\n \"human_readable\": \"5 Kilogram Satchel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"500GramSatchelATL\",\n \"description\": null,\n \"human_readable\": \"500 Gram Satchel Authority To Leave\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"500GramSatchel\",\n \"description\": null,\n \"human_readable\": \"500 Gram Satchel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"5KSatchel\",\n \"description\": null,\n \"human_readable\": \"5 Kilogram Satchel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"ExpressInternationalPriority\",\n \"description\": null,\n \"human_readable\": \"Express International Priority\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"InternationalSaver\",\n \"description\": null,\n \"human_readable\": \"International Saver\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"InternationalExpressImport\",\n \"description\": null,\n \"human_readable\": \"International Express Import\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"InternationalExpress\",\n \"description\": null,\n \"human_readable\": \"International Express\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"500gmParcel\",\n \"description\": null,\n \"human_readable\": \"500gm Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"1KgParcel\",\n \"description\": null,\n \"human_readable\": \"1kg Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"3KgParcel\",\n \"description\": null,\n \"human_readable\": \"3kg Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"couriersplease\",\n \"max_weight\": null,\n \"name\": \"5KgParcel\",\n \"description\": null,\n \"human_readable\": \"5kg Parcel\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"couriersplease\",\n \"human_readable\": \"Couriers Please\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"cslogistics\",\n \"max_weight\": null,\n \"name\": \"Distribution\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cslogistics\",\n \"max_weight\": null,\n \"name\": \"ASAP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cslogistics\",\n \"max_weight\": null,\n \"name\": \"Freight Priority\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cslogistics\",\n \"max_weight\": null,\n \"name\": \"Freight Regular\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cslogistics\",\n \"max_weight\": null,\n \"name\": \"Priority\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cslogistics\",\n \"max_weight\": null,\n \"name\": \"Regular\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"cslogistics\",\n \"max_weight\": null,\n \"name\": \"Scheduled\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"cslogistics\",\n \"human_readable\": \"CSLogistics\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"daipost\",\n \"max_weight\": null,\n \"name\": \"ParcelMax\",\n \"description\": null,\n \"human_readable\": \"Parcel Epacket\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"daipost\",\n \"max_weight\": null,\n \"name\": \"InternationalEconomy\",\n \"description\": null,\n \"human_readable\": \"International Economy\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"daipost\",\n \"max_weight\": null,\n \"name\": \"InternationalStandard\",\n \"description\": null,\n \"human_readable\": \"International Standard\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"daipost\",\n \"max_weight\": null,\n \"name\": \"InternationalExpress\",\n \"description\": null,\n \"human_readable\": \"International Express\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"daipost\",\n \"max_weight\": null,\n \"name\": \"DomesticTracked\",\n \"description\": null,\n \"human_readable\": \"Domestic Tracked\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"daipost\",\n \"max_weight\": null,\n \"name\": \"ParcelRight\",\n \"description\": null,\n \"human_readable\": \"Parcel Right\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"daipost\",\n \"human_readable\": \"DAI Post\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"deliverit\",\n \"max_weight\": null,\n \"name\": \"Saturday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"deliverit\",\n \"max_weight\": null,\n \"name\": \"Economy\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"deliverit\",\n \"max_weight\": null,\n \"name\": \"Noon-It\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"deliverit\",\n \"max_weight\": null,\n \"name\": \"Early-It\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"deliverit\",\n \"max_weight\": null,\n \"name\": \"Afternoon\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"deliverit\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deliverit\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": false\n }\n ],\n \"name\": \"deliverit\",\n \"human_readable\": \"Deliver-It\"\n },\n {\n \"shipment_options\": [\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"additional_handling\",\n \"description\": null,\n \"human_readable\": \"Additional Handling\",\n \"type\": \"boolean\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": true,\n \"name\": \"bill_third_party_account\",\n \"description\": null,\n \"human_readable\": \"Bill Third Party Account\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"carrier_insurance_amount\",\n \"description\": null,\n \"human_readable\": \"Carrier Insurance Amount\",\n \"type\": \"float\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"cod_amount\",\n \"description\": null,\n \"human_readable\": \"Cod Amount\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"cod_method\",\n \"description\": null,\n \"human_readable\": \"Cod Method\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"cost_center\",\n \"description\": null,\n \"human_readable\": \"Cost Center\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": true,\n \"name\": \"delivered_duty_paid\",\n \"description\": null,\n \"human_readable\": \"Delivered Duty Paid\",\n \"type\": \"boolean\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"delivery_confirmation\",\n \"description\": null,\n \"human_readable\": \"Delivery Confirmation\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"handling_instructions\",\n \"description\": null,\n \"human_readable\": \"Handling Instructions\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"invoice_number\",\n \"description\": null,\n \"human_readable\": \"Invoice Number\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"label_date\",\n \"description\": null,\n \"human_readable\": \"Label Date\",\n \"type\": \"datetime\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"label_format\",\n \"description\": null,\n \"human_readable\": \"Label Format\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"label_size\",\n \"description\": null,\n \"human_readable\": \"Label Size\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": true,\n \"name\": \"print_custom_1\",\n \"description\": null,\n \"human_readable\": \"Print Custom 1\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": true,\n \"name\": \"print_custom_2\",\n \"description\": null,\n \"human_readable\": \"Print Custom 2\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"deutschepost\",\n \"deprecated\": false,\n \"name\": \"return_service\",\n \"description\": null,\n \"human_readable\": \"Return Service\",\n \"type\": \"string\"\n }\n ],\n \"service_levels\": [\n {\n \"carrier\": \"deutschepost\",\n \"max_weight\": null,\n \"name\": \"PacketPlus\",\n \"description\": null,\n \"human_readable\": \"Packet Plus\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"deutschepost\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": false\n }\n ],\n \"name\": \"deutschepost\",\n \"human_readable\": \"Deutsche Post\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"deutschepostuk\",\n \"max_weight\": null,\n \"name\": \"PriorityPacketPlus\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"deutschepostuk\",\n \"max_weight\": null,\n \"name\": \"PriorityPacket\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"deutschepostuk\",\n \"max_weight\": null,\n \"name\": \"PriorityPacketTracked\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"deutschepostuk\",\n \"max_weight\": null,\n \"name\": \"BusinessMailRegistered\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"deutschepostuk\",\n \"max_weight\": null,\n \"name\": \"StandardPacket\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"deutschepostuk\",\n \"max_weight\": null,\n \"name\": \"BusinessMailStandard\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"deutschepostuk\",\n \"human_readable\": \"Deutsche Post UK\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLParcelExpedited\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLParcelExpeditedMax\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLParcelGround\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLBPMExpedited\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLBPMGround\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLParcelInternationalDirect\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLParcelInternationalStandard\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLPacketInternational\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLParcelInternationalDirectPriority\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlecommercesolutions\",\n \"max_weight\": null,\n \"name\": \"DHLParcelInternationalDirectStandard\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"dhlecommercesolutions\",\n \"human_readable\": \"DHL eCommerce Solutions\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"BreakBulkEconomy\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"BreakBulkExpress\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"DomesticEconomySelect\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"DomesticExpress\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"DomesticExpress1030\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"DomesticExpress1200\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"EconomySelect\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"EconomySelectNonDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"EuroPack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"EuropackNonDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"Express1030\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"Express1030NonDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"Express1200NonDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"Express1200\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"Express900\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"Express900NonDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressEasy\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressEasyNonDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressWorldwide\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressWorldwideB2C\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressWorldwideB2CNonDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressWorldwideECX\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressWorldwideNonDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"FreightWorldwide\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"GlobalmailBusiness\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"JetLine\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"JumboBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"LogisticsServices\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"SameDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"SecureLine\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"SprintLine\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"JumboDocument\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"JumboParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"Document\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"DHLFlyer\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"Domestic\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressDocument\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"DHLExpressEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"JumboBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"JumboJuniorDocument\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"JuniorJumboBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"JumboJuniorParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"OtherDHLPackaging\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"Parcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlexpress\",\n \"max_weight\": null,\n \"name\": \"YourPackaging\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [],\n \"name\": \"dhlexpress\",\n \"human_readable\": \"DHL Express\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"dhlpaket\",\n \"max_weight\": null,\n \"name\": \"EuroPaket\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlpaket\",\n \"max_weight\": null,\n \"name\": \"Paket\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlpaket\",\n \"max_weight\": null,\n \"name\": \"PaketConnect\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlpaket\",\n \"max_weight\": null,\n \"name\": \"PaketInternational\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dhlpaket\",\n \"max_weight\": null,\n \"name\": \"Retoure\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"dhlpaket\",\n \"human_readable\": \"DHL Paket\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"doordash\",\n \"max_weight\": null,\n \"name\": \"Standard\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"doordash\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"doordash\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"doordash\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"doordash\",\n \"human_readable\": \"DoorDash\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"dpd\",\n \"max_weight\": null,\n \"name\": \"DPDCLASSIC\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpd\",\n \"max_weight\": null,\n \"name\": \"DPD8:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpd\",\n \"max_weight\": null,\n \"name\": \"DPD10:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpd\",\n \"max_weight\": null,\n \"name\": \"DPD12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpd\",\n \"max_weight\": null,\n \"name\": \"DPD18:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpd\",\n \"max_weight\": null,\n \"name\": \"DPDEXPRESS\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpd\",\n \"max_weight\": null,\n \"name\": \"DPDPARCELLETTER\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpd\",\n \"max_weight\": null,\n \"name\": \"DPDPARCELLETTERPLUS\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpd\",\n \"max_weight\": null,\n \"name\": \"DPDINTERNATIONALMAIL\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"dpd\",\n \"human_readable\": \"DPD\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"dpdnl\",\n \"max_weight\": null,\n \"name\": \"DPDNL_CLASSIC\",\n \"description\": null,\n \"human_readable\": \"DPDNL Classic\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpdnl\",\n \"max_weight\": null,\n \"name\": \"EXPRESS_10\",\n \"description\": null,\n \"human_readable\": \"Express 10\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpdnl\",\n \"max_weight\": null,\n \"name\": \"EXPRESS_12\",\n \"description\": null,\n \"human_readable\": \"Express 12\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpdnl\",\n \"max_weight\": null,\n \"name\": \"EXPRESS_18\",\n \"description\": null,\n \"human_readable\": \"Express 18\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpdnl\",\n \"max_weight\": null,\n \"name\": \"INTERNATIONAL_EXPRESS\",\n \"description\": null,\n \"human_readable\": \"International Express\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpdnl\",\n \"max_weight\": null,\n \"name\": \"DPDNL_HOME\",\n \"description\": null,\n \"human_readable\": \"DPDNL B2C Home\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpdnl\",\n \"max_weight\": null,\n \"name\": \"DPDNL_TO_SHOP\",\n \"description\": null,\n \"human_readable\": \"DPDNL B2C Shop\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"dpdnl\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"dpdnl\",\n \"human_readable\": \"DPD NL\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"AirClassicInternationalAir\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"AirExpressInternationalAir\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpresspakDpd10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpresspakDpd12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpresspakDpdClassic\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpresspakDpdNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpresspakSaturday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpresspakSaturday10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpresspakSaturday12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpresspakSunday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpresspakSunday12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelDpd10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelDpd12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelDpdClassic\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelDpdNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelDpdTwoDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelSaturday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelSaturday10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelSaturday12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelSunday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcelSunday12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletDpd10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletDpd12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletDpdClassic\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletDpdNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletDpdTwoDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletSaturday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletSaturday10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletSaturday12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletSunday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"PalletSunday12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelDpd10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelDpd12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelDpdClassic\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelDpdNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelDpdTwoDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelReturnToShop\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelSaturday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelSaturday10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelSaturday12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelSunday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ParcelSunday12:00\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"Parcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"Pallet\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"ExpressPak\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"FreightParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"dpduk\",\n \"max_weight\": null,\n \"name\": \"Freight\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [],\n \"name\": \"dpduk\",\n \"human_readable\": \"DPD UK\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"CourierServiceDDP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"CourierServiceDDU\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"DomesticEconomyParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"DomesticParcelBPM\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"DomesticPriorityParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"DomesticPriorityParcelBPM\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"EMIService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"EconomyParcelService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"IPAService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"ISALService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"PMIService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"PriorityParcelDDP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"PriorityParcelDDU\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"PriorityParcelDeliveryConfirmationDDP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"PriorityParcelDeliveryConfirmationDDU\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobal\",\n \"max_weight\": null,\n \"name\": \"ePacketService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"epostglobal\",\n \"human_readable\": \"ePostGlobal\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"CourierService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"CourierServiceDutiesPaid\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"DomesticPriorityParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"DomesticeDGE\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"EconomyParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"ExpeditedParcelWithDeliveryConfirmationDutiesPaid\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"ExpeditedWithDC\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"FirstClassParcelsInternational\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"IPA\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"ISAL\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"PMEI\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"PMEIDDP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"PMIPresortService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"PMIServiceDutyPaid\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"PriorityPacketDDU\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"PriorityParcelNoDeliveryConfirmation\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"PriorityParcelNoDeliveryConfirmationDutiesPaid\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"PriorityParcelWithDeliveryConfirmation\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"PriorityParcelWithDeliveryConfirmationDutiesPaid\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"ePacket\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"max_weight\": null,\n \"name\": \"ePacketDDP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"epostglobalv2\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"epostglobalv2\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"epostglobalv2\",\n \"human_readable\": \"EPostGlobalV2\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"estafeta\",\n \"max_weight\": null,\n \"name\": \"11:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"estafeta\",\n \"max_weight\": null,\n \"name\": \"12:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"estafeta\",\n \"max_weight\": null,\n \"name\": \"Dia Sig.\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"estafeta\",\n \"max_weight\": null,\n \"name\": \"2 Dias\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"estafeta\",\n \"max_weight\": null,\n \"name\": \"Terrestre\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"estafeta\",\n \"max_weight\": null,\n \"name\": \"LTL\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"estafeta\",\n \"max_weight\": null,\n \"name\": \"ENVELOPE\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"estafeta\",\n \"max_weight\": null,\n \"name\": \"PARCEL\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [],\n \"name\": \"estafeta\",\n \"human_readable\": \"Estafeta\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Courier2Home\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Courier2HomeNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Shop2Home\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Shop2HomeNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Shop2Shop\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Shop2ShopNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Courier2Shop\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Courier2ShopNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"International Delivery\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Commercial\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"DDP Courier\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"DDU Courier\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"DDU Shop\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"evri\",\n \"max_weight\": null,\n \"name\": \"Postal\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"evri\",\n \"human_readable\": \"Evri\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"Parcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"Satchel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"Parcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"A2\",\n \"description\": \"(Satchel)\",\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"A3\",\n \"description\": \"(Satchel)\",\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"A4\",\n \"description\": \"(Satchel, not available in Australia)\",\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"A5\",\n \"description\": \"(Satchel, not available in South Africa)\",\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"BOXSML\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"BOXMED\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fastway\",\n \"max_weight\": null,\n \"name\": \"BOXLRG\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [],\n \"name\": \"fastway\",\n \"human_readable\": \"Fastway\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"FEDEX_2_DAY\",\n \"description\": \"2 business days by 4:30pm, Saturday delivery\",\n \"human_readable\": \"FedEx 2 Day\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"FEDEX_2_DAY_AM\",\n \"description\": \"2 business days by 10:30am\",\n \"human_readable\": \"FedEx 2 Day (AM)\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"FEDEX_EXPRESS_SAVER\",\n \"description\": \"3 business days by 4:30pm\",\n \"human_readable\": \"FedEx Express Saver\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"FEDEX_GROUND\",\n \"description\": \"1-6 days\",\n \"human_readable\": \"FedEx Ground\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"FEDEX_INTERNATIONAL_CONNECT_PLUS\",\n \"description\": \"2-5 business days\",\n \"human_readable\": \"FedEx International (Connect Plus)\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"FIRST_OVERNIGHT\",\n \"description\": \"By 8am the next business day, Saturday delivery\",\n \"human_readable\": \"FedEx First (Overnight)\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"GROUND_HOME_DELIVERY\",\n \"description\": \"1-5 days\",\n \"human_readable\": \"FedEx Ground (Home Delivery)\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"INTERNATIONAL_ECONOMY\",\n \"description\": \"4-5 business days\",\n \"human_readable\": \"FedEx International (Economy)\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"INTERNATIONAL_FIRST\",\n \"description\": \"1-3 business days, time definite to select markets\",\n \"human_readable\": \"FedEx International First\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"INTERNATIONAL_PRIORITY\",\n \"description\": \"1-3 business days, time definite to select markets\",\n \"human_readable\": \"FedEx International (First)\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"PRIORITY_OVERNIGHT\",\n \"description\": \"By 10:30am the next business day, Saturday delivery\",\n \"human_readable\": \"FedEx Priority Overnight\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"SMART_POST\",\n \"description\": \"2-7 business days; Sunday Delivery to select markets\",\n \"human_readable\": \"FedEx Ground Economy (formerly FedEx SmartPost)\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"STANDARD_OVERNIGHT\",\n \"description\": \"By 4:30pm the next business day\",\n \"human_readable\": \"FedEx Standard Overnight\",\n \"dimensions\": null\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"fedex\",\n \"max_weight\": 160.0,\n \"name\": \"FedExEnvelope\",\n \"description\": \"Up to approximately 60 pages\",\n \"human_readable\": null,\n \"dimensions\": [\n \"9.5in x 12.5in\"\n ]\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": null,\n \"name\": \"FedExBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": 800.0,\n \"name\": \"FedExPak\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12in x 15.5in\"\n ]\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": 800.0,\n \"name\": \"FedExTube\",\n \"description\": \"Triangular box for plans, posters, fabric rolls, charts and blueprints\",\n \"human_readable\": null,\n \"dimensions\": [\n \"38in x 6in x 6in x 6in\"\n ]\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": 352.0,\n \"name\": \"FedEx10kgBox\",\n \"description\": \"To qualify for the flat rate, weight cannot exceed 10 kg\",\n \"human_readable\": null,\n \"dimensions\": [\n \"15.81in x 12.94in x 10.19in\"\n ]\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": 880.0,\n \"name\": \"FedEx25kgBox\",\n \"description\": \"To qualify for the flat rate, weight cannot exceed 25 kg.\",\n \"human_readable\": null,\n \"dimensions\": [\n \"21.56in x 16.56in x 13.19in\"\n ]\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": 800.0,\n \"name\": \"FedExSmallBox\",\n \"description\": \"Maximum weight allowed is based on pricing option: 50 lbs (800 oz) for domestic Express One Rate shipments, 20 lbs (320 oz) for domestic weight-based Express shipments, 40 lbs (640 oz) for international weight-based Express shipments.\",\n \"human_readable\": null,\n \"dimensions\": [\n \"12.25in x 10.9in x 1.5in\",\n \"8.75in x 2.63in x 11.25in\"\n ]\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": 800.0,\n \"name\": \"FedExMediumBox\",\n \"description\": \"Maximum weight allowed is based on pricing option: 50 lbs (800 oz) for domestic Express One Rate shipments, 20 lbs (320 oz) for domestic weight-based Express shipments, 40 lbs (640 oz) for international weight-based Express shipments.\",\n \"human_readable\": null,\n \"dimensions\": [\n \"13.25in x 11.5in x 2.38in\",\n \"8.75in x 4.38in x 11.25in\"\n ]\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": 800.0,\n \"name\": \"FedExLargeBox\",\n \"description\": \"Maximum weight allowed is based on pricing option: 50 lbs (800 oz) for domestic Express One Rate shipments, 20 lbs (320 oz) for domestic weight-based Express shipments, 40 lbs (640 oz) for international weight-based Express shipments.\",\n \"human_readable\": null,\n \"dimensions\": [\n \"17.88in x 12.38in x 3in\",\n \"8.75in x 7.75in x 11.25in\"\n ]\n },\n {\n \"carrier\": \"fedex\",\n \"max_weight\": 800.0,\n \"name\": \"FedExExtraLargeBox\",\n \"description\": \"Maximum weight allowed is based on pricing option: 50 lbs (800 oz) for domestic Express One Rate shipments, 20 lbs (320 oz) for domestic weight-based Express shipments, 40 lbs (640 oz) for international weight-based Express shipments.\",\n \"human_readable\": null,\n \"dimensions\": [\n \"11.88in x 10.75in x 11in\",\n \"15.25in x 14.13in x 6in\"\n ]\n }\n ],\n \"supported_features\": [],\n \"name\": \"fedex\",\n \"human_readable\": \"FedEx\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"fedexcrossborder\",\n \"max_weight\": null,\n \"name\": \"CBEC\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fedexcrossborder\",\n \"max_weight\": null,\n \"name\": \"CBECL\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"fedexcrossborder\",\n \"max_weight\": null,\n \"name\": \"CBECP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"fedexcrossborder\",\n \"human_readable\": \"FedEx Cross Border\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"fedexgroundeconomy\",\n \"max_weight\": null,\n \"name\": \"SMART_POST\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"fedexgroundeconomy\",\n \"human_readable\": \"FedEx Ground Economy\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"fedexsmartpost\",\n \"max_weight\": null,\n \"name\": \"SMART_POST\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"fedexsmartpost\",\n \"human_readable\": \"FedEx SmartPost\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"firstchoice\",\n \"max_weight\": null,\n \"name\": \"ST\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"firstchoice\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"firstchoice\",\n \"human_readable\": \"First Choice\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"firstmile\",\n \"max_weight\": null,\n \"name\": \"XParcelPriority\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"firstmile\",\n \"max_weight\": null,\n \"name\": \"XParcelExpedited\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"firstmile\",\n \"max_weight\": null,\n \"name\": \"XParcelReturns\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"firstmile\",\n \"max_weight\": null,\n \"name\": \"XParcelGround\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"firstmile\",\n \"max_weight\": null,\n \"name\": \"XParcelExpeditedPlus\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"firstmile\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"firstmile\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"firstmile\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"firstmile\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"firstmile\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"firstmile\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"firstmile\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"firstmile\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"firstmile\",\n \"human_readable\": \"First Mile\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"flexport\",\n \"max_weight\": null,\n \"name\": \"Standard\",\n \"description\": null,\n \"human_readable\": \"Standard\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"flexport\",\n \"max_weight\": null,\n \"name\": \"Expedited\",\n \"description\": null,\n \"human_readable\": \"Expedited\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"flexport\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"flexport\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": false\n }\n ],\n \"name\": \"flexport\",\n \"human_readable\": \"Flexport\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"gio\",\n \"max_weight\": null,\n \"name\": \"scheduled\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"gio\",\n \"human_readable\": \"Gio\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"gls\",\n \"max_weight\": null,\n \"name\": \"CaliforniaParcelService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gls\",\n \"max_weight\": null,\n \"name\": \"EarlyPriorityOvernight\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gls\",\n \"max_weight\": null,\n \"name\": \"EarlySaturdayService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gls\",\n \"max_weight\": null,\n \"name\": \"Ground\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gls\",\n \"max_weight\": null,\n \"name\": \"Overnight\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gls\",\n \"max_weight\": null,\n \"name\": \"PriorityOvernight\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gls\",\n \"max_weight\": null,\n \"name\": \"SaturdayDeliveryService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"gls\",\n \"human_readable\": \"GLS\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"gso\",\n \"max_weight\": null,\n \"name\": \"CaliforniaParcelService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gso\",\n \"max_weight\": null,\n \"name\": \"EarlyPriorityOvernight\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gso\",\n \"max_weight\": null,\n \"name\": \"EarlySaturdayService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gso\",\n \"max_weight\": null,\n \"name\": \"Ground\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gso\",\n \"max_weight\": null,\n \"name\": \"Overnight\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gso\",\n \"max_weight\": null,\n \"name\": \"PriorityOvernight\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"gso\",\n \"max_weight\": null,\n \"name\": \"SaturdayDeliveryService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"gso\",\n \"human_readable\": \"GSO\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"hailify\",\n \"max_weight\": null,\n \"name\": \"Xpress\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"hailify\",\n \"human_readable\": \"Hailify\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"henry\",\n \"max_weight\": null,\n \"name\": \"Distribution\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"henry\",\n \"human_readable\": \"Henry\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkAirClassicInternationalAir\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkAirExpressInternationalAir\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak1By10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak1By12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak1NextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak1Saturday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak1SaturdayBy10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak1SaturdayBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak1Sunday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak1SundayBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5By10\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5By10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5By12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5NextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5Saturday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5SaturdayBy10\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5SaturdayBy10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5SaturdayBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5Sunday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkExpresspak5SundayBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkFreightBy10\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkFreightBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkFreightNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkFreightSaturday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkFreightSaturdayBy10\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkFreightSaturdayBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkFreightSunday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkFreightSundayBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelBy10\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelBy10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelDpdEuropeByRoad\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelNextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelReturn\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelReturnToShop\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelSaturday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelSaturdayBy10\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelSaturdayBy10:30\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelSaturdayBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelShipToShop\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelSunday\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelSundayBy12\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkParcelTwoDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"InterlinkPickupParcelDpdEuropeByRoad\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"Parcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"Pallet\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"ExpressPak\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"FreightParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"interlinkexpress\",\n \"max_weight\": null,\n \"name\": \"Freight\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [],\n \"name\": \"interlinkexpress\",\n \"human_readable\": \"Interlink Express\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"jet\",\n \"max_weight\": null,\n \"name\": \"Distribution\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"jet\",\n \"human_readable\": \"Jet\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"jitsu\",\n \"max_weight\": null,\n \"name\": \"AxleHireDelivery\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"jitsu\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"jitsu\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"jitsu\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"jitsu\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"jitsu\",\n \"human_readable\": \"Jitsu\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"jppost\",\n \"human_readable\": \"JP Post\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"kuronekoyamato\",\n \"human_readable\": \"Kuroneko Yamato\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"laposte\",\n \"human_readable\": \"La Poste\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"lasershipv2\",\n \"max_weight\": null,\n \"name\": \"SameDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"lasershipv2\",\n \"max_weight\": null,\n \"name\": \"NextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"lasershipv2\",\n \"max_weight\": null,\n \"name\": \"Weekend\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"lasershipv2\",\n \"max_weight\": null,\n \"name\": \"Envelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"lasershipv2\",\n \"max_weight\": null,\n \"name\": \"Custom\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [],\n \"name\": \"lasershipv2\",\n \"human_readable\": \"LaserShip\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"loomisexpress\",\n \"max_weight\": null,\n \"name\": \"LoomisGround\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"loomisexpress\",\n \"max_weight\": null,\n \"name\": \"LoomisExpress1800\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"loomisexpress\",\n \"max_weight\": null,\n \"name\": \"LoomisExpress1200\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"loomisexpress\",\n \"max_weight\": null,\n \"name\": \"LoomisExpress900\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"loomisexpress\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"loomisexpress\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"loomisexpress\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"loomisexpress\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"loomisexpress\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"loomisexpress\",\n \"human_readable\": \"Loomis Express\"\n },\n {\n \"shipment_options\": [\n {\n \"carrier\": \"lso\",\n \"deprecated\": false,\n \"name\": \"delivery_confirmation\",\n \"description\": null,\n \"human_readable\": \"Delivery Confirmation\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"lso\",\n \"deprecated\": false,\n \"name\": \"saturday_delivery\",\n \"description\": null,\n \"human_readable\": \"Saturday Delivery\",\n \"type\": \"boolean\"\n },\n {\n \"carrier\": \"lso\",\n \"deprecated\": true,\n \"name\": \"date_advance\",\n \"description\": null,\n \"human_readable\": \"Date Advance\",\n \"type\": \"integer\"\n },\n {\n \"carrier\": \"lso\",\n \"deprecated\": true,\n \"name\": \"declared_value\",\n \"description\": null,\n \"human_readable\": \"Declared Value\",\n \"type\": \"float\"\n },\n {\n \"carrier\": \"lso\",\n \"deprecated\": false,\n \"name\": \"label_format\",\n \"description\": null,\n \"human_readable\": \"Label Format\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"lso\",\n \"deprecated\": false,\n \"name\": \"label_size\",\n \"description\": null,\n \"human_readable\": \"Label Size\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"lso\",\n \"deprecated\": true,\n \"name\": \"print_custom_1\",\n \"description\": null,\n \"human_readable\": \"Print Custom 1\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"lso\",\n \"deprecated\": true,\n \"name\": \"print_custom_2\",\n \"description\": null,\n \"human_readable\": \"Print Custom 2\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"lso\",\n \"deprecated\": true,\n \"name\": \"print_custom_3\",\n \"description\": null,\n \"human_readable\": \"Print Custom 3\",\n \"type\": \"string\"\n }\n ],\n \"service_levels\": [\n {\n \"carrier\": \"lso\",\n \"max_weight\": null,\n \"name\": \"PriorityEarly\",\n \"description\": null,\n \"human_readable\": \"Early Next Day by 8:30 a.m.\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"lso\",\n \"max_weight\": null,\n \"name\": \"PriorityBasic\",\n \"description\": null,\n \"human_readable\": \"Priority Next Day by 10:30 a.m.\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"lso\",\n \"max_weight\": null,\n \"name\": \"Priority2ndDay\",\n \"description\": null,\n \"human_readable\": \"Priority 2nd Business Day\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"lso\",\n \"max_weight\": null,\n \"name\": \"GroundEarly\",\n \"description\": null,\n \"human_readable\": \"Economy Next Day by 3 p.m.\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"lso\",\n \"max_weight\": null,\n \"name\": \"GroundBasic\",\n \"description\": null,\n \"human_readable\": \"Ground Basic in 1-3 business days\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"lso\",\n \"max_weight\": null,\n \"name\": \"ECommerce\",\n \"description\": null,\n \"human_readable\": \"eCommerce\",\n \"dimensions\": null\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"lso\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"lso\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"lso\",\n \"human_readable\": \"LSO\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"maersk\",\n \"max_weight\": null,\n \"name\": \"Maersk-3-Day\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"maersk\",\n \"human_readable\": \"Maersk\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"ontracv3\",\n \"max_weight\": null,\n \"name\": \"GRND\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"ontracv3\",\n \"max_weight\": null,\n \"name\": \"Next_Day\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"ontracv3\",\n \"max_weight\": null,\n \"name\": \"Letter\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [],\n \"name\": \"ontracv3\",\n \"human_readable\": \"OnTracV3\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"optima\",\n \"max_weight\": 800.0,\n \"name\": \"NxtDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"Maximum length: 48in\",\n \"Maximum width: 32in\",\n \"Maximum height: 32in\"\n ]\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"optima\",\n \"human_readable\": \"Optima\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"Priority\",\n \"description\": null,\n \"human_readable\": \"Priority\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"BPM\",\n \"description\": null,\n \"human_readable\": \"BPM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"ParcelSelect\",\n \"description\": null,\n \"human_readable\": \"Parcel Select\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"MediaMail\",\n \"description\": null,\n \"human_readable\": \"Media Mail\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"MarketingParcel\",\n \"description\": null,\n \"human_readable\": \"Marketing Parcel\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"MarketingParcelTracked\",\n \"description\": null,\n \"human_readable\": \"Marketing Parcel Tracked\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"ParcelSelectHazardousMaterial\",\n \"description\": null,\n \"human_readable\": \"Parcel Select Hazardous Material\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"USPSGroundAdvantage\",\n \"description\": null,\n \"human_readable\": \"USPS Ground Advantage\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"USPSGroundAdvantageLightweight\",\n \"description\": null,\n \"human_readable\": \"USPS Ground Advantage Lightweight\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"USPSGroundAdvantageHazmat\",\n \"description\": null,\n \"human_readable\": \"USPS Ground Advantage Hazmat\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"USPSGroundAdvantageHazmatSignature\",\n \"description\": null,\n \"human_readable\": \"USPS Ground Advantage Hazmat Signature\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"USPSGroundAdvantageLightweightHazmat\",\n \"description\": null,\n \"human_readable\": \"USPS Ground Advantage Lightweight Hazmat\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"USPSGroundAdvantageLightweightHazmatSignature\",\n \"description\": null,\n \"human_readable\": \"USPS Ground Advantage Lightweight Hazmat Signature\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"ParcelSelectHazmatSignature\",\n \"description\": null,\n \"human_readable\": \"Parcel Select Hazmat Signature\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"parcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"irregularparcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"osmworldwide\",\n \"max_weight\": null,\n \"name\": \"softpack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [\n {\n \"carrier\": \"osmworldwide\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"osmworldwide\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"osmworldwide\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"osmworldwide\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"osmworldwide\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"osmworldwide\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"osmworldwide\",\n \"name\": \"scanforms\",\n \"description\": \"Manifesting\",\n \"supported\": true\n },\n {\n \"carrier\": \"osmworldwide\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"osmworldwide\",\n \"human_readable\": \"OSM Worldwide\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"pandion\",\n \"max_weight\": null,\n \"name\": \"Pandion Express\",\n \"description\": null,\n \"human_readable\": \"Pandion Express\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"pandion\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"pandion\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"pandion\",\n \"human_readable\": \"Pandion\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"europrioritybusiness\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"europriorityhome\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express10\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express10CourierPack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express10Exchange\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express10Secure\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express10SecureExchange\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express24\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express24CourierPack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express24Exchange\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express24large\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express24Secure\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express24SecureExchange\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express48\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express48large\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express9\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express9CourierPack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"express9Secure\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"expressAM\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"expressAMCourierPack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"expressAMExchange\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"expressAMSecure\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"expressAMSecureExchange\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"expressPM\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"expressPMSecure\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"globalBulkDirect\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"globalexpress\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"globalexpressEnvelopeDelivery\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"globalexpressPackDelivery\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"globalpriority\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"globalpriorityReturns\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"globalvalue\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"irelandexpress\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcelforce\",\n \"max_weight\": null,\n \"name\": \"ParcelRiderPlus\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"parcelforce\",\n \"human_readable\": \"Parcelforce\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"CADOECOEA (CA Domestic Economy East)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"CADOECOWE (CA Domestic Economy West)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"CAECOCE (US to CA Economy)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"CAECONE (US to CA Economy)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"CAECOWE (US to CA Economy)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"ECOCE (Economy Central)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"ECOEA (Economy East)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"ECONE (Economy Northeast)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"ECOSO (Economy South)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"ECOWE (Economy West)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"EUECOWE (US to Europe Economy)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"EXPBNE (Expedited Northeast)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"EXPWE (Expedited West)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"REGCE (Regional Central)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"REGEA (Regional East)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"REGNE (Regional Northeast)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"REGSO (Regional South)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"parcll\",\n \"max_weight\": null,\n \"name\": \"REGWE (Regional West)\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"parcll\",\n \"human_readable\": \"PARCLL\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"passportglobal\",\n \"human_readable\": \"Passport\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"postnl\",\n \"human_readable\": \"PostNL\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpress\",\n \"description\": null,\n \"human_readable\": \"Purolator Express\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpress12PM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express 12PM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPack12PM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack 12PM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBox12PM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box 12PM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelope12PM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope 12PM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpress1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpress9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBox\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBox1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBox9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBoxEvening\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box Evening\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBoxInternational\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box International\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBoxUS\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box US\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelope\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelope1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelope9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelopeEvening\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope Evening\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelopeInternational\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope International\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelopeUS\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope US\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEvening\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Evening\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressInternational\",\n \"description\": null,\n \"human_readable\": \"Purolator Express International\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressInternational1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express International 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressInternational1200\",\n \"description\": null,\n \"human_readable\": \"Purolator Express International 12:00\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressInternational9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express International 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBoxInternational1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box International 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBoxInternational1200\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box International 12:00\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBoxInternational9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box International 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelopeInternational1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope International 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelopeInternational1200\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope International 12:00\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelopeInternational9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope International 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPackInternational1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack International 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPackInternational1200\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack International 12:00\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPackInternational9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack International 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPack\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPack1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPack9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPackEvening\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack Evening\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPackInternational\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack International\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPackUS\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack US\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressUS\",\n \"description\": null,\n \"human_readable\": \"Purolator Express US\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressUS1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express US 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressUS1200\",\n \"description\": null,\n \"human_readable\": \"Purolator Express US 12:00\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressUS9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express US 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBoxUS1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box US 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBoxUS1200\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box US 12:00\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressBoxUS9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Box US 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelopeUS1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope US 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelopeUS1200\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope US 12:00\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressEnvelopeUS9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Envelope US 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPackUS1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack US 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPackUS1200\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack US 12:00\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorExpressPackUS9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Express Pack US 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorGround\",\n \"description\": null,\n \"human_readable\": \"Purolator Ground\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorGround1030AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Ground 10:30AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorGround9AM\",\n \"description\": null,\n \"human_readable\": \"Purolator Ground 9AM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorGround12PM\",\n \"description\": null,\n \"human_readable\": \"Purolator Ground 12PM\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorGroundDistribution\",\n \"description\": null,\n \"human_readable\": \"Purolator Ground Distribution\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorGroundEvening\",\n \"description\": null,\n \"human_readable\": \"Purolator Ground Evening\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorGroundUS\",\n \"description\": null,\n \"human_readable\": \"Purolator Ground US\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorQuickShip\",\n \"description\": null,\n \"human_readable\": \"Purolator Quick Ship\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorQuickShipEnvelope\",\n \"description\": null,\n \"human_readable\": \"Purolator Quick Ship Envelope\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorQuickShipPack\",\n \"description\": null,\n \"human_readable\": \"Purolator Quick Ship Pack\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"PurolatorQuickShipBox\",\n \"description\": null,\n \"human_readable\": \"Purolator Quick Ship Box\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"CUSTOMERPACKAGING\",\n \"description\": null,\n \"human_readable\": \"CustomerPackaging\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"EXPRESSPACK\",\n \"description\": null,\n \"human_readable\": \"ExpressPack\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"EXPRESSBOX\",\n \"description\": null,\n \"human_readable\": \"ExpressBox\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"purolator\",\n \"max_weight\": null,\n \"name\": \"EXPRESSENVELOPE\",\n \"description\": null,\n \"human_readable\": \"ExpressEnvelope\",\n \"dimensions\": []\n }\n ],\n \"supported_features\": [\n {\n \"carrier\": \"purolator\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"refunds\",\n \"description\": \"Purolator bills at the end of the day for all labels created that day. You cannot refund a label after the end of the day it was created.\",\n \"supported\": true\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"purolator\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"purolator\",\n \"human_readable\": \"Purolator\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"quick\",\n \"max_weight\": null,\n \"name\": \"Routed\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"quick\",\n \"human_readable\": \"Quick\"\n },\n {\n \"shipment_options\": [\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"carrier_insurance_amount\",\n \"description\": null,\n \"human_readable\": \"Carrier Insurance Amount\",\n \"type\": \"float\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"carrier_notification_email\",\n \"description\": null,\n \"human_readable\": \"Carrier Notification Email\",\n \"type\": \"boolean\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"carrier_notification_sms\",\n \"description\": null,\n \"human_readable\": \"Carrier Notification Sms\",\n \"type\": \"boolean\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": true,\n \"name\": \"date_advance\",\n \"description\": null,\n \"human_readable\": \"Date Advance\",\n \"type\": \"integer\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": true,\n \"name\": \"delivered_duty_paid\",\n \"description\": null,\n \"human_readable\": \"Delivered Duty Paid\",\n \"type\": \"boolean\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"delivery_confirmation\",\n \"description\": null,\n \"human_readable\": \"Delivery Confirmation\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"handling_instructions\",\n \"description\": null,\n \"human_readable\": \"Handling Instructions\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"import_federal_tax_id\",\n \"description\": null,\n \"human_readable\": \"Import Federal Tax Id\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"incoterm\",\n \"description\": null,\n \"human_readable\": \"Incoterm\",\n \"type\": \"enum\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"invoice_number\",\n \"description\": null,\n \"human_readable\": \"Invoice Number\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"label_date\",\n \"description\": null,\n \"human_readable\": \"Label Date\",\n \"type\": \"datetime\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"label_format\",\n \"description\": null,\n \"human_readable\": \"Label Format\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"license_number\",\n \"description\": null,\n \"human_readable\": \"License Number\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": true,\n \"name\": \"print_custom_1\",\n \"description\": null,\n \"human_readable\": \"Print Custom 1\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": true,\n \"name\": \"print_custom_2\",\n \"description\": null,\n \"human_readable\": \"Print Custom 2\",\n \"type\": \"string\"\n },\n {\n \"carrier\": \"royalmail\",\n \"deprecated\": false,\n \"name\": \"saturday_delivery\",\n \"description\": null,\n \"human_readable\": \"Saturday Delivery\",\n \"type\": \"boolean\"\n }\n ],\n \"service_levels\": [\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"InternationalPriority\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"InternationalEconomy\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"InternationalStandard\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"InternationalTrackedAndSigned\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"InternationalTracked\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"InternationalSigned\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"AccountMail\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"RoyalMailUnsigned\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"RoyalMail\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"SpecialDeliveryGuaranteed\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"SpecialDeliveryGuaranteed1pm\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"SpecialDeliveryGuaranteed9am\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"StandardLetter\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked24\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked24HighVolume\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked24HighVolumeSignature\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked24LBT\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked24SignatureLBT\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked48LBT\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked48SignatureLBT\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked24Signature\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked48\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked48HighVolume\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked48HighVolumeSignature\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"Tracked48Signature\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"TrackedReturns24\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"TrackedReturns48\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"CrossBorderImportTracked48HighVolume\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"LARGELETTER\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"SMALLPARCEL\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"MEDIUMPARCEL\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"LETTER\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"royalmail\",\n \"max_weight\": null,\n \"name\": \"PRINTEDPAPER\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [\n {\n \"carrier\": \"royalmail\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"royalmail\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": true\n }\n ],\n \"name\": \"royalmail\",\n \"human_readable\": \"Royal Mail\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Ecommerce Standard Tracked\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Ecommerce Express Tracked\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Domestic Express\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Domestic Standard\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Bag\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Box\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Carton\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Container\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Crate\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Envelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Pail\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Pallet\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Satchel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sekoomniparcel\",\n \"max_weight\": null,\n \"name\": \"Tub\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [],\n \"name\": \"sekoomniparcel\",\n \"human_readable\": \"SEKO OmniParcel\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"sendle\",\n \"max_weight\": null,\n \"name\": \"Standard\",\n \"description\": null,\n \"human_readable\": \"Standard\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"sendle\",\n \"max_weight\": null,\n \"name\": \"Express\",\n \"description\": null,\n \"human_readable\": \"Express\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"sendle\",\n \"max_weight\": null,\n \"name\": \"Saver\",\n \"description\": null,\n \"human_readable\": \"Saver\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"sendle\",\n \"max_weight\": null,\n \"name\": \"Two-Day\",\n \"description\": null,\n \"human_readable\": \"Two-Day\",\n \"dimensions\": []\n },\n {\n \"carrier\": \"sendle\",\n \"max_weight\": null,\n \"name\": \"Three-Day\",\n \"description\": null,\n \"human_readable\": \"Three-Day\",\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"sendle\",\n \"human_readable\": \"Sendle\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"InternationalStandardExpressDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"InternationalStandardExpressParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"InternationalEconomyExpressPilot\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"InternationalEconomyExpressDoc\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"InternationalEconomyExpressParcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"DomesticExpress\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"DomesticStandard\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"DomesticIntraCity\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"StandardExpress\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"sfexpress\",\n \"max_weight\": null,\n \"name\": \"EconomyExpress\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"sfexpress\",\n \"human_readable\": \"SF Express\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"smartkargo\",\n \"max_weight\": null,\n \"name\": \"EPR\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"smartkargo\",\n \"max_weight\": null,\n \"name\": \"EPS\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"smartkargo\",\n \"max_weight\": null,\n \"name\": \"EST\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"smartkargo\",\n \"max_weight\": null,\n \"name\": \"EXP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"smartkargo\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"smartkargo\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"smartkargo\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"smartkargo\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"smartkargo\",\n \"human_readable\": \"SmartKargo\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"sonic\",\n \"max_weight\": null,\n \"name\": \"SAMEDAY\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"sonic\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"sonic\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": false\n }\n ],\n \"name\": \"sonic\",\n \"human_readable\": \"Sonic\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"speedee\",\n \"max_weight\": null,\n \"name\": \"SpeeDeeDelivery\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"speedee\",\n \"human_readable\": \"Spee-Dee\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"speedx\",\n \"max_weight\": null,\n \"name\": \"DGD\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"speedx\",\n \"max_weight\": null,\n \"name\": \"D2A\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"speedx\",\n \"max_weight\": null,\n \"name\": \"DZS\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"speedx\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"speedx\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"speedx\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"speedx\",\n \"human_readable\": \"SpeedX\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"swyft\",\n \"max_weight\": null,\n \"name\": \"NEXTDAY\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"swyft\",\n \"max_weight\": null,\n \"name\": \"SAMEDAY\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"swyft\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"bill_on_manifest\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"bill_on_scan\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"orders\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"sort_codes\",\n \"description\": null,\n \"supported\": false\n },\n {\n \"carrier\": \"swyft\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": false\n }\n ],\n \"name\": \"swyft\",\n \"human_readable\": \"Swyft\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"tcc\",\n \"max_weight\": null,\n \"name\": \"Smith Drug Same Day\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"tcc\",\n \"human_readable\": \"TCC\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"tforce\",\n \"max_weight\": null,\n \"name\": \"NextDay\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"tforce\",\n \"max_weight\": null,\n \"name\": \"Return\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"tforce\",\n \"human_readable\": \"TForce Logistics\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"toll\",\n \"max_weight\": null,\n \"name\": \"IPEC Direct\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"toll\",\n \"max_weight\": null,\n \"name\": \"IPEC Fashion\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"toll\",\n \"max_weight\": null,\n \"name\": \"IPEC Local\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"toll\",\n \"max_weight\": null,\n \"name\": \"IPEC Priority\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"toll\",\n \"max_weight\": null,\n \"name\": \"IPEC Road Express\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"toll\",\n \"max_weight\": null,\n \"name\": \"IPEC Sensitive\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"toll\",\n \"max_weight\": null,\n \"name\": \"IPEC VicEXP\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"toll\",\n \"human_readable\": \"Toll\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"uds\",\n \"max_weight\": null,\n \"name\": \"DeliveryService\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"uds\",\n \"human_readable\": \"UDS\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"Ground\",\n \"description\": \"1-5 Business Days\",\n \"human_readable\": \"UPS Ground\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"UPSStandard\",\n \"description\": \"1-5 Business Days\",\n \"human_readable\": \"UPS Standard\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"UPSSaver\",\n \"description\": \"Next Day to 4 Business Days\",\n \"human_readable\": \"UPS Worldwide Saver\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"Express\",\n \"description\": \"Next Day to 3 Business Days\",\n \"human_readable\": \"UPS Worldwide Express\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"ExpressPlus\",\n \"description\": \"Next Day to 2 Business Days\",\n \"human_readable\": \"UPS Worldwide Express Plus\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"Expedited\",\n \"description\": \"3 to 5 Business Days\",\n \"human_readable\": \"UPS Worldwide Expedited\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"NextDayAir\",\n \"description\": \"Next Business Day by 10:30am\",\n \"human_readable\": \"UPS Next Day Air\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"NextDayAirSaver\",\n \"description\": \"Next Business Day by 3:00pm\",\n \"human_readable\": \"UPS Next Day Air Saver\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"NextDayAirEarlyAM\",\n \"description\": \"Next Business Days by 8:00am\",\n \"human_readable\": \"UPS Next Day Air A.M.\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"2ndDayAir\",\n \"description\": \"2 Business Days by end of day\",\n \"human_readable\": \"UPS 2nd Day Air\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"2ndDayAirAM\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": null\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"3DaySelect\",\n \"description\": \"3 Business Days by end of day\",\n \"human_readable\": \"UPS 3-Day Select\",\n \"dimensions\": null\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"ups\",\n \"max_weight\": 16.0,\n \"name\": \"UPSLetter\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.5in - 15in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": 480.0,\n \"name\": \"UPSExpressBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.5in x 3.75in x 18in\"\n ]\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": 880.0,\n \"name\": \"UPS25kgBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"19.75in x 17.75in x 13.25in\"\n ]\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": 352.0,\n \"name\": \"UPS10kgBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"16.5in x 13.25in x 10.75in\"\n ]\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"Tube\",\n \"description\": \"Triangular tube for rolled papers\",\n \"human_readable\": null,\n \"dimensions\": [\n \"38in x 6in x 6in\"\n ]\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": null,\n \"name\": \"Pak\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"16in x 12.75in\"\n ]\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": 480.0,\n \"name\": \"SmallExpressBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"13in x 11in x 2in\"\n ]\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": 480.0,\n \"name\": \"MediumExpressBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"16in x 11in x 3in\"\n ]\n },\n {\n \"carrier\": \"ups\",\n \"max_weight\": 480.0,\n \"name\": \"LargeExpressBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"18in x 13in x 3in\"\n ]\n }\n ],\n \"supported_features\": [],\n \"name\": \"ups\",\n \"human_readable\": \"UPS\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"upsiparcel\",\n \"human_readable\": \"UPS iParcel\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"BPMFlats\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"BPMParcels\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"EconomyMailInnovations\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"ExpeditedMailInnovations\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"First\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"MarketingParcels\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"MediaMail\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"ParcelSelect\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"ParcelSelectLightweight-Irreg\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"Priority\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"PriorityMailInnovations\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"SingleReturns\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"upsmailinnovations\",\n \"max_weight\": null,\n \"name\": \"StandardFlats\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"upsmailinnovations\",\n \"human_readable\": \"UPS Mail Innovations\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"usps\",\n \"max_weight\": 13.0,\n \"name\": \"First\",\n \"description\": \"1-5 business days\",\n \"human_readable\": \"First-Class Mail®\",\n \"dimensions\": [\n \"Cards, Letters and Flats only (no Parcels)\",\n \"See Predefined Packages (Card, Letter, Flat) for details\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"Priority\",\n \"description\": \"1-3 business days\",\n \"human_readable\": \"Priority Mail®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"Express\",\n \"description\": \"1-2 days\",\n \"human_readable\": \"Priority Mail Express®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 70.0,\n \"name\": \"GroundAdvantage\",\n \"description\": \"2-5 days\",\n \"human_readable\": \"USPS Ground Advantage®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 130in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"LibraryMail\",\n \"description\": \"2-8 business days\",\n \"human_readable\": \"Library Mail®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"MediaMail\",\n \"description\": \"2-8 business days\",\n \"human_readable\": \"Media Mail®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 15.994,\n \"name\": \"FirstClassMailInternational\",\n \"description\": null,\n \"human_readable\": \"First-Class Mail International®\",\n \"dimensions\": [\n \"Must be rectangular, otherwise an additional charge may apply.\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 64.0,\n \"name\": \"FirstClassPackageInternationalService\",\n \"description\": \"7-21 days\",\n \"human_readable\": \"First-Class Package International Service®\",\n \"dimensions\": [\n \"Packages (Other Than Rolls): Combined Length and Girth \\u003c 108in\",\n \"Rolls (Tubes): Length: min 4in; max 36 in. Length plus twice the diameter (combined): min 6.75 in; max 42in.\",\n \"Some countries have specific prohibitions and restrictions\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"PriorityMailInternational\",\n \"description\": \"6-10 business days\",\n \"human_readable\": \"Priority Mail International®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"ExpressMailInternational\",\n \"description\": \"3-5 business days\",\n \"human_readable\": \"Priority Mail Express International®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"Card\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"6in x 4.5in x 0.016in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"Letter\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"11.5in x 6.125in x 0.25in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"Flat\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"11.5in x 6.125in x 0.75in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRateEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.5in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRateLegalEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"15in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRatePaddedEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.5in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRateWindowEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"10in x 5in\",\n \"12.5in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRateCardboardEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.5in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"SmallFlatRateEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"10in x 6in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"Parcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"Varies based on service level\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 320.0,\n \"name\": \"SoftPack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"Varies based on service level\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"SmallFlatRateBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"8.6875in x 5.4375in x 1.75in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"MediumFlatRateBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"11.25in x 8.75in x 6in\",\n \"14.125in x 12in x 3.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"LargeFlatRateBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.25in x 12in x 6in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"LargeFlatRateBoxAPOFPO\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.25in x 12.25in x 6in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatTubTrayBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"EMMTrayBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FullTrayBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"HalfTrayBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"PMODSack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"supported_features\": [\n {\n \"carrier\": \"usps\",\n \"name\": \"bill_on_delivery\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"bill_on_label_purchase\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"commercial_invoices\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"delivers_to_po_box\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"refunds\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"returns\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"scanforms\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"usps\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"usps\",\n \"human_readable\": \"USPS\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [\n {\n \"carrier\": \"veho\",\n \"max_weight\": 800.0,\n \"name\": \"nextDay\",\n \"description\": null,\n \"human_readable\": \"Next Day\",\n \"dimensions\": null\n },\n {\n \"carrier\": \"veho\",\n \"max_weight\": 800.0,\n \"name\": \"sameDay\",\n \"description\": null,\n \"human_readable\": \"Same Day\",\n \"dimensions\": null\n }\n ],\n \"predefined_packages\": [],\n \"supported_features\": [\n {\n \"carrier\": \"veho\",\n \"name\": \"labels\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"veho\",\n \"name\": \"pickups\",\n \"description\": null,\n \"supported\": null\n },\n {\n \"carrier\": \"veho\",\n \"name\": \"rating\",\n \"description\": null,\n \"supported\": true\n },\n {\n \"carrier\": \"veho\",\n \"name\": \"test_environment\",\n \"description\": null,\n \"supported\": null\n }\n ],\n \"name\": \"veho\",\n \"human_readable\": \"Veho\"\n },\n {\n \"shipment_options\": [],\n \"service_levels\": [],\n \"predefined_packages\": [],\n \"supported_features\": [],\n \"name\": \"yanwen\",\n \"human_readable\": \"Yanwen\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "165173" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76d6e786bc390035a822" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.093402" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/metadata/carriers" + }, + "duration": 300 + } +] \ No newline at end of file diff --git a/src/test/cassettes/carrier_metadata/retrieve_carrier_metadata_with_filter.json b/src/test/cassettes/carrier_metadata/retrieve_carrier_metadata_with_filter.json new file mode 100644 index 000000000..2c1e6b5ac --- /dev/null +++ b/src/test/cassettes/carrier_metadata/retrieve_carrier_metadata_with_filter.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823830, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/metadata/carriers?types\u003dservice_levels%2Cpredefined_packages\u0026carriers\u003dusps?%74%79%70%65%73\u003d%73%65%72%76%69%63%65%5F%6C%65%76%65%6C%73%2C%70%72%65%64%65%66%69%6E%65%64%5F%70%61%63%6B%61%67%65%73\u0026%63%61%72%72%69%65%72%73\u003d%75%73%70%73" + }, + "response": { + "body": "{\n \"carriers\": [\n {\n \"service_levels\": [\n {\n \"carrier\": \"usps\",\n \"max_weight\": 13.0,\n \"name\": \"First\",\n \"description\": \"1-5 business days\",\n \"human_readable\": \"First-Class Mail®\",\n \"dimensions\": [\n \"Cards, Letters and Flats only (no Parcels)\",\n \"See Predefined Packages (Card, Letter, Flat) for details\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"Priority\",\n \"description\": \"1-3 business days\",\n \"human_readable\": \"Priority Mail®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"Express\",\n \"description\": \"1-2 days\",\n \"human_readable\": \"Priority Mail Express®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 70.0,\n \"name\": \"GroundAdvantage\",\n \"description\": \"2-5 days\",\n \"human_readable\": \"USPS Ground Advantage®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 130in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"LibraryMail\",\n \"description\": \"2-8 business days\",\n \"human_readable\": \"Library Mail®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"MediaMail\",\n \"description\": \"2-8 business days\",\n \"human_readable\": \"Media Mail®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 15.994,\n \"name\": \"FirstClassMailInternational\",\n \"description\": null,\n \"human_readable\": \"First-Class Mail International®\",\n \"dimensions\": [\n \"Must be rectangular, otherwise an additional charge may apply.\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 64.0,\n \"name\": \"FirstClassPackageInternationalService\",\n \"description\": \"7-21 days\",\n \"human_readable\": \"First-Class Package International Service®\",\n \"dimensions\": [\n \"Packages (Other Than Rolls): Combined Length and Girth \\u003c 108in\",\n \"Rolls (Tubes): Length: min 4in; max 36 in. Length plus twice the diameter (combined): min 6.75 in; max 42in.\",\n \"Some countries have specific prohibitions and restrictions\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"PriorityMailInternational\",\n \"description\": \"6-10 business days\",\n \"human_readable\": \"Priority Mail International®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 1120.0,\n \"name\": \"ExpressMailInternational\",\n \"description\": \"3-5 business days\",\n \"human_readable\": \"Priority Mail Express International®\",\n \"dimensions\": [\n \"Combined Length and Girth \\u003c 108in\"\n ]\n }\n ],\n \"predefined_packages\": [\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"Card\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"6in x 4.5in x 0.016in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"Letter\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"11.5in x 6.125in x 0.25in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"Flat\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"11.5in x 6.125in x 0.75in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRateEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.5in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRateLegalEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"15in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRatePaddedEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.5in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRateWindowEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"10in x 5in\",\n \"12.5in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatRateCardboardEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.5in x 9.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"SmallFlatRateEnvelope\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"10in x 6in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"Parcel\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"Varies based on service level\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": 320.0,\n \"name\": \"SoftPack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"Varies based on service level\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"SmallFlatRateBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"8.6875in x 5.4375in x 1.75in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"MediumFlatRateBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"11.25in x 8.75in x 6in\",\n \"14.125in x 12in x 3.5in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"LargeFlatRateBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.25in x 12in x 6in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"LargeFlatRateBoxAPOFPO\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": [\n \"12.25in x 12.25in x 6in\"\n ]\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FlatTubTrayBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"EMMTrayBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"FullTrayBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"HalfTrayBox\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n },\n {\n \"carrier\": \"usps\",\n \"max_weight\": null,\n \"name\": \"PMODSack\",\n \"description\": null,\n \"human_readable\": null,\n \"dimensions\": []\n }\n ],\n \"name\": \"usps\",\n \"human_readable\": \"USPS\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "5074" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76d6e786bc3a0035a8a9" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.037446" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/metadata/carriers?types\u003dservice_levels%2Cpredefined_packages\u0026carriers\u003dusps?%74%79%70%65%73\u003d%73%65%72%76%69%63%65%5F%6C%65%76%65%6C%73%2C%70%72%65%64%65%66%69%6E%65%64%5F%70%61%63%6B%61%67%65%73\u0026%63%61%72%72%69%65%72%73\u003d%75%73%70%73" + }, + "duration": 242 + } +] \ No newline at end of file diff --git a/src/test/cassettes/claim/all.json b/src/test/cassettes/claim/all.json new file mode 100644 index 000000000..e0359c012 --- /dev/null +++ b/src/test/cassettes/claim/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1726510947, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/claims?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"claims\": [\n {\n \"insurance_id\": \"ins_5183544879624aada94c467184a830de\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/03dce6ea67c44877962bbe9cfc11cc71.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/9853a78b25f947f686b5a05e5fdc0f7b.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/bb85c6100b2945f58781eae95bea524e.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-08-16T15:58:19Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"cancelled\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"timestamp\": \"2024-08-16T15:58:20Z\"\n },\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-08-16T15:58:19Z\"\n }\n ],\n \"shipment_id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100105807076062921\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-08-16T15:58:20Z\",\n \"id\": \"clm_0981c3c08cbf426ba1b95a28cb767393\",\n \"status_timestamp\": \"2024-08-16T15:58:20Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"cancelled\"\n },\n {\n \"insurance_id\": \"ins_38b44c6fa6b64fefb05b3f8c8d964a62\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/6631f38e703343eb97fe0941e7ad7399.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/d734b9be0a0d4b4681a2206a1de68d63.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/9a1db2c4bdc84e5e9806acd054035c67.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-08-16T15:58:15Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-08-16T15:58:15Z\"\n }\n ],\n \"shipment_id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100105807076062891\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-08-16T15:58:15Z\",\n \"id\": \"clm_098135c03daa47e9848c7a1606ddff5a\",\n \"status_timestamp\": \"2024-08-16T15:58:15Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n },\n {\n \"insurance_id\": \"ins_0ab8a24d79114d0283f1d9a1283f6862\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/5ebae251e9e24f178e96e98556da9fe8.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/9bb5547542a346828d039e1de63cdd93.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/f661380b18964bbc90d0a61aac83c09a.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-08-16T15:58:11Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-08-16T15:58:11Z\"\n }\n ],\n \"shipment_id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100105807076062877\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-08-16T15:58:11Z\",\n \"id\": \"clm_09818d60969248ec92513a3fbf7eaa8d\",\n \"status_timestamp\": \"2024-08-16T15:58:11Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n },\n {\n \"insurance_id\": \"ins_0ac2c47236234589b9bd8f58484fdc59\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/64129940fc5348e299cc308130d440b2.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/ec02e95a82eb42a38b7a16ea1fe1bbe9.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/46b1022cce664a32bbede970bf735bda.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-07-23T21:16:56Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"cancelled\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"timestamp\": \"2024-07-23T21:16:58Z\"\n },\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-07-23T21:16:56Z\"\n }\n ],\n \"shipment_id\": \"shp_2ffabf823a754afdb236fdd933fc126c\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100110368066416763\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-07-23T21:16:57Z\",\n \"id\": \"clm_097e8fdd467f4d0e908e12bb955ce499\",\n \"status_timestamp\": \"2024-07-23T21:16:58Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"cancelled\"\n },\n {\n \"insurance_id\": \"ins_8601c937f7394ac09ec16dc9aec5b390\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/345024219d2f4d1286df783ef0d1433d.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/d8ba1d668d2a4a8a8fb0c0b598bdd066.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/f4c9fd26f1fb4cafbe515ed74138ef1a.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-07-23T21:16:50Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-07-23T21:16:50Z\"\n }\n ],\n \"shipment_id\": \"shp_6d9270111c6840dbb5ea5d7ca26c2807\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100110368066416756\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-07-23T21:16:50Z\",\n \"id\": \"clm_097eca949076417890a081e39b758b97\",\n \"status_timestamp\": \"2024-07-23T21:16:50Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "5854" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1ef66e87763e798c8e300022b57" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb4nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.065320" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/claims?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 489 + } +] \ No newline at end of file diff --git a/src/test/cassettes/claim/cancel.json b/src/test/cassettes/claim/cancel.json new file mode 100644 index 000000000..f97956e62 --- /dev/null +++ b/src/test/cassettes/claim/cancel.json @@ -0,0 +1,358 @@ +[ + { + "recordedAt": 1726510968, + "request": { + "body": "{\n \"shipment\": {\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n ],\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"contents_type\": \"merchandise\"\n },\n \"reference\": \"123\",\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"options\": {\n \"label_format\": \"PNG\",\n \"invoice_number\": \"123\"\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-09-16T18:22:47Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-09-16T18:22:48Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_aca0715c745811ef9bbfac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_aca0715c745811ef9bbfac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-09-16T18:22:47Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-09-16T18:22:47Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:47Z\",\n \"currency\": null,\n \"id\": \"cstitem_5e0990c341b84bdbb5526c38356ca914\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-09-16T18:22:47Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_93477a2dc6e744bf87cf4e247f96c168\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:47Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-09-16T18:22:47Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_c8a90c8e6d13436db016e7edebf39eb5\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-09-16T18:22:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_ac9dcb25745811efa40cac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-09-16T18:22:48Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:48Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9ffb4406aef442639a1b131bb07a3718\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-09-16T18:22:48Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:48Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_732068b92bf24c4da43c2e4ac2254904\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-09-16T18:22:48Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:48Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_337f7693446b4bcfa67bae0176f7ce29\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-09-16T18:22:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_ac9dcb25745811efa40cac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6247" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1f266e87777e798cc1b000243fb" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb3nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.981432" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "location": [ + "/api/v2/shipments/shp_4362c67a6a884753893c3a34b1a3571c" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1426 + }, + { + "recordedAt": 1726510970, + "request": { + "body": "{\n \"insurance\": \"100\",\n \"rate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Sep 16, 2024, 2:22:48 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"currency\": \"USD\",\n \"id\": \"rate_337f7693446b4bcfa67bae0176f7ce29\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Sep 16, 2024, 2:22:48 PM\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_4362c67a6a884753893c3a34b1a3571c/buy" + }, + "response": { + "body": "{\n \"insurance\": \"100.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-09-16T18:22:47Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-09-16T18:22:50Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-09-16T18:22:50Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:50Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_337f7693446b4bcfa67bae0176f7ce29\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-09-16T18:22:50Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"tracking_code\": \"9400100208271089110898\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzI5MGMwMGNhYmE4ZDQwOWZhNTQ4ZTJhOGQ3ZWVmZTEy\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-09-16T18:22:50Z\",\n \"signed_by\": null,\n \"id\": \"trk_290c00caba8d409fa548e2a8d7eefe12\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_aca0715c745811ef9bbfac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_aca0715c745811ef9bbfac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-09-16T18:22:47Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-09-16T18:22:47Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:47Z\",\n \"currency\": null,\n \"id\": \"cstitem_5e0990c341b84bdbb5526c38356ca914\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-09-16T18:22:47Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_93477a2dc6e744bf87cf4e247f96c168\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-09-16T18:22:50Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240916/e85cc734aa9eb742498fd382d377405e5d.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-09-16T18:22:50Z\",\n \"id\": \"pl_43b4f38074144eaebd06bd9ac435a012\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-09-16T18:22:50Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:47Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-09-16T18:22:47Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_c8a90c8e6d13436db016e7edebf39eb5\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-09-16T18:22:47+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-09-16T18:22:49+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_ac9dcb25745811efa40cac1f6bc53342\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-09-16T18:22:48Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:48Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9ffb4406aef442639a1b131bb07a3718\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-09-16T18:22:48Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:48Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_732068b92bf24c4da43c2e4ac2254904\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-09-16T18:22:48Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:48Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_337f7693446b4bcfa67bae0176f7ce29\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-09-16T18:22:47+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-09-16T18:22:49+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_ac9dcb25745811efa40cac1f6bc53342\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208271089110898\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"No rate response received.\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "8466" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1ed66e87779e798cc1e00024644" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb3nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.263074" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_4362c67a6a884753893c3a34b1a3571c/buy" + }, + "duration": 1723 + }, + { + "recordedAt": 1726510972, + "request": { + "body": "{\n \"email_evidence_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"amount\": \"100\",\n \"supporting_documentation_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"description\": \"Test description\",\n \"type\": \"damage\",\n \"invoice_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"tracking_code\": \"9400100208271089110898\",\n \"contact_email\": \"test@example.com\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/claims" + }, + "response": { + "body": "{\n \"insurance_id\": \"ins_a1a6610d55984e19a6d1efeece4d6a30\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/571e6da210b645b7a743bfc73db005f1.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/68108223c4e140b3a4843ab08e4a5d33.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/a1ef3e6b3cd846e393adab40a653ab1b.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-09-16T18:22:51Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-09-16T18:22:51Z\"\n }\n ],\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100208271089110898\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-09-16T18:22:51Z\",\n \"id\": \"clm_0986c11711a24b8bb52f9a25960db8d9\",\n \"status_timestamp\": \"2024-09-16T18:22:51Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1115" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1f266e8777be798cc20000248ec" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb3nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.847564" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/claims" + }, + "duration": 1299 + }, + { + "recordedAt": 1726510973, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/claims/clm_0986c11711a24b8bb52f9a25960db8d9/cancel" + }, + "response": { + "body": "{\n \"insurance_id\": \"ins_a1a6610d55984e19a6d1efeece4d6a30\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/571e6da210b645b7a743bfc73db005f1.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/68108223c4e140b3a4843ab08e4a5d33.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/a1ef3e6b3cd846e393adab40a653ab1b.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-09-16T18:22:51Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"cancelled\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"timestamp\": \"2024-09-16T18:22:53Z\"\n },\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-09-16T18:22:51Z\"\n }\n ],\n \"shipment_id\": \"shp_4362c67a6a884753893c3a34b1a3571c\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100208271089110898\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-09-16T18:22:53Z\",\n \"id\": \"clm_0986c11711a24b8bb52f9a25960db8d9\",\n \"status_timestamp\": \"2024-09-16T18:22:53Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"cancelled\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1240" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1ed66e8777de798cc3800024aa7" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb3nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.050620" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/claims/clm_0986c11711a24b8bb52f9a25960db8d9/cancel" + }, + "duration": 512 + } +] \ No newline at end of file diff --git a/src/test/cassettes/claim/create.json b/src/test/cassettes/claim/create.json new file mode 100644 index 000000000..59fda5df1 --- /dev/null +++ b/src/test/cassettes/claim/create.json @@ -0,0 +1,275 @@ +[ + { + "recordedAt": 1726510961, + "request": { + "body": "{\n \"shipment\": {\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n ],\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"contents_type\": \"merchandise\"\n },\n \"reference\": \"123\",\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"options\": {\n \"label_format\": \"PNG\",\n \"invoice_number\": \"123\"\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-09-16T18:22:38Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-09-16T18:22:38Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:38+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:38+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_a781c2e3745811efae57ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:38+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:38+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_a781c2e3745811efae57ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-09-16T18:22:38Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-09-16T18:22:38Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:38Z\",\n \"currency\": null,\n \"id\": \"cstitem_97ae19bb01844320b539713eae148017\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-09-16T18:22:38Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_2e915d5196c64b0193a7cc82994d07f7\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:38Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-09-16T18:22:38Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_c5256218be5846fa9b8e30e65d6e899b\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-09-16T18:22:38+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:38+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_a77e9139745811efae453cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8f1eae2d923840688305e487209e8e14\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c239e7db23f1419aae604b2fb8389b7d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a5327da85bdd4c9b9f2cbd8bbaf5a06d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_953be39de1b44a259280c39b67bd773c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cbc9225c6b5c43d9bf0fc925fa771945\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ddcd57bb5054402eb9fdc1aeac6189b2\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d86dbbaf52494affa26350d15271b5ae\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7272200141594c2589bd437c6ef06453\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_11dab8fcd65e4af799fd641beeb05d4c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f7c80cc09f354825bce3fa5ee6d6a00c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fa51800224e34b3dbeceb0ea1a449fd7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0ee02782ead74edba10bf58ab4e56c4d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_5ad6d30f785d4abe8fe9fe2b7360ffdb\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_03a0a6e3b84648c2a86ca3f3fdac632f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_55734e265dd64c19b03f31fe90cb55f9\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4922adc304974275b9016bdfbaecff13\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1d89763287854073ad8d3c929a358e8e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9c4944309223491da360786c10cae78e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_87dd8e8fc67f45ba963ac5ff89892afb\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_725e3f9561d54f648f0124105b467ab1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_979e5bdf61de48cda38339815c7a3f13\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0a4766cbfd96455d80cec64e49d9993a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1f2a64dae04e4b61955fc6adb1b9977e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a588dea2f98f4bd1aec28425295ce7ed\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3ca2731e151e4b11b11e7baa4fad8a2e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6cd1b6af0e8442f5a05ad70107e99eeb\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9691732b0f224e3ab228ebd19d9c0bc1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b79182d0716246e5bd49c9be579021b3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e29fdbb467814694817971f4198e1ae8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6ec43b345d484c02967d445327f263c1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_373097da9274451db42eb1bd67add795\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7a9b16e6c084190b176dee89890d131\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f73e2dbd1c7e4a2d856530c7af5d1707\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b77a33072dd2449f91a1a02007c60053\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1bc7d89ce1404a6f8dab931ecdba853b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_5b4e45639fdb42d7be8faae90676b91c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2d47bfb984cd44b29192264aa394ba5b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3b5ffa24908740bd89ace0e0e6f16a0a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1e87aff7d253403d899a712b3a592d74\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_77a6cde04fbc47549e5e39f7c88fb911\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_447a4468dfca4b0781b559240535e570\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ce5a5fa18f08488d837d286fe07908c7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_55b5206e7b1d468292c6a7ca7881511d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d95ba6b441d64348a097f7d9ac8aa83c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0772e6563f714833bd39a48e039986d7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d8abfd4b0bf3418ca51c228b16bbf285\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cf7f4c24339b4626b93266a96eb77d92\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c044432b28ac4ff5af7e35a6f9355340\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3984d4ea5f6d464b85130a4fdcee5f8f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_583cfb16dc954e499a037c7feb5c8be8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c504a98aca1a40b09b43aa263584ed6b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_82d9667bd2aa486e97847649c4c51a2f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3e6d1629eb4248e59b1c3721e41f1a2a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8f51c22bf9a64b389b3d770f7d74fbc8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_85ed36d78e0c40d89be1c60c83e975a1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_746afcfb648b4c7a9d1f68845560541a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_183d6cd0607549e8a598c31a94c27f5f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_211e691d0189429c8a51533b6b66d90e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c31bc618857e44499d15403fe98f5806\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-09-16T18:22:38+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:38+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_a77e9139745811efae453cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "36416" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1f266e8776ee798c905000239da" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb3nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "2.564859" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "location": [ + "/api/v2/shipments/shp_bf1d7c0982ec48eaa4aff50542970ed6" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 3098 + }, + { + "recordedAt": 1726510964, + "request": { + "body": "{\n \"insurance\": \"100\",\n \"rate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Sep 16, 2024, 2:22:40 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"currency\": \"USD\",\n \"id\": \"rate_8f1eae2d923840688305e487209e8e14\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Sep 16, 2024, 2:22:40 PM\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_bf1d7c0982ec48eaa4aff50542970ed6/buy" + }, + "response": { + "body": "{\n \"insurance\": \"100.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-09-16T18:22:38Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-09-16T18:22:43Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-09-16T18:22:43Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:43Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8f1eae2d923840688305e487209e8e14\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-09-16T18:22:43Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"tracking_code\": \"9400100208271089110867\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzk4MTk1MTk3Y2FhOTQzMmJiOGVjMGNmNzA2MTE3NTQ2\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-09-16T18:22:43Z\",\n \"signed_by\": null,\n \"id\": \"trk_98195197caa9432bb8ec0cf706117546\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:38+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:38+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_a781c2e3745811efae57ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:38+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:38+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_a781c2e3745811efae57ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-09-16T18:22:38Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-09-16T18:22:38Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:38Z\",\n \"currency\": null,\n \"id\": \"cstitem_97ae19bb01844320b539713eae148017\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-09-16T18:22:38Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_2e915d5196c64b0193a7cc82994d07f7\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-09-16T18:22:43Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240916/e8728e85a3c82746dab4ae81f82d79951d.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-09-16T18:22:43Z\",\n \"id\": \"pl_5b7995b0828742e8a8dabedf0ea91bc8\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-09-16T18:22:43Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:38Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-09-16T18:22:38Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_c5256218be5846fa9b8e30e65d6e899b\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-09-16T18:22:38+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-09-16T18:22:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_a77e9139745811efae453cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8f1eae2d923840688305e487209e8e14\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c239e7db23f1419aae604b2fb8389b7d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a5327da85bdd4c9b9f2cbd8bbaf5a06d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_953be39de1b44a259280c39b67bd773c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cbc9225c6b5c43d9bf0fc925fa771945\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ddcd57bb5054402eb9fdc1aeac6189b2\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d86dbbaf52494affa26350d15271b5ae\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7272200141594c2589bd437c6ef06453\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_11dab8fcd65e4af799fd641beeb05d4c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f7c80cc09f354825bce3fa5ee6d6a00c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fa51800224e34b3dbeceb0ea1a449fd7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0ee02782ead74edba10bf58ab4e56c4d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_5ad6d30f785d4abe8fe9fe2b7360ffdb\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_03a0a6e3b84648c2a86ca3f3fdac632f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_55734e265dd64c19b03f31fe90cb55f9\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4922adc304974275b9016bdfbaecff13\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1d89763287854073ad8d3c929a358e8e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9c4944309223491da360786c10cae78e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_87dd8e8fc67f45ba963ac5ff89892afb\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_725e3f9561d54f648f0124105b467ab1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_979e5bdf61de48cda38339815c7a3f13\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0a4766cbfd96455d80cec64e49d9993a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1f2a64dae04e4b61955fc6adb1b9977e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a588dea2f98f4bd1aec28425295ce7ed\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3ca2731e151e4b11b11e7baa4fad8a2e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6cd1b6af0e8442f5a05ad70107e99eeb\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9691732b0f224e3ab228ebd19d9c0bc1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b79182d0716246e5bd49c9be579021b3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e29fdbb467814694817971f4198e1ae8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6ec43b345d484c02967d445327f263c1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_373097da9274451db42eb1bd67add795\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7a9b16e6c084190b176dee89890d131\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f73e2dbd1c7e4a2d856530c7af5d1707\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b77a33072dd2449f91a1a02007c60053\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1bc7d89ce1404a6f8dab931ecdba853b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_5b4e45639fdb42d7be8faae90676b91c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2d47bfb984cd44b29192264aa394ba5b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3b5ffa24908740bd89ace0e0e6f16a0a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:40Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1e87aff7d253403d899a712b3a592d74\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_77a6cde04fbc47549e5e39f7c88fb911\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_447a4468dfca4b0781b559240535e570\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ce5a5fa18f08488d837d286fe07908c7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_55b5206e7b1d468292c6a7ca7881511d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d95ba6b441d64348a097f7d9ac8aa83c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0772e6563f714833bd39a48e039986d7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d8abfd4b0bf3418ca51c228b16bbf285\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cf7f4c24339b4626b93266a96eb77d92\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c044432b28ac4ff5af7e35a6f9355340\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3984d4ea5f6d464b85130a4fdcee5f8f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_583cfb16dc954e499a037c7feb5c8be8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c504a98aca1a40b09b43aa263584ed6b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_82d9667bd2aa486e97847649c4c51a2f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3e6d1629eb4248e59b1c3721e41f1a2a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8f51c22bf9a64b389b3d770f7d74fbc8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_85ed36d78e0c40d89be1c60c83e975a1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_746afcfb648b4c7a9d1f68845560541a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_183d6cd0607549e8a598c31a94c27f5f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_211e691d0189429c8a51533b6b66d90e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:41Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:41Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c31bc618857e44499d15403fe98f5806\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-09-16T18:22:38+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-09-16T18:22:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_a77e9139745811efae453cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208271089110867\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "38635" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1ed66e87772e798c90800023e32" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb4nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.497738" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_bf1d7c0982ec48eaa4aff50542970ed6/buy" + }, + "duration": 1945 + }, + { + "recordedAt": 1726510966, + "request": { + "body": "{\n \"email_evidence_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"amount\": \"100\",\n \"supporting_documentation_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"description\": \"Test description\",\n \"type\": \"damage\",\n \"invoice_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"tracking_code\": \"9400100208271089110867\",\n \"contact_email\": \"test@example.com\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/claims" + }, + "response": { + "body": "{\n \"insurance_id\": \"ins_336e9ed7d3f74ed2a28c64cd8ce26fd5\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/419cda2c6ea04661934d4e5c7b6e1e60.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/e046b74666734d5d9214eb422a64d424.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/aebc3729909141ca987b126142ed02e2.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-09-16T18:22:45Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-09-16T18:22:45Z\"\n }\n ],\n \"shipment_id\": \"shp_bf1d7c0982ec48eaa4aff50542970ed6\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100208271089110867\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-09-16T18:22:45Z\",\n \"id\": \"clm_09860377b78840f786da644643a2e28d\",\n \"status_timestamp\": \"2024-09-16T18:22:45Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1115" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-canary": [ + "direct" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1eb66e87775e798cc1900024191" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb4nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.901117" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/claims" + }, + "duration": 1403 + } +] \ No newline at end of file diff --git a/src/test/cassettes/claim/get_next_page.json b/src/test/cassettes/claim/get_next_page.json new file mode 100644 index 000000000..eff2e50f8 --- /dev/null +++ b/src/test/cassettes/claim/get_next_page.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1726510946, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/claims?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"claims\": [\n {\n \"insurance_id\": \"ins_5183544879624aada94c467184a830de\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/03dce6ea67c44877962bbe9cfc11cc71.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/9853a78b25f947f686b5a05e5fdc0f7b.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/bb85c6100b2945f58781eae95bea524e.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-08-16T15:58:19Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"cancelled\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"timestamp\": \"2024-08-16T15:58:20Z\"\n },\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-08-16T15:58:19Z\"\n }\n ],\n \"shipment_id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100105807076062921\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-08-16T15:58:20Z\",\n \"id\": \"clm_0981c3c08cbf426ba1b95a28cb767393\",\n \"status_timestamp\": \"2024-08-16T15:58:20Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"cancelled\"\n },\n {\n \"insurance_id\": \"ins_38b44c6fa6b64fefb05b3f8c8d964a62\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/6631f38e703343eb97fe0941e7ad7399.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/d734b9be0a0d4b4681a2206a1de68d63.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/9a1db2c4bdc84e5e9806acd054035c67.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-08-16T15:58:15Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-08-16T15:58:15Z\"\n }\n ],\n \"shipment_id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100105807076062891\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-08-16T15:58:15Z\",\n \"id\": \"clm_098135c03daa47e9848c7a1606ddff5a\",\n \"status_timestamp\": \"2024-08-16T15:58:15Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n },\n {\n \"insurance_id\": \"ins_0ab8a24d79114d0283f1d9a1283f6862\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/5ebae251e9e24f178e96e98556da9fe8.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/9bb5547542a346828d039e1de63cdd93.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240816/f661380b18964bbc90d0a61aac83c09a.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-08-16T15:58:11Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-08-16T15:58:11Z\"\n }\n ],\n \"shipment_id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100105807076062877\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-08-16T15:58:11Z\",\n \"id\": \"clm_09818d60969248ec92513a3fbf7eaa8d\",\n \"status_timestamp\": \"2024-08-16T15:58:11Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n },\n {\n \"insurance_id\": \"ins_0ac2c47236234589b9bd8f58484fdc59\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/64129940fc5348e299cc308130d440b2.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/ec02e95a82eb42a38b7a16ea1fe1bbe9.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/46b1022cce664a32bbede970bf735bda.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-07-23T21:16:56Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"cancelled\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"timestamp\": \"2024-07-23T21:16:58Z\"\n },\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-07-23T21:16:56Z\"\n }\n ],\n \"shipment_id\": \"shp_2ffabf823a754afdb236fdd933fc126c\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100110368066416763\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-07-23T21:16:57Z\",\n \"id\": \"clm_097e8fdd467f4d0e908e12bb955ce499\",\n \"status_timestamp\": \"2024-07-23T21:16:58Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"cancelled\"\n },\n {\n \"insurance_id\": \"ins_8601c937f7394ac09ec16dc9aec5b390\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/345024219d2f4d1286df783ef0d1433d.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/d8ba1d668d2a4a8a8fb0c0b598bdd066.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/f4c9fd26f1fb4cafbe515ed74138ef1a.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-07-23T21:16:50Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-07-23T21:16:50Z\"\n }\n ],\n \"shipment_id\": \"shp_6d9270111c6840dbb5ea5d7ca26c2807\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100110368066416756\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-07-23T21:16:50Z\",\n \"id\": \"clm_097eca949076417890a081e39b758b97\",\n \"status_timestamp\": \"2024-07-23T21:16:50Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "5854" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-canary": [ + "direct" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1f266e87761e798c8e1000229b2" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb3nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.056874" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/claims?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 942 + }, + { + "recordedAt": 1726510946, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/claims?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%63%6C%6D%5F%30%39%37%65%63%61%39%34%39%30%37%36%34%31%37%38%39%30%61%30%38%31%65%33%39%62%37%35%38%62%39%37" + }, + "response": { + "body": "{\n \"claims\": [\n {\n \"insurance_id\": \"ins_fd87478c4ff2447fa678853fa6aebaff\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/75c2be22b8e7413cbf45c2259da506cd.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/90554c79fbdb47d18653644e3fc2732f.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/3743b283d3e84ab2b1959798d647421a.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-07-23T21:16:44Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-07-23T21:16:44Z\"\n }\n ],\n \"shipment_id\": \"shp_a2950885f2f34a4fb453b95b4390acb9\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100110368066416749\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-07-23T21:16:44Z\",\n \"id\": \"clm_097e1f7b5af5443d8ae2d16c00b47584\",\n \"status_timestamp\": \"2024-07-23T21:16:44Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n },\n {\n \"insurance_id\": \"ins_3b89d3d6211647cc9a134f0cecc90905\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/e098fe2fd81644a19b2b709899814443.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/8a5fbc43bc8d4bd48cc011605646cfc1.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/8e77038b7b084305a0d8918e6651b492.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-07-23T21:14:47Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"cancelled\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"timestamp\": \"2024-07-23T21:14:49Z\"\n },\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-07-23T21:14:47Z\"\n }\n ],\n \"shipment_id\": \"shp_5f4859079b0446409ebaf7feb0fefbc2\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100110368066416374\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim cancellation was requested.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-07-23T21:14:48Z\",\n \"id\": \"clm_097e1ddd8aa54840ad8298f5885b70c8\",\n \"status_timestamp\": \"2024-07-23T21:14:49Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"cancelled\"\n },\n {\n \"insurance_id\": \"ins_22e4bf754387428ab7a4fa911d74dd43\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/dc99a33c1939492999f2c49079090301.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/4efbc5873e1d43dab8764c46e762508f.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/412b08fc5eb746cdaa3f0bb7707b38cc.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-07-23T21:08:19Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-07-23T21:08:19Z\"\n }\n ],\n \"shipment_id\": \"shp_220c769f287b4a3f9f275f20630c5f2d\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100110368066415445\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-07-23T21:08:19Z\",\n \"id\": \"clm_097e6e5e6f404fb4b7bca2b5be34ec76\",\n \"status_timestamp\": \"2024-07-23T21:08:19Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n },\n {\n \"insurance_id\": \"ins_9a6a479680bd4cfe9539338a70510693\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/a043595d2c534a7ea6271b757d5904c8.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/b37723b6eea04b3889e933367bff8cb2.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240723/f7f20ecca7bd436c9befaa35518af9fb.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-07-23T20:47:28Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-07-23T20:47:28Z\"\n }\n ],\n \"shipment_id\": \"shp_48dc72e60c9b42029263b4ddef062d2f\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100110368066411584\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-07-23T20:47:28Z\",\n \"id\": \"clm_097e5b5bb5d2473b938b1659498bf9bf\",\n \"status_timestamp\": \"2024-07-23T20:47:28Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n }\n ],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "4615" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1ed66e87762e798c8e200022a94" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb4nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.055299" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/claims?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%63%6C%6D%5F%30%39%37%65%63%61%39%34%39%30%37%36%34%31%37%38%39%30%61%30%38%31%65%33%39%62%37%35%38%62%39%37" + }, + "duration": 476 + } +] \ No newline at end of file diff --git a/src/test/cassettes/claim/retrieve.json b/src/test/cassettes/claim/retrieve.json new file mode 100644 index 000000000..9910ab3d2 --- /dev/null +++ b/src/test/cassettes/claim/retrieve.json @@ -0,0 +1,364 @@ +[ + { + "recordedAt": 1726510952, + "request": { + "body": "{\n \"shipment\": {\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n ],\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"contents_type\": \"merchandise\"\n },\n \"reference\": \"123\",\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"options\": {\n \"label_format\": \"PNG\",\n \"invoice_number\": \"123\"\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-09-16T18:22:28Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-09-16T18:22:28Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:28+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:28+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_a15036af745811efaa1f3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:28+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:28+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_a15036af745811efaa1f3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-09-16T18:22:28Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-09-16T18:22:28Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:28Z\",\n \"currency\": null,\n \"id\": \"cstitem_b4c7900122ab4a02a404440582f0f268\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-09-16T18:22:28Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_d4db8aa618654e468151da81fada89d3\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:28Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-09-16T18:22:28Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_ac8aa7525ca64ef09b506ab4223908ed\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-09-16T18:22:28+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:28+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_a14c3b48745811efaa1d3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8c0babf96cf4420999d101abd0732011\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6866c5de89d04f41820f47272807aaf6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_26cc5253427b40039116f7e5f69e0138\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0c6ed99986db41099fc4a44c44c7d8ad\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4862e641c67d412d90db0934c2b09ba5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_41be58a1382c48e88e1ceb6a365aea73\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a037405131934341834c2d6f4f58e526\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_add71cb07a81438aa562fbff1e3d3e08\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0f263e38171a4cd38b52a7a0f8c4ae03\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a8a4414b5a274fd3a649d24a6713e743\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e5a469b5103c4df29003fb7803e1adcd\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b69c0d06120e4c37ac5b0690f462d4d5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c6b4b1d574c449a3ac06c9d49d60a614\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6bf2daea74c84f309a34a3a74eeb0bee\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4a0eeb6d7be34b5a81cf468eca457fb8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7e8f41ae208a49e1850adb22ffe6851c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cd56e63fe22b4abf88f145fe8c7d19ae\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bc29a25bb9984a9eba8b9f60f1ac46aa\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_5e83a5bc54db43379b25d2e9f3cf478a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8bd6d1b733b647eea5ed68f4a8429e2d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4efb498b23bf4f97b0ecca03878fe0c4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_75e6908b4585424da0cbd122e6e308aa\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_624342bf294a4e249f433695fc8800c9\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a822ab0065b142fdaf9fcf00e46e8a8a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f37cc99e8b384edc9eef09c5a4a43a8d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_48c2672957174a11a9cc511d197df722\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_23547a992a52452d99baf0a45b41e531\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2b99fd8b8eea4990b9191c3b383ef664\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e355d24cb0bd44829d10211da0dc10ec\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4ccb5b8e206f4891976b82e51070e7ae\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bb70b311f59144cfbd6522c8197ab8c5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7c97ace84b7c4ab8998057723791a87d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_39fb77a63125457f8fa7f37138499246\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ef5d7e0dd35b4b8ba8bf23203a686df6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c1873f1854a04f17973fde2ae1cc825a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8778f1afed3c45c09b26b77887eec97c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bbd27e7068854a66a5aad06a186380a1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_66bb7ab0ab6a427b9ab83f77e3dbb153\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_02901ce19e2a4be2bc455dcc2db6de44\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1af93a662ca64b85b0b7c58b69d411bd\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f12c3e543af4480ab65b0f727ac34ee6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_87f5b3d39e2d499b90dccb2830d7d386\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f40d5f7968804796807177892daa9c5c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_564ff1ff28cb4012ae3c86405a6be2a2\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4625b0d45abb408785e1fce8a2327f26\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_71508da1273b44159492c1aaff047857\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_844251f9b3e04908936c84247fc4a362\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c0f252a8ce894a57911121ef0c0784ab\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e523fb405894457ba5ee4ecbf218e5f6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b176435067204b819438dd25b0cd5666\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_22fe86bbb0ba4919937e0e823672dcb8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_594050968fd54213b1a2710f3cda25d8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6214d1bf39074404979b508c37520e99\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2cab67470b2043058f82dc890ac9510a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_30dc2f13c02b49579938e89485801c80\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_274d4634d8c34ef49d933e95f240efda\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ab0c1c5d8e324be1afde89ced5a2c08e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9963f3f7e8b3419db1fe0bf3535e1572\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_69a2a241b01d4e52afc0f4555ef8e3bf\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-09-16T18:22:28+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:28+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_a14c3b48745811efaa1d3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "36416" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-canary": [ + "direct" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1f266e87764e798c8e500022ca1" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb4nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "3.930510" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "location": [ + "/api/v2/shipments/shp_34c2783bebf14fa6ab9c4a0159d06a14" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 4370 + }, + { + "recordedAt": 1726510955, + "request": { + "body": "{\n \"insurance\": \"100\",\n \"rate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Sep 16, 2024, 2:22:31 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"currency\": \"USD\",\n \"id\": \"rate_26cc5253427b40039116f7e5f69e0138\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Sep 16, 2024, 2:22:31 PM\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_34c2783bebf14fa6ab9c4a0159d06a14/buy" + }, + "response": { + "body": "{\n \"insurance\": \"100.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-09-16T18:22:28Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-09-16T18:22:34Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-09-16T18:22:34Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:34Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_26cc5253427b40039116f7e5f69e0138\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-09-16T18:22:34Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"tracking_code\": \"9400100208271089110836\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2U5NDVjMzJmYmFiMTRjN2ZiODIzMTI1ZmEyZDA5Mjkz\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-09-16T18:22:34Z\",\n \"signed_by\": null,\n \"id\": \"trk_e945c32fbab14c7fb823125fa2d09293\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:28+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:28+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_a15036af745811efaa1f3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-09-16T18:22:28+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-09-16T18:22:28+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_a15036af745811efaa1f3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-09-16T18:22:28Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-09-16T18:22:28Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:28Z\",\n \"currency\": null,\n \"id\": \"cstitem_b4c7900122ab4a02a404440582f0f268\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-09-16T18:22:28Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_d4db8aa618654e468151da81fada89d3\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-09-16T18:22:34Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240916/e89c6f47a47bf547f48683e6ee11e08f43.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-09-16T18:22:34Z\",\n \"id\": \"pl_e16886121d694ff5b0c98edb7626a05d\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-09-16T18:22:33Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-09-16T18:22:28Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-09-16T18:22:28Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_ac8aa7525ca64ef09b506ab4223908ed\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-09-16T18:22:28+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-09-16T18:22:33+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_a14c3b48745811efaa1d3cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8c0babf96cf4420999d101abd0732011\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6866c5de89d04f41820f47272807aaf6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_26cc5253427b40039116f7e5f69e0138\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0c6ed99986db41099fc4a44c44c7d8ad\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4862e641c67d412d90db0934c2b09ba5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_41be58a1382c48e88e1ceb6a365aea73\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a037405131934341834c2d6f4f58e526\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_add71cb07a81438aa562fbff1e3d3e08\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0f263e38171a4cd38b52a7a0f8c4ae03\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a8a4414b5a274fd3a649d24a6713e743\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e5a469b5103c4df29003fb7803e1adcd\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b69c0d06120e4c37ac5b0690f462d4d5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c6b4b1d574c449a3ac06c9d49d60a614\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6bf2daea74c84f309a34a3a74eeb0bee\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4a0eeb6d7be34b5a81cf468eca457fb8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7e8f41ae208a49e1850adb22ffe6851c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cd56e63fe22b4abf88f145fe8c7d19ae\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bc29a25bb9984a9eba8b9f60f1ac46aa\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_5e83a5bc54db43379b25d2e9f3cf478a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8bd6d1b733b647eea5ed68f4a8429e2d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4efb498b23bf4f97b0ecca03878fe0c4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_75e6908b4585424da0cbd122e6e308aa\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_624342bf294a4e249f433695fc8800c9\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a822ab0065b142fdaf9fcf00e46e8a8a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f37cc99e8b384edc9eef09c5a4a43a8d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_48c2672957174a11a9cc511d197df722\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_23547a992a52452d99baf0a45b41e531\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2b99fd8b8eea4990b9191c3b383ef664\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e355d24cb0bd44829d10211da0dc10ec\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4ccb5b8e206f4891976b82e51070e7ae\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bb70b311f59144cfbd6522c8197ab8c5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7c97ace84b7c4ab8998057723791a87d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_39fb77a63125457f8fa7f37138499246\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ef5d7e0dd35b4b8ba8bf23203a686df6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c1873f1854a04f17973fde2ae1cc825a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8778f1afed3c45c09b26b77887eec97c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bbd27e7068854a66a5aad06a186380a1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_66bb7ab0ab6a427b9ab83f77e3dbb153\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_02901ce19e2a4be2bc455dcc2db6de44\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1af93a662ca64b85b0b7c58b69d411bd\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f12c3e543af4480ab65b0f727ac34ee6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:31Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:31Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_87f5b3d39e2d499b90dccb2830d7d386\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f40d5f7968804796807177892daa9c5c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_564ff1ff28cb4012ae3c86405a6be2a2\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4625b0d45abb408785e1fce8a2327f26\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_71508da1273b44159492c1aaff047857\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_844251f9b3e04908936c84247fc4a362\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c0f252a8ce894a57911121ef0c0784ab\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e523fb405894457ba5ee4ecbf218e5f6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b176435067204b819438dd25b0cd5666\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_22fe86bbb0ba4919937e0e823672dcb8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_594050968fd54213b1a2710f3cda25d8\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"101.32\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"88.31\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"88.31\",\n \"service\": \"NextDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6214d1bf39074404979b508c37520e99\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"136.04\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T08:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"123.03\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"123.03\",\n \"service\": \"NextDayAirEarlyAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2cab67470b2043058f82dc890ac9510a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"92.60\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-17T23:00:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"83.12\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"83.12\",\n \"service\": \"NextDayAirSaver\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_30dc2f13c02b49579938e89485801c80\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"31.57\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"29.39\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"29.39\",\n \"service\": \"2ndDayAir\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_274d4634d8c34ef49d933e95f240efda\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"35.54\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T10:30:00Z\",\n \"delivery_date_guaranteed\": true,\n \"retail_rate\": \"33.28\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"33.28\",\n \"service\": \"2ndDayAirAM\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ab0c1c5d8e324be1afde89ced5a2c08e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"24.89\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-19T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.41\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"22.41\",\n \"service\": \"3DaySelect\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9963f3f7e8b3419db1fe0bf3535e1572\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"list_rate\": \"15.95\",\n \"created_at\": \"2024-09-16T18:22:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"mode\": \"test\",\n \"carrier\": \"UPS\",\n \"delivery_date\": \"2024-09-18T23:00:00Z\",\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"14.88\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-09-16T18:22:32Z\",\n \"rate\": \"14.88\",\n \"service\": \"Ground\",\n \"billing_type\": \"carrier\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_69a2a241b01d4e52afc0f4555ef8e3bf\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-09-16T18:22:28+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-09-16T18:22:33+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_a14c3b48745811efaa1d3cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208271089110836\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "38635" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1ee66e87769e798c8ff0002334d" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb4nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.309036" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_34c2783bebf14fa6ab9c4a0159d06a14/buy" + }, + "duration": 1742 + }, + { + "recordedAt": 1726510957, + "request": { + "body": "{\n \"email_evidence_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"amount\": \"100\",\n \"supporting_documentation_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"description\": \"Test description\",\n \"type\": \"damage\",\n \"invoice_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"tracking_code\": \"9400100208271089110836\",\n \"contact_email\": \"test@example.com\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/claims" + }, + "response": { + "body": "{\n \"insurance_id\": \"ins_81446db3fd65481ca00359231b9e098b\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/4564855b7b5148f7bf79b1e4d4ecdc30.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/8d4b0e7f3e8e461db2fbb7d3f79dfdb0.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/d8ae14f22b4f4a3b829f99701f603f2e.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-09-16T18:22:36Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-09-16T18:22:36Z\"\n }\n ],\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100208271089110836\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-09-16T18:22:36Z\",\n \"id\": \"clm_09861cadb8ba4b1f8ff5e1068cbcf96e\",\n \"status_timestamp\": \"2024-09-16T18:22:36Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1115" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1f266e8776be798c9020002369e" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb3nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.889064" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/claims" + }, + "duration": 1449 + }, + { + "recordedAt": 1726510957, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/claims/clm_09861cadb8ba4b1f8ff5e1068cbcf96e" + }, + "response": { + "body": "{\n \"insurance_id\": \"ins_81446db3fd65481ca00359231b9e098b\",\n \"attachments\": [\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/4564855b7b5148f7bf79b1e4d4ecdc30.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/8d4b0e7f3e8e461db2fbb7d3f79dfdb0.png\",\n \"https://easypost-files.s3-us-west-2.amazonaws.com/insurance/20240916/d8ae14f22b4f4a3b829f99701f603f2e.png\"\n ],\n \"check_delivery_address\": null,\n \"created_at\": \"2024-09-16T18:22:36Z\",\n \"description\": \"Test description\",\n \"history\": [\n {\n \"status\": \"submitted\",\n \"status_detail\": \"Claim was created.\",\n \"timestamp\": \"2024-09-16T18:22:36Z\"\n }\n ],\n \"shipment_id\": \"shp_34c2783bebf14fa6ab9c4a0159d06a14\",\n \"type\": \"damage\",\n \"tracking_code\": \"9400100208271089110836\",\n \"requested_amount\": \"100.00\",\n \"contact_email\": \"test@example.com\",\n \"status_detail\": \"Claim was created.\",\n \"mode\": \"test\",\n \"insurance_amount\": \"100.00\",\n \"updated_at\": \"2024-09-16T18:22:36Z\",\n \"id\": \"clm_09861cadb8ba4b1f8ff5e1068cbcf96e\",\n \"status_timestamp\": \"2024-09-16T18:22:36Z\",\n \"recipient_name\": null,\n \"approved_amount\": null,\n \"payment_method\": \"easypost_wallet\",\n \"object\": \"Claim\",\n \"salvage_value\": null,\n \"status\": \"submitted\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1115" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-backend": [ + "easypost" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-download-options": [ + "noopen" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "pragma": [ + "no-cache" + ], + "x-canary": [ + "direct" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-ep-request-uuid": [ + "4b98d1f066e8776de798c9030002387c" + ], + "x-proxied": [ + "extlb1nuq b6e1b5034c", + "intlb4nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.040661" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202409132001-2fb47e50de-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/claims/clm_09861cadb8ba4b1f8ff5e1068cbcf96e" + }, + "duration": 490 + } +] \ No newline at end of file diff --git a/src/test/cassettes/customer_portal/create_account_link.json b/src/test/cassettes/customer_portal/create_account_link.json new file mode 100644 index 000000000..9faf3b805 --- /dev/null +++ b/src/test/cassettes/customer_portal/create_account_link.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1763493497, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/children?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"children\": [\n {\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"test user\",\n \"verified\": true,\n \"created_at\": \"2023-12-07T17:46:08Z\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\",\n \"object\": \"User\"\n }\n ],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "245" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "57503b0a691cc678e2b9fe92014348ca" + ], + "x-proxied": [ + "intlb3nuq c0061e0a2e", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.086392" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202511181852-613eda4497-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/children?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 198 + }, + { + "recordedAt": 1763493497, + "request": { + "body": "{\n \"user_id\": \"user_af930e9bd27a4445bc2741fac37850cc\",\n \"return_url\": \"https://example.com/return\",\n \"session_type\": \"account_onboarding\",\n \"refresh_url\": \"https://example.com/refresh\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/customer_portal/account_link" + }, + "response": { + "body": "{\n \"expires_at\": \"2025-11-18T19:23:17Z\",\n \"link\": \"https://app.easypost.com/customer-portal/onboarding?session_id\\u003dZL1UeM2clfGFTa1a\",\n \"created_at\": \"2025-11-18T19:18:17Z\",\n \"object\": \"CustomerPortalAccountLink\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "199" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb56nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "57503b0e691cc679e2b9fe940143492f" + ], + "x-proxied": [ + "intlb6nuq c0061e0a2e", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.184415" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202511181852-613eda4497-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/customer_portal/account_link" + }, + "duration": 297 + } +] \ No newline at end of file diff --git a/src/test/cassettes/customs_info/create.json b/src/test/cassettes/customs_info/create.json new file mode 100644 index 000000000..8016052db --- /dev/null +++ b/src/test/cassettes/customs_info/create.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823821, + "request": { + "body": "{\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n ],\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"contents_type\": \"merchandise\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/customs_infos" + }, + "response": { + "body": "{\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:57:01Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:57:01Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:01Z\",\n \"currency\": null,\n \"id\": \"cstitem_fc01b80db632492ead7a64af105d1342\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:57:01Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_686267a496a24b0dbe2412de9676db4f\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "794" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76cde786b8e500359e32" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.040801" + ], + "location": [ + "/api/v2/customs_infos/cstinfo_686267a496a24b0dbe2412de9676db4f" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/customs_infos" + }, + "duration": 254 + } +] \ No newline at end of file diff --git a/src/test/cassettes/customs_info/retrieve.json b/src/test/cassettes/customs_info/retrieve.json new file mode 100644 index 000000000..74104d514 --- /dev/null +++ b/src/test/cassettes/customs_info/retrieve.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823820, + "request": { + "body": "{\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n ],\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"contents_type\": \"merchandise\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/customs_infos" + }, + "response": { + "body": "{\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:57:00Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:57:00Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:00Z\",\n \"currency\": null,\n \"id\": \"cstitem_c428d9fbaf5d4e85910965e44edd1e39\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:57:00Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_42e835a623b34a31b8e984697801efa5\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "794" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76cce786b8e200359d84" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.049020" + ], + "location": [ + "/api/v2/customs_infos/cstinfo_42e835a623b34a31b8e984697801efa5" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/customs_infos" + }, + "duration": 251 + }, + { + "recordedAt": 1723823820, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/customs_infos/cstinfo_42e835a623b34a31b8e984697801efa5" + }, + "response": { + "body": "{\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:57:00Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:57:00Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:00Z\",\n \"currency\": null,\n \"id\": \"cstitem_c428d9fbaf5d4e85910965e44edd1e39\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:57:00Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_42e835a623b34a31b8e984697801efa5\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "794" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76cce786b8e300359dc5" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.037193" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/customs_infos/cstinfo_42e835a623b34a31b8e984697801efa5" + }, + "duration": 244 + } +] \ No newline at end of file diff --git a/src/test/cassettes/customs_item/create.json b/src/test/cassettes/customs_item/create.json new file mode 100644 index 000000000..d06c52813 --- /dev/null +++ b/src/test/cassettes/customs_item/create.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823857, + "request": { + "body": "{\n \"customs_item\": {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/customs_items" + }, + "response": { + "body": "{\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:57:37Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:37Z\",\n \"currency\": null,\n \"id\": \"cstitem_6d695e24b5534718a90004951cc2526a\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "376" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76f1e786bcc60035c3f7" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.038862" + ], + "location": [ + "/api/v2/customs_items/cstitem_6d695e24b5534718a90004951cc2526a" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/customs_items" + }, + "duration": 249 + } +] \ No newline at end of file diff --git a/src/test/cassettes/customs_item/retrieve.json b/src/test/cassettes/customs_item/retrieve.json new file mode 100644 index 000000000..5c0654d11 --- /dev/null +++ b/src/test/cassettes/customs_item/retrieve.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823857, + "request": { + "body": "{\n \"customs_item\": {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/customs_items" + }, + "response": { + "body": "{\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:57:37Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:37Z\",\n \"currency\": null,\n \"id\": \"cstitem_16ac6b56315c4f2f8fb5c1d9e619ac30\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "376" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76f1e786bcc30035c341" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.033638" + ], + "location": [ + "/api/v2/customs_items/cstitem_16ac6b56315c4f2f8fb5c1d9e619ac30" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/customs_items" + }, + "duration": 235 + }, + { + "recordedAt": 1723823857, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/customs_items/cstitem_16ac6b56315c4f2f8fb5c1d9e619ac30" + }, + "response": { + "body": "{\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:57:37Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:37Z\",\n \"currency\": null,\n \"id\": \"cstitem_16ac6b56315c4f2f8fb5c1d9e619ac30\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "376" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76f1e786bcc40035c372" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.027447" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/customs_items/cstitem_16ac6b56315c4f2f8fb5c1d9e619ac30" + }, + "duration": 225 + } +] \ No newline at end of file diff --git a/src/test/cassettes/easypost_resource/pretty_print.json b/src/test/cassettes/easypost_resource/pretty_print.json new file mode 100644 index 000000000..a7e223441 --- /dev/null +++ b/src/test/cassettes/easypost_resource/pretty_print.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823876, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_4dc23bc25be811efa4cbac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "461" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7704e786c0a40035d69e" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.041979" + ], + "location": [ + "/api/v2/addresses/adr_4dc23bc25be811efa4cbac1f6bc53342" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 262 + } +] \ No newline at end of file diff --git a/src/test/cassettes/easypost_resource/to_string.json b/src/test/cassettes/easypost_resource/to_string.json new file mode 100644 index 000000000..ac0319bd0 --- /dev/null +++ b/src/test/cassettes/easypost_resource/to_string.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823876, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_4d85137b5be811efa4bcac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "461" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7704e786c0a20035d64f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.034839" + ], + "location": [ + "/api/v2/addresses/adr_4d85137b5be811efa4bcac1f6bc53342" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 233 + } +] \ No newline at end of file diff --git a/src/test/cassettes/embeddable/create_session.json b/src/test/cassettes/embeddable/create_session.json new file mode 100644 index 000000000..0f89ce844 --- /dev/null +++ b/src/test/cassettes/embeddable/create_session.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1763493703, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/children?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"children\": [\n {\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"test user\",\n \"verified\": true,\n \"created_at\": \"2023-12-07T17:46:08Z\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\",\n \"object\": \"User\"\n }\n ],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "245" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb58nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "57503b0f691cc747e2ba0b99014471ce" + ], + "x-proxied": [ + "intlb3nuq c0061e0a2e", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.028557" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202511181852-613eda4497-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/children?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 130 + }, + { + "recordedAt": 1763493704, + "request": { + "body": "{\n \"user_id\": \"user_af930e9bd27a4445bc2741fac37850cc\",\n \"origin_host\": \"https://example.com\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/embeddables/session" + }, + "response": { + "body": "{\n \"expires_at\": \"2025-11-18T19:36:44Z\",\n \"session_id\": \"MlFxfifK1l4UDmPr\",\n \"created_at\": \"2025-11-18T19:21:44Z\",\n \"object\": \"EmbeddablesSession\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "135" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "57503b11691cc748e2ba0bb201447214" + ], + "x-proxied": [ + "intlb4nuq c0061e0a2e", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.121527" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202511181852-613eda4497-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/embeddables/session" + }, + "duration": 222 + } +] \ No newline at end of file diff --git a/src/test/cassettes/end_shipper/all.json b/src/test/cassettes/end_shipper/all.json new file mode 100644 index 000000000..33298eeab --- /dev/null +++ b/src/test/cassettes/end_shipper/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823824, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/end_shippers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": true,\n \"end_shippers\": [\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2022-10-20T03:29:02+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2022-10-20T03:29:02+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_8eaae3d51c73441b99e4e4987967b108\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2022-10-20T03:29:03+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2022-10-20T03:29:03+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_7fe9380a871d462faba35c8badfe3af6\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2022-10-20T03:29:03+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2022-10-20T03:29:04+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"NEW NAME\",\n \"company\": \"EASYPOST\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_2d007aa105de4b5e97cbcddf386a29b3\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2022-10-20T03:35:00+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2022-10-20T03:35:00+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_b7ee940fb8f0487fa903360bca8e7237\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2022-10-21T16:20:41+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2022-10-21T16:20:41+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_182c2866d6c644038561f60c5976b1fa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1876" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76cde786b8e600359e71" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "2.570541" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/end_shippers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 2773 + } +] \ No newline at end of file diff --git a/src/test/cassettes/end_shipper/create.json b/src/test/cassettes/end_shipper/create.json new file mode 100644 index 000000000..230468b89 --- /dev/null +++ b/src/test/cassettes/end_shipper/create.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823825, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "response": { + "body": "{\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:05+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:05+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_f26dc448ef1241c1914cf9e4f65b6316\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "365" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76d1e786b9020035a20c" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.052960" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "duration": 269 + } +] \ No newline at end of file diff --git a/src/test/cassettes/end_shipper/retrieve.json b/src/test/cassettes/end_shipper/retrieve.json new file mode 100644 index 000000000..29d449d7b --- /dev/null +++ b/src/test/cassettes/end_shipper/retrieve.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1723823824, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "response": { + "body": "{\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:04+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:04+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_ccff1d1cc9564da59d2b9f1629c45e9f\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "365" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76d0e786b8e80035a156" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.051439" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "duration": 285 + }, + { + "recordedAt": 1723823824, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/end_shippers/es_ccff1d1cc9564da59d2b9f1629c45e9f" + }, + "response": { + "body": "{\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:04+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:04+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_ccff1d1cc9564da59d2b9f1629c45e9f\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "367" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76d0e786b9000035a1a2" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.052289" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/end_shippers/es_ccff1d1cc9564da59d2b9f1629c45e9f" + }, + "duration": 249 + } +] \ No newline at end of file diff --git a/src/test/cassettes/end_shipper/update.json b/src/test/cassettes/end_shipper/update.json new file mode 100644 index 000000000..4ee3fc26a --- /dev/null +++ b/src/test/cassettes/end_shipper/update.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823825, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "response": { + "body": "{\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:05+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:05+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_1f057b69dec2486f83225382aa3347fb\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "365" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76d1e786b9040035a26e" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.061453" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "duration": 267 + }, + { + "recordedAt": 1723823826, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"NEW NAME\",\n \"company\": \"EasyPost\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "PUT", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/end_shippers/es_1f057b69dec2486f83225382aa3347fb" + }, + "response": { + "body": "{\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:05+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:05+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"NEW NAME\",\n \"company\": \"EASYPOST\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_1f057b69dec2486f83225382aa3347fb\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "367" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76d1e786b9060035a2d5" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.057285" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/end_shippers/es_1f057b69dec2486f83225382aa3347fb" + }, + "duration": 254 + } +] \ No newline at end of file diff --git a/src/test/cassettes/error/error.json b/src/test/cassettes/error/error.json new file mode 100644 index 000000000..e1b4fd761 --- /dev/null +++ b/src/test/cassettes/error/error.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823903, + "request": { + "body": "{}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"PARAMETER.REQUIRED\",\n \"message\": \"Missing required parameter.\",\n \"errors\": [\n {\n \"field\": \"shipment\",\n \"message\": \"cannot be blank\"\n }\n ]\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 422 Unprocessable Entity" + ], + "content-length": [ + "139" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf771fe786c1830035f2e9" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.041939" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 422, + "message": "Unprocessable Entity" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 240 + } +] \ No newline at end of file diff --git a/src/test/cassettes/error/error_alternative_format.json b/src/test/cassettes/error/error_alternative_format.json new file mode 100644 index 000000000..6faed463c --- /dev/null +++ b/src/test/cassettes/error/error_alternative_format.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1740505524, + "request": { + "body": "{\n \"email_evidence_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"supporting_documentation_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"description\": \"Test description\",\n \"type\": \"damage\",\n \"invoice_attachments\": [\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8//8/AwAI/AL+4Q7AIAAAAABJRU5ErkJggg\\u003d\\u003d\"\n ],\n \"tracking_code\": \"123\",\n \"contact_email\": \"test@example.com\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/claims" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"NOT_FOUND\",\n \"message\": \"The requested resource could not be found.\",\n \"errors\": [\n \"No eligible insurance found with provided tracking code.\"\n ]\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 404 Not Found" + ], + "content-length": [ + "156" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c1c6fbd367be01b4e2b8558f001d4c8a" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.028904" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502251451-d4f6425809-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 404, + "message": "Not Found" + }, + "uri": "https://api.easypost.com/v2/claims" + }, + "duration": 130 + } +] \ No newline at end of file diff --git a/src/test/cassettes/event/all.json b/src/test/cassettes/event/all.json new file mode 100644 index 000000000..d1e68b1c9 --- /dev/null +++ b/src/test/cassettes/event/all.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823812, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"events\": [\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.updated\",\n \"created_at\": \"2024-08-16T15:56:45.339Z\",\n \"id\": \"evt_233b29c05be811efba9e55034f86de6a\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.created\",\n \"created_at\": \"2024-08-16T15:56:45.244Z\",\n \"id\": \"evt_232cb61a5be811eface937608af8fd6e\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"insurance.cancelled\",\n \"created_at\": \"2024-08-16T15:56:37.713Z\",\n \"id\": \"evt_1eaf8ebe5be811efb9865bebcdda88e0\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "683" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76c4e786b8c000359561" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.190509" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 398 + } +] \ No newline at end of file diff --git a/src/test/cassettes/event/get_next_page.json b/src/test/cassettes/event/get_next_page.json new file mode 100644 index 000000000..37caf651b --- /dev/null +++ b/src/test/cassettes/event/get_next_page.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823811, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"events\": [\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.updated\",\n \"created_at\": \"2024-08-16T15:56:45.339Z\",\n \"id\": \"evt_233b29c05be811efba9e55034f86de6a\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.created\",\n \"created_at\": \"2024-08-16T15:56:45.244Z\",\n \"id\": \"evt_232cb61a5be811eface937608af8fd6e\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"insurance.cancelled\",\n \"created_at\": \"2024-08-16T15:56:37.713Z\",\n \"id\": \"evt_1eaf8ebe5be811efb9865bebcdda88e0\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "683" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf76c3e786b8bf00359509" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.195326" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 407 + } +] \ No newline at end of file diff --git a/src/test/cassettes/event/retrieve.json b/src/test/cassettes/event/retrieve.json new file mode 100644 index 000000000..0139db69c --- /dev/null +++ b/src/test/cassettes/event/retrieve.json @@ -0,0 +1,174 @@ +[ + { + "recordedAt": 1723823812, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"events\": [\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.updated\",\n \"created_at\": \"2024-08-16T15:56:45.339Z\",\n \"id\": \"evt_233b29c05be811efba9e55034f86de6a\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.created\",\n \"created_at\": \"2024-08-16T15:56:45.244Z\",\n \"id\": \"evt_232cb61a5be811eface937608af8fd6e\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"insurance.cancelled\",\n \"created_at\": \"2024-08-16T15:56:37.713Z\",\n \"id\": \"evt_1eaf8ebe5be811efb9865bebcdda88e0\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "683" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76c4e786b8c1003595bd" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.178351" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 376 + }, + { + "recordedAt": 1723823813, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/events/evt_233b29c05be811efba9e55034f86de6a" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:56:45.000Z\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"pending_urls\": [\n \"http://example.com\"\n ],\n \"description\": \"batch.updated\",\n \"previous_attributes\": {\n \"state\": \"creating\"\n },\n \"created_at\": \"2024-08-16T15:56:45.000Z\",\n \"id\": \"evt_233b29c05be811efba9e55034f86de6a\",\n \"completed_urls\": [],\n \"status\": \"pending\",\n \"object\": \"Event\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "356" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76c4e786b8c20035961c" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.036175" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/events/evt_233b29c05be811efba9e55034f86de6a" + }, + "duration": 240 + } +] \ No newline at end of file diff --git a/src/test/cassettes/event/retrieve_all_payloads.json b/src/test/cassettes/event/retrieve_all_payloads.json new file mode 100644 index 000000000..229dc4e07 --- /dev/null +++ b/src/test/cassettes/event/retrieve_all_payloads.json @@ -0,0 +1,441 @@ +[ + { + "recordedAt": 1723823813, + "request": { + "body": "{\n \"webhook\": {\n \"url\": \"http://example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T15:56:53Z\",\n \"id\": \"hook_2807b7a25be811efa6196f8c5aa266cb\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "161" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76c5e786b8c400359684" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.148153" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "duration": 357 + }, + { + "recordedAt": 1723823813, + "request": { + "body": "{\n \"batch\": {\n \"shipments\": [\n {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:56:53Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:56:53Z\",\n \"id\": \"batch_db213479e6a34678b251bbd824d24695\",\n \"state\": \"creating\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "384" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76c5e786b8c6003596f9" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.040819" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "duration": 237 + }, + { + "recordedAt": 1723823819, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"events\": [\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.updated\",\n \"created_at\": \"2024-08-16T15:56:53.991Z\",\n \"id\": \"evt_2863529c5be811efbd9b5d0569f77627\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.created\",\n \"created_at\": \"2024-08-16T15:56:53.910Z\",\n \"id\": \"evt_2856fcea5be811ef81b37faf7729a2d5\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.updated\",\n \"created_at\": \"2024-08-16T15:56:45.339Z\",\n \"id\": \"evt_233b29c05be811efba9e55034f86de6a\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.created\",\n \"created_at\": \"2024-08-16T15:56:45.244Z\",\n \"id\": \"evt_232cb61a5be811eface937608af8fd6e\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"insurance.cancelled\",\n \"created_at\": \"2024-08-16T15:56:37.713Z\",\n \"id\": \"evt_1eaf8ebe5be811efb9865bebcdda88e0\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1115" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76cbe786b8c700359c1f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.245712" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 456 + }, + { + "recordedAt": 1723823819, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/events/evt_2863529c5be811efbd9b5d0569f77627/payloads" + }, + "response": { + "body": "{\n \"payloads\": []\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "15" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76cbe786b8df00359c90" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.049900" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/events/evt_2863529c5be811efbd9b5d0569f77627/payloads" + }, + "duration": 269 + }, + { + "recordedAt": 1723823820, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_2807b7a25be811efa6196f8c5aa266cb" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76cbe786b8e000359ccf" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.386373" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_2807b7a25be811efa6196f8c5aa266cb" + }, + "duration": 588 + } +] \ No newline at end of file diff --git a/src/test/cassettes/event/retrieve_payload.json b/src/test/cassettes/event/retrieve_payload.json new file mode 100644 index 000000000..9b507119b --- /dev/null +++ b/src/test/cassettes/event/retrieve_payload.json @@ -0,0 +1,441 @@ +[ + { + "recordedAt": 1723823804, + "request": { + "body": "{\n \"webhook\": {\n \"url\": \"http://example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T15:56:45Z\",\n \"id\": \"hook_22d73fe65be811ef94c615366a5e7ccc\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "161" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf76bce786b87c00358df6" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.168851" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "duration": 383 + }, + { + "recordedAt": 1723823805, + "request": { + "body": "{\n \"batch\": {\n \"shipments\": [\n {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "response": { + "body": "{\n \"scan_form\": null,\n \"created_at\": \"2024-08-16T15:56:45Z\",\n \"pickup\": null,\n \"shipments\": [],\n \"label_url\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"num_shipments\": 1.0,\n \"updated_at\": \"2024-08-16T15:56:45Z\",\n \"id\": \"batch_6d70fe5330aa4fec838d6b9ff35ad4eb\",\n \"state\": \"creating\",\n \"object\": \"Batch\",\n \"status\": {\n \"postage_purchased\": 0.0,\n \"queued_for_purchase\": 0.0,\n \"created\": 0.0,\n \"postage_purchase_failed\": 0.0,\n \"creation_failed\": 0.0\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "384" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76bde786b87e00358e87" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.042081" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/batches" + }, + "duration": 258 + }, + { + "recordedAt": 1723823810, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"events\": [\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.updated\",\n \"created_at\": \"2024-08-16T15:56:45.339Z\",\n \"id\": \"evt_233b29c05be811efba9e55034f86de6a\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"batch.created\",\n \"created_at\": \"2024-08-16T15:56:45.244Z\",\n \"id\": \"evt_232cb61a5be811eface937608af8fd6e\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n },\n {\n \"mode\": \"test\",\n \"user_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"description\": \"insurance.cancelled\",\n \"created_at\": \"2024-08-16T15:56:37.713Z\",\n \"id\": \"evt_1eaf8ebe5be811efb9865bebcdda88e0\",\n \"status\": \"pending\",\n \"object\": \"Event\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "683" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76c2e786b87f003593b5" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.291126" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/events?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 507 + }, + { + "recordedAt": 1723823811, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/events/evt_233b29c05be811efba9e55034f86de6a/payloads/payload_11111111111111111111111111111111" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"PAYLOAD.NOT_FOUND\",\n \"message\": \"The payload(s) could not be found.\",\n \"errors\": []\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 404 Not Found" + ], + "content-length": [ + "97" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76c2e786b88000359438" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.042287" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 404, + "message": "Not Found" + }, + "uri": "https://api.easypost.com/v2/events/evt_233b29c05be811efba9e55034f86de6a/payloads/payload_11111111111111111111111111111111" + }, + "duration": 256 + }, + { + "recordedAt": 1723823811, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_22d73fe65be811ef94c615366a5e7ccc" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76c3e786b8a100359482" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.319806" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_22d73fe65be811ef94c615366a5e7ccc" + }, + "duration": 526 + } +] \ No newline at end of file diff --git a/src/test/cassettes/hook/create.json b/src/test/cassettes/hook/create.json new file mode 100644 index 000000000..759429cbb --- /dev/null +++ b/src/test/cassettes/hook/create.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823906, + "request": { + "body": "{\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/parcels" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:26Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:26Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_b0b9603c3efc4a2e997b7ce7bcb0ce4a\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "229" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf7722e786c49f0035f737" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.030823" + ], + "location": [ + "/api/v2/parcels/prcl_b0b9603c3efc4a2e997b7ce7bcb0ce4a" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/parcels" + }, + "duration": 234 + } +] \ No newline at end of file diff --git a/src/test/cassettes/hook/http_error.json b/src/test/cassettes/hook/http_error.json new file mode 100644 index 000000000..ca37130da --- /dev/null +++ b/src/test/cassettes/hook/http_error.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823907, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/parcels/par_123" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"NOT_FOUND\",\n \"message\": \"The requested resource could not be found.\",\n \"errors\": [\n {\n \"field\": \"par_123\",\n \"message\": \"not found\"\n }\n ]\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 404 Not Found" + ], + "content-length": [ + "138" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf7723e786c4a20035f7b5" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.027811" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 404, + "message": "Not Found" + }, + "uri": "https://api.easypost.com/v2/parcels/par_123" + }, + "duration": 235 + } +] \ No newline at end of file diff --git a/src/test/cassettes/insurance/all.json b/src/test/cassettes/insurance/all.json new file mode 100644 index 000000000..947ef37d3 --- /dev/null +++ b/src/test/cassettes/insurance/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823799, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/insurances?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"insurances\": [\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-08-16T15:56:36Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_1e09965d5be811ef8e70ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:37Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:56:37Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:56:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:33:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2JhNGE2ODlkNmJkYTRiOWI4YjJiN2I1YTM5ODIyNjBi\",\n \"est_delivery_date\": \"2024-08-16T15:56:37Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:37Z\",\n \"signed_by\": null,\n \"id\": \"trk_ba4a689d6bda4b9b8b2b7b5a3982260b\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"provider_id\": null,\n \"messages\": [\n \"Insurance was cancelled by the user.\"\n ],\n \"id\": \"ins_0c311b3ad5d3440489c2ff8e5b24cc3c\",\n \"from_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_1e0f386b5be811efb9393cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"cancelled\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-24T22:21:52Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-24T22:21:51+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-24T22:21:51+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_205b6acd4a0b11efa1f6ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-24T22:23:34Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:56:37Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:56:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:33:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2JhNGE2ODlkNmJkYTRiOWI4YjJiN2I1YTM5ODIyNjBi\",\n \"est_delivery_date\": \"2024-08-16T15:56:37Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:37Z\",\n \"signed_by\": null,\n \"id\": \"trk_ba4a689d6bda4b9b8b2b7b5a3982260b\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_08671ea4bb7446708ca3dc66dba65b8b\",\n \"from_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-07-24T22:21:52+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-07-24T22:21:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_206020f74a0b11efb5863cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T21:16:54Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T21:16:52+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T21:16:54+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_e1bbefa5493811efbce2ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_2ffabf823a754afdb236fdd933fc126c\",\n \"tracking_code\": \"9400100110368066416763\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T21:16:55Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T11:10:55Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T21:16:55Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T21:19:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:56:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T20:01:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:37:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T00:28:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:08:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:18:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T11:10:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_2ffabf823a754afdb236fdd933fc126c\",\n \"tracking_code\": \"9400100110368066416763\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzNjODUyNTc2ZjMwNTRiNGNhNmFiMDY1ZDgxNmRhNTVk\",\n \"est_delivery_date\": \"2024-07-23T21:19:55Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T21:19:55Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_3c852576f3054b4ca6ab065d816da55d\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_0ac2c47236234589b9bd8f58484fdc59\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T21:16:52+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T21:16:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_e1be9761493811efb577ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T21:16:48Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T21:16:46+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T21:16:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_de510f23493811efac203cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_6d9270111c6840dbb5ea5d7ca26c2807\",\n \"tracking_code\": \"9400100110368066416756\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T21:16:49Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T11:10:49Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T21:16:49Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T21:19:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:56:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T20:01:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:37:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T00:28:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:08:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:18:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T11:10:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_6d9270111c6840dbb5ea5d7ca26c2807\",\n \"tracking_code\": \"9400100110368066416756\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzg4OTMzMjU0M2FjMjQ3M2I4YTk4YTk4NTQ3NzU5NDhj\",\n \"est_delivery_date\": \"2024-07-23T21:19:49Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T21:19:49Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_889332543ac2473b8a98a9854775948c\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_8601c937f7394ac09ec16dc9aec5b390\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T21:16:46+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T21:16:46+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_de52d6e3493811ef80e0ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T21:16:42Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T21:16:40+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T21:16:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_dab7e11e493811efbf7bac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_a2950885f2f34a4fb453b95b4390acb9\",\n \"tracking_code\": \"9400100110368066416749\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T21:16:43Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T11:10:43Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T21:16:43Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T21:19:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:56:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T20:01:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:37:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T00:28:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:08:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:18:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T11:10:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_a2950885f2f34a4fb453b95b4390acb9\",\n \"tracking_code\": \"9400100110368066416749\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzA4OTI5ZGYwYjE5MDRlMjFhZmM0ZGFkYTNkZjVhY2Rk\",\n \"est_delivery_date\": \"2024-07-23T21:19:43Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T21:19:43Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_08929df0b1904e21afc4dada3df5acdd\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_fd87478c4ff2447fa678853fa6aebaff\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T21:16:40+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T21:16:40+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_daba1db0493811efba19ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "22737" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76b7e786b81d003588a7" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.380178" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/insurances?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 644 + } +] \ No newline at end of file diff --git a/src/test/cassettes/insurance/create.json b/src/test/cassettes/insurance/create.json new file mode 100644 index 000000000..f962790bf --- /dev/null +++ b/src/test/cassettes/insurance/create.json @@ -0,0 +1,189 @@ +[ + { + "recordedAt": 1723823803, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:56:42Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:43Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:56:43Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4d58188c8af646e7b68c4e0dbca5fc64\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:56:43Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1fc16624a4e149d0b1ad1ef60f37af87\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:56:43Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_4d58188c8af646e7b68c4e0dbca5fc64\",\n \"tracking_code\": \"9400100105807076062266\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2UyYjgzNjViNDlhYTRmNjBhMzkzNzgwMTY2N2RlYWYx\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:56:43Z\",\n \"signed_by\": null,\n \"id\": \"trk_e2b8365b49aa4f60a3937801667deaf1\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:42+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_21907c4c5be811efbac03cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_4d58188c8af646e7b68c4e0dbca5fc64\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:42+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_21907c4c5be811efbac03cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:56:43Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8a3169cf187b34fe38d85435f34af8627.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:56:43Z\",\n \"id\": \"pl_5121c575031e443899dbd0c373f72a5a\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:56:43Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:56:42Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:56:42Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_fa9c9db8df30470aac64d7a813c3aa50\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:42+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_218df41f5be811ef900dac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:56:42Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4d58188c8af646e7b68c4e0dbca5fc64\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:56:42Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0ea0c4179cca4c5bb3639cd3e3527563\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:56:42Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4d58188c8af646e7b68c4e0dbca5fc64\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:56:42Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_45048020e493471e89287ef347fbf3ef\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:56:42Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4d58188c8af646e7b68c4e0dbca5fc64\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:56:42Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1fc16624a4e149d0b1ad1ef60f37af87\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:42+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_218df41f5be811ef900dac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062266\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76bae786b86100358bc2" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.074192" + ], + "location": [ + "/api/v2/shipments/shp_4d58188c8af646e7b68c4e0dbca5fc64" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1275 + }, + { + "recordedAt": 1723823804, + "request": { + "body": "{\n \"insurance\": {\n \"carrier\": \"USPS\",\n \"amount\": \"100\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"tracking_code\": \"9400100105807076062266\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/insurances" + }, + "response": { + "body": "{\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-08-16T15:56:44Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:44+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_227406095be811ef8cf7ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": null,\n \"tracking_code\": \"9400100105807076062266\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:44Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:56:43Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:56:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:33:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_4d58188c8af646e7b68c4e0dbca5fc64\",\n \"tracking_code\": \"9400100105807076062266\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2UyYjgzNjViNDlhYTRmNjBhMzkzNzgwMTY2N2RlYWYx\",\n \"est_delivery_date\": \"2024-08-16T15:56:43Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:43Z\",\n \"signed_by\": null,\n \"id\": \"trk_e2b8365b49aa4f60a3937801667deaf1\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_a6dd1d4802974ecca75facbfa13d293f\",\n \"from_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:44+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_2279ba605be811ef8b62ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"pending\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "3424" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76bbe786b86300358d48" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.352167" + ], + "location": [ + "/api/v2/insurances/ins_a6dd1d4802974ecca75facbfa13d293f" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/insurances" + }, + "duration": 565 + } +] \ No newline at end of file diff --git a/src/test/cassettes/insurance/get_next_page.json b/src/test/cassettes/insurance/get_next_page.json new file mode 100644 index 000000000..c8426e89e --- /dev/null +++ b/src/test/cassettes/insurance/get_next_page.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1723823798, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/insurances?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"insurances\": [\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-08-16T15:56:36Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_1e09965d5be811ef8e70ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:37Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:56:37Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:56:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:33:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2JhNGE2ODlkNmJkYTRiOWI4YjJiN2I1YTM5ODIyNjBi\",\n \"est_delivery_date\": \"2024-08-16T15:56:37Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:37Z\",\n \"signed_by\": null,\n \"id\": \"trk_ba4a689d6bda4b9b8b2b7b5a3982260b\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"provider_id\": null,\n \"messages\": [\n \"Insurance was cancelled by the user.\"\n ],\n \"id\": \"ins_0c311b3ad5d3440489c2ff8e5b24cc3c\",\n \"from_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_1e0f386b5be811efb9393cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"cancelled\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-24T22:21:52Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-24T22:21:51+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-24T22:21:51+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_205b6acd4a0b11efa1f6ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-24T22:23:34Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:56:37Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:56:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:33:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2JhNGE2ODlkNmJkYTRiOWI4YjJiN2I1YTM5ODIyNjBi\",\n \"est_delivery_date\": \"2024-08-16T15:56:37Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:37Z\",\n \"signed_by\": null,\n \"id\": \"trk_ba4a689d6bda4b9b8b2b7b5a3982260b\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_08671ea4bb7446708ca3dc66dba65b8b\",\n \"from_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-07-24T22:21:52+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-07-24T22:21:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_206020f74a0b11efb5863cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T21:16:54Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T21:16:52+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T21:16:54+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_e1bbefa5493811efbce2ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_2ffabf823a754afdb236fdd933fc126c\",\n \"tracking_code\": \"9400100110368066416763\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T21:16:55Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T11:10:55Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T21:16:55Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T21:19:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:56:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T20:01:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:37:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T00:28:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:08:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:18:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T11:10:55Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_2ffabf823a754afdb236fdd933fc126c\",\n \"tracking_code\": \"9400100110368066416763\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzNjODUyNTc2ZjMwNTRiNGNhNmFiMDY1ZDgxNmRhNTVk\",\n \"est_delivery_date\": \"2024-07-23T21:19:55Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T21:19:55Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_3c852576f3054b4ca6ab065d816da55d\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_0ac2c47236234589b9bd8f58484fdc59\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T21:16:52+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T21:16:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_e1be9761493811efb577ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T21:16:48Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T21:16:46+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T21:16:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_de510f23493811efac203cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_6d9270111c6840dbb5ea5d7ca26c2807\",\n \"tracking_code\": \"9400100110368066416756\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T21:16:49Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T11:10:49Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T21:16:49Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T21:19:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:56:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T20:01:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:37:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T00:28:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:08:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:18:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T11:10:49Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_6d9270111c6840dbb5ea5d7ca26c2807\",\n \"tracking_code\": \"9400100110368066416756\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzg4OTMzMjU0M2FjMjQ3M2I4YTk4YTk4NTQ3NzU5NDhj\",\n \"est_delivery_date\": \"2024-07-23T21:19:49Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T21:19:49Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_889332543ac2473b8a98a9854775948c\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_8601c937f7394ac09ec16dc9aec5b390\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T21:16:46+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T21:16:46+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_de52d6e3493811ef80e0ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T21:16:42Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T21:16:40+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T21:16:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_dab7e11e493811efbf7bac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_a2950885f2f34a4fb453b95b4390acb9\",\n \"tracking_code\": \"9400100110368066416749\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T21:16:43Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T11:10:43Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T21:16:43Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T21:19:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:56:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T20:01:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:37:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T00:28:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:08:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:18:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T11:10:43Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_a2950885f2f34a4fb453b95b4390acb9\",\n \"tracking_code\": \"9400100110368066416749\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzA4OTI5ZGYwYjE5MDRlMjFhZmM0ZGFkYTNkZjVhY2Rk\",\n \"est_delivery_date\": \"2024-07-23T21:19:43Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T21:19:43Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_08929df0b1904e21afc4dada3df5acdd\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_fd87478c4ff2447fa678853fa6aebaff\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T21:16:40+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T21:16:40+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_daba1db0493811efba19ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "22737" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76b5e786b81b00358729" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.425539" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/insurances?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 636 + }, + { + "recordedAt": 1723823799, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/insurances?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%69%6E%73%5F%66%64%38%37%34%37%38%63%34%66%66%32%34%34%37%66%61%36%37%38%38%35%33%66%61%36%61%65%62%61%66%66" + }, + "response": { + "body": "{\n \"insurances\": [\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T20:45:15Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T20:45:13+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T20:45:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_75d6d62d493411efab943cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_4381b08c0e1047ec8dc23d1f17b7cd87\",\n \"tracking_code\": \"9400100110368066410860\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T20:45:16Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T10:39:16Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T20:45:16Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T20:48:16Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:25:16Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T19:30:16Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:06:16Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T23:57:16Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T05:37:16Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T05:47:16Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T10:39:16Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_4381b08c0e1047ec8dc23d1f17b7cd87\",\n \"tracking_code\": \"9400100110368066410860\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2M2YmY2MzM2ODc3OTRhYWY4OTdiNmJkZGJmYzUwNTBl\",\n \"est_delivery_date\": \"2024-07-23T20:48:16Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T20:48:17Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_c6bf633687794aaf897b6bddbfc5050e\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_a62c71d01373434c8a0894f4b4379e2a\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T20:45:13+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T20:45:13+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_75d878ca493411ef8108ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T20:46:18Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T20:46:16+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T20:46:18+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_9b9a9678493411efbbf63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_358fc51660b0401aa2ba94b360404e50\",\n \"tracking_code\": \"9400100110368066411225\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T20:46:19Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T10:40:19Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T20:46:19Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T20:49:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:26:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T19:31:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:07:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T23:58:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T05:38:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T05:48:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T10:40:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_358fc51660b0401aa2ba94b360404e50\",\n \"tracking_code\": \"9400100110368066411225\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzI2NTFlYzI4NGEwYjRhNDY4NjdkYWIzYTUxZDM1ODI4\",\n \"est_delivery_date\": \"2024-07-23T20:49:19Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T20:49:19Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_2651ec284a0b4a46867dab3a51d35828\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_7dd82606c77c46cda3c96f86e57bd9b9\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T20:46:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T20:46:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_9b9d1d41493411ef85fcac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T20:47:26Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T20:47:24+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T20:47:26+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_c428270f493411ef8f513cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_48dc72e60c9b42029263b4ddef062d2f\",\n \"tracking_code\": \"9400100110368066411584\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T20:47:27Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T10:41:28Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T20:47:27Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T20:50:28Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:27:28Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T19:32:28Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:08:28Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T23:59:28Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T05:39:28Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T05:49:28Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T10:41:28Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_48dc72e60c9b42029263b4ddef062d2f\",\n \"tracking_code\": \"9400100110368066411584\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2VjYzk5YzA5ZTRhZTRjM2FhMzU5MmY5NTFhMTY4MDQ3\",\n \"est_delivery_date\": \"2024-07-23T20:50:28Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T20:50:28Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_ecc99c09e4ae4c3aa3592f951a168047\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_9a6a479680bd4cfe9539338a70510693\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T20:47:24+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T20:47:24+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_c429e973493411ef99dcac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T21:08:17Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T21:08:15+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T21:08:17+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_ad9f1092493711efb575ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_220c769f287b4a3f9f275f20630c5f2d\",\n \"tracking_code\": \"9400100110368066415445\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T21:08:18Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T11:02:18Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T21:08:18Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T21:11:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:48:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T19:53:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:29:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T00:20:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:00:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:10:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T11:02:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_220c769f287b4a3f9f275f20630c5f2d\",\n \"tracking_code\": \"9400100110368066415445\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzk5OTNlZjkxMjFiMjQxYmJiNGM0NWVlNDEzMzhjMzVk\",\n \"est_delivery_date\": \"2024-07-23T21:11:18Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T21:11:18Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_9993ef9121b241bbb4c45ee41338c35d\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_22e4bf754387428ab7a4fa911d74dd43\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T21:08:15+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T21:08:15+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_ada1a42e493711ef83bcac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n },\n {\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-07-23T21:14:45Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-23T21:14:43+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-23T21:14:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_94cc88ba493811efa2a2ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": \"shp_5f4859079b0446409ebaf7feb0fefbc2\",\n \"tracking_code\": \"9400100110368066416374\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-07-23T21:14:46Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": \"2024-06-26T11:08:46Z\",\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-23T21:14:46Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-23T21:17:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T09:54:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T19:59:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T21:35:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T00:26:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:06:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T06:16:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Out for Delivery\",\n \"object\": \"TrackingDetail\",\n \"status\": \"out_for_delivery\",\n \"status_detail\": \"out_for_delivery\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-26T11:08:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Delivered\",\n \"object\": \"TrackingDetail\",\n \"status\": \"delivered\",\n \"status_detail\": \"arrived_at_destination\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_5f4859079b0446409ebaf7feb0fefbc2\",\n \"tracking_code\": \"9400100110368066416374\",\n \"status_detail\": \"arrived_at_destination\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2Q4YTI1YTQ2ZDkyNzQ0NGZiOTNlNzg1OTA1ZWJjMDNj\",\n \"est_delivery_date\": \"2024-07-23T21:17:46Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-23T21:17:46Z\",\n \"signed_by\": \"John Tester\",\n \"id\": \"trk_d8a25a46d927444fb93e785905ebc03c\",\n \"object\": \"Tracker\",\n \"status\": \"delivered\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_3b89d3d6211647cc9a134f0cecc90905\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-23T21:14:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-23T21:14:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_94ce6bdf493811ef9cd9ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"purchased\"\n }\n ],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "26568" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf76b6e786b81c003587ea" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.420834" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/insurances?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%69%6E%73%5F%66%64%38%37%34%37%38%63%34%66%66%32%34%34%37%66%61%36%37%38%38%35%33%66%61%36%61%65%62%61%66%66" + }, + "duration": 620 + } +] \ No newline at end of file diff --git a/src/test/cassettes/insurance/refund.json b/src/test/cassettes/insurance/refund.json new file mode 100644 index 000000000..cb494b5d4 --- /dev/null +++ b/src/test/cassettes/insurance/refund.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823797, + "request": { + "body": "{\n \"insurance\": {\n \"carrier\": \"USPS\",\n \"amount\": \"100\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"tracking_code\": \"EZ1000000001\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/insurances" + }, + "response": { + "body": "{\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-08-16T15:56:36Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_1e09965d5be811ef8e70ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:36Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-24T22:21:52Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T22:21:52Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T10:58:52Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2VjNDg5YTg4NWQ3MzRlNDY5MjRiZWZhZDMzMzZkNWY0\",\n \"est_delivery_date\": \"2024-07-24T22:21:52Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-24T22:21:52Z\",\n \"signed_by\": null,\n \"id\": \"trk_ec489a885d734e46924befad3336d5f4\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_0c311b3ad5d3440489c2ff8e5b24cc3c\",\n \"from_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_1e0f386b5be811efb9393cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"pending\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "3370" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76b4e786b819003585ea" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.545189" + ], + "location": [ + "/api/v2/insurances/ins_0c311b3ad5d3440489c2ff8e5b24cc3c" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/insurances" + }, + "duration": 748 + }, + { + "recordedAt": 1723823797, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/insurances/ins_0c311b3ad5d3440489c2ff8e5b24cc3c/refund" + }, + "response": { + "body": "{\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-08-16T15:56:36Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_1e09965d5be811ef8e70ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:37Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:56:37Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:56:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:33:37Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2JhNGE2ODlkNmJkYTRiOWI4YjJiN2I1YTM5ODIyNjBi\",\n \"est_delivery_date\": \"2024-08-16T15:56:37Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:37Z\",\n \"signed_by\": null,\n \"id\": \"trk_ba4a689d6bda4b9b8b2b7b5a3982260b\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"provider_id\": null,\n \"messages\": [\n \"Insurance was cancelled by the user.\"\n ],\n \"id\": \"ins_0c311b3ad5d3440489c2ff8e5b24cc3c\",\n \"from_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_1e0f386b5be811efb9393cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"cancelled\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "3420" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76b5e786b81a0035868b" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.317700" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/insurances/ins_0c311b3ad5d3440489c2ff8e5b24cc3c/refund" + }, + "duration": 530 + } +] \ No newline at end of file diff --git a/src/test/cassettes/insurance/retrieve.json b/src/test/cassettes/insurance/retrieve.json new file mode 100644 index 000000000..d5eb7ab0f --- /dev/null +++ b/src/test/cassettes/insurance/retrieve.json @@ -0,0 +1,272 @@ +[ + { + "recordedAt": 1723823801, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:56:40Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:40Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:56:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_087a4b7c8ce7471391e45ed9d73042fa\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:56:40Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9924da2d05e249f48a07b1b7bd88aff5\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:56:41Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_087a4b7c8ce7471391e45ed9d73042fa\",\n \"tracking_code\": \"9400100105807076062211\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2IxMzBjMzYyZDUxZDQzNWE5MmZjY2U5ZmI0ZDAyMjcy\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:56:41Z\",\n \"signed_by\": null,\n \"id\": \"trk_b130c362d51d435a92fcce9fb4d02272\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:40+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:40+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_201e9a175be811ef8a5fac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_087a4b7c8ce7471391e45ed9d73042fa\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:40+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:40+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_201e9a175be811ef8a5fac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:56:40Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e81927cbe97e104a39869c50e350552b6f.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:56:40Z\",\n \"id\": \"pl_3c8822dcc07f4d6498d474dfe8620a85\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:56:40Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:56:40Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:56:40Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_9a16b1f0b664490fb220b7d588626f25\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:40+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:40+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_201c1dc75be811ef8bd6ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:56:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_087a4b7c8ce7471391e45ed9d73042fa\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:56:40Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6b58872cf2f1458583fe9f6ea2be280b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:56:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_087a4b7c8ce7471391e45ed9d73042fa\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:56:40Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_01d32ed588d2472f88d5b33c0dc8c3bf\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:56:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_087a4b7c8ce7471391e45ed9d73042fa\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:56:40Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9924da2d05e249f48a07b1b7bd88aff5\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:40+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:40+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_201c1dc75be811ef8bd6ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062211\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76b8e786b85c0035896d" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.011530" + ], + "location": [ + "/api/v2/shipments/shp_087a4b7c8ce7471391e45ed9d73042fa" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1214 + }, + { + "recordedAt": 1723823801, + "request": { + "body": "{\n \"insurance\": {\n \"carrier\": \"USPS\",\n \"amount\": \"100\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"tracking_code\": \"9400100105807076062211\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/insurances" + }, + "response": { + "body": "{\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-08-16T15:56:41Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:41+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:41+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_20f631875be811ef8fbcac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": null,\n \"tracking_code\": \"9400100105807076062211\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:41Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:56:41Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:56:41Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:33:41Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_087a4b7c8ce7471391e45ed9d73042fa\",\n \"tracking_code\": \"9400100105807076062211\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2IxMzBjMzYyZDUxZDQzNWE5MmZjY2U5ZmI0ZDAyMjcy\",\n \"est_delivery_date\": \"2024-08-16T15:56:41Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:41Z\",\n \"signed_by\": null,\n \"id\": \"trk_b130c362d51d435a92fcce9fb4d02272\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_5f17998ff9fc480fb61ca56e007a01c8\",\n \"from_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:41+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:41+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_20fba7295be811efba703cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"pending\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "3424" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76b9e786b85e00358aa3" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.375276" + ], + "location": [ + "/api/v2/insurances/ins_5f17998ff9fc480fb61ca56e007a01c8" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/insurances" + }, + "duration": 577 + }, + { + "recordedAt": 1723823802, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/insurances/ins_5f17998ff9fc480fb61ca56e007a01c8" + }, + "response": { + "body": "{\n \"amount\": \"100.00000\",\n \"fee\": {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n \"created_at\": \"2024-08-16T15:56:41Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:41+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:41+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_20f631875be811ef8fbcac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipment_id\": null,\n \"tracking_code\": \"9400100105807076062211\",\n \"mode\": \"test\",\n \"reference\": null,\n \"updated_at\": \"2024-08-16T15:56:41Z\",\n \"provider\": \"easypost\",\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:56:41Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-08-16T15:56:41Z\",\n \"description\": \"\",\n \"source\": \"ProcessingError\",\n \"message\": \"In test mode, only test tracking numbers are valid. Test tracking numbers are EZ1000000001, EZ2000000002, ... , EZ7000000007\",\n \"object\": \"TrackingDetail\",\n \"status\": \"error\",\n \"status_detail\": null,\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"9400100105807076062211\",\n \"status_detail\": null,\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2Q3ZjBjOGJiYjBjNzQxZjNiMDk1NGJkNTY1NDkxY2Ey\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:56:41Z\",\n \"signed_by\": null,\n \"id\": \"trk_d7f0c8bbb0c741f3b0954bd565491ca2\",\n \"object\": \"Tracker\",\n \"status\": \"error\"\n },\n \"provider_id\": null,\n \"messages\": [],\n \"id\": \"ins_5f17998ff9fc480fb61ca56e007a01c8\",\n \"from_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:41+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:41+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_20fba7295be811efba703cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"object\": \"Insurance\",\n \"status\": \"pending\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2666" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76bae786b85f00358b41" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.126416" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/insurances/ins_5f17998ff9fc480fb61ca56e007a01c8" + }, + "duration": 328 + } +] \ No newline at end of file diff --git a/src/test/cassettes/luma/get_promise.json b/src/test/cassettes/luma/get_promise.json new file mode 100644 index 000000000..9590cb630 --- /dev/null +++ b/src/test/cassettes/luma/get_promise.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1750095923, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"planned_ship_date\": \"2025-06-16\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"ruleset_name\": \"cheapest_delivery\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/luma/promise" + }, + "response": { + "body": "{\n \"luma_info\": {\n \"matching_rule_idx\": 0.0,\n \"ruleset_description\": \"Buy the cheapest rate that satisfies all of the following:\\nRule 0\\n \\nOtherwise buy the cheapest rate\",\n \"luma_selected_rate\": {\n \"carrier\": \"USPS\",\n \"rate\": \"6.07\",\n \"service\": \"GroundAdvantage\",\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"currency\": \"USD\",\n \"luma_predicted_deliver_by_date\": \"2025-06-19\"\n },\n \"ai_results\": [\n {\n \"meets_ruleset_requirements\": true,\n \"carrier\": \"USPS\",\n \"predicted_deliver_by_date\": \"2025-06-19\",\n \"service\": \"GroundAdvantage\",\n \"rate_usd\": \"6.07\",\n \"predicted_deliver_days\": 3.0\n },\n {\n \"meets_ruleset_requirements\": true,\n \"carrier\": \"USPS\",\n \"predicted_deliver_by_date\": \"2025-06-17\",\n \"service\": \"Express\",\n \"rate_usd\": \"34.15\",\n \"predicted_deliver_days\": 1.0\n },\n {\n \"meets_ruleset_requirements\": true,\n \"carrier\": \"USPS\",\n \"predicted_deliver_by_date\": \"2025-06-18\",\n \"service\": \"Priority\",\n \"rate_usd\": \"7.42\",\n \"predicted_deliver_days\": 2.0\n }\n ]\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "873" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "6ebfb8b068505833e2baa4f8006d7fcc" + ], + "x-proxied": [ + "intlb4nuq ec99f2d065", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.172372" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202506161725-4166f0359d-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/luma/promise" + }, + "duration": 284 + } +] \ No newline at end of file diff --git a/src/test/cassettes/order/buy_with_params.json b/src/test/cassettes/order/buy_with_params.json new file mode 100644 index 000000000..ae4a7ab19 --- /dev/null +++ b/src/test/cassettes/order/buy_with_params.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1723823908, + "request": { + "body": "{\n \"order\": {\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipments\": [\n {\n \"parcel\": {\n \"weight\": 10.2\n }\n },\n {\n \"parcel\": {\n \"weight\": 17.5\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8d70c771dffe437da59d254a905db12c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_35ad1f2c242b4dd48535ea3d9d187980\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_18f88c8de8f04e299efe6e193ffc647b\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:27Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:27Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_a7382a7799af4894bcf12b345fd26cb8\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8d70c771dffe437da59d254a905db12c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_35ad1f2c242b4dd48535ea3d9d187980\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_18f88c8de8f04e299efe6e193ffc647b\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": \"order_e4f72f9fe91a4373b85ee59ebc901c86\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:27Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:27Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_b7ce992c1a6146af9aa35ef207154021\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec4cc7aee65e451c841afb8bf730a913\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_56c7ac22afd448ee8182c2bc6697d74a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_142c56933c0048cea318dcb67ba08ec2\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_e4f72f9fe91a4373b85ee59ebc901c86\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_e4f72f9fe91a4373b85ee59ebc901c86\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "14670" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7723e786c4bb0035f82d" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.854134" + ], + "location": [ + "/api/v2/orders/order_e4f72f9fe91a4373b85ee59ebc901c86" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "duration": 1057 + }, + { + "recordedAt": 1723823911, + "request": { + "body": "{\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders/order_e4f72f9fe91a4373b85ee59ebc901c86/buy" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8d70c771dffe437da59d254a905db12c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_35ad1f2c242b4dd48535ea3d9d187980\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_18f88c8de8f04e299efe6e193ffc647b\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.07000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:29Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:29Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:29Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_35ad1f2c242b4dd48535ea3d9d187980\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:58:30Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"tracking_code\": \"9400100105807076062990\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2VjMTZjZGFiNjY3ZjRkMTViNWM5YjNiMjVmOWNlYjMw\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"signed_by\": null,\n \"id\": \"trk_ec16cdab667f4d15b5c9b3b25f9ceb30\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:29Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e86c978345cd4f48dc810c16053dcb3646.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:29Z\",\n \"id\": \"pl_0b1e99ab251a4803be6acd77ee9457b2\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:29Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:27Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_a7382a7799af4894bcf12b345fd26cb8\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8d70c771dffe437da59d254a905db12c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_35ad1f2c242b4dd48535ea3d9d187980\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_18f88c8de8f04e299efe6e193ffc647b\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062990\",\n \"messages\": [],\n \"order_id\": \"order_e4f72f9fe91a4373b85ee59ebc901c86\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"6.33000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:30Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec4cc7aee65e451c841afb8bf730a913\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:58:30Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"tracking_code\": \"9434600105807076063005\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2Q3ZTNlNjNhYjUwNzRjYmY5NTUxODI2OGExNmNlZjU1\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"signed_by\": null,\n \"id\": \"trk_d7e3e63ab5074cbf95518268a16cef55\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:30Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8240f500213e54273b72a7aedaa0c0fcc.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"id\": \"pl_c2de163b7f2a4c848f788b3f7ff881a0\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:30Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:27Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_b7ce992c1a6146af9aa35ef207154021\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec4cc7aee65e451c841afb8bf730a913\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_56c7ac22afd448ee8182c2bc6697d74a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_142c56933c0048cea318dcb67ba08ec2\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9434600105807076063005\",\n \"messages\": [],\n \"order_id\": \"order_e4f72f9fe91a4373b85ee59ebc901c86\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_e4f72f9fe91a4373b85ee59ebc901c86\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "18360" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf7725e786c4bd0035f96d" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.936771" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/orders/order_e4f72f9fe91a4373b85ee59ebc901c86/buy" + }, + "duration": 2144 + } +] \ No newline at end of file diff --git a/src/test/cassettes/order/buy_with_rate.json b/src/test/cassettes/order/buy_with_rate.json new file mode 100644 index 000000000..b8512976b --- /dev/null +++ b/src/test/cassettes/order/buy_with_rate.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1723823920, + "request": { + "body": "{\n \"order\": {\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipments\": [\n {\n \"parcel\": {\n \"weight\": 10.2\n }\n },\n {\n \"parcel\": {\n \"weight\": 17.5\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_38ac5fb715e14cabb3029bde5b09d9f5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4be8395f399b4279b64677dd495f9519\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7e2d2ac36db42ffbbc0aebb8a1e0128\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_d081bb2780ec4e08bb5bb8f17e58a7c5\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_38ac5fb715e14cabb3029bde5b09d9f5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4be8395f399b4279b64677dd495f9519\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7e2d2ac36db42ffbbc0aebb8a1e0128\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_0a6f94b2055f4d7888ee1294c5b4fece\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b1784194fdd8469fade7b00b5f5e9a7e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_119edccd62c24583b6e7f59ced7b5d49\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fe13d12f237c4ece984468ced5737017\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "14670" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf772fe786c4e300360491" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.930294" + ], + "location": [ + "/api/v2/orders/order_64ba299ed95a46a4a3a341cb78e5fdf7" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "duration": 1139 + }, + { + "recordedAt": 1723823922, + "request": { + "body": "{\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders/order_64ba299ed95a46a4a3a341cb78e5fdf7/buy" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_38ac5fb715e14cabb3029bde5b09d9f5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4be8395f399b4279b64677dd495f9519\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7e2d2ac36db42ffbbc0aebb8a1e0128\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.07000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:41Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:41Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:41Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7e2d2ac36db42ffbbc0aebb8a1e0128\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"tracking_code\": \"9400100105807076063027\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2FmMmE3NjU2YjY2NTRjYWFhMTU2N2E0NjNhMzQ3ZmI1\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"signed_by\": null,\n \"id\": \"trk_af2a7656b6654caaa1567a463a347fb5\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:41Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8bf48473c72b74f8682106707cb6abc70.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:41Z\",\n \"id\": \"pl_111ca27882714b1fb6e539f4d0e22da1\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:41Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_d081bb2780ec4e08bb5bb8f17e58a7c5\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_38ac5fb715e14cabb3029bde5b09d9f5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4be8395f399b4279b64677dd495f9519\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7e2d2ac36db42ffbbc0aebb8a1e0128\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063027\",\n \"messages\": [],\n \"order_id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"6.33000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_119edccd62c24583b6e7f59ced7b5d49\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"tracking_code\": \"9434600105807076063043\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzUwOTc3YWQ1NTc2ZTQ0ZTg5OGJiMzJlODBhZTk5ZmIx\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"signed_by\": null,\n \"id\": \"trk_50977ad5576e44e898bb32e80ae99fb1\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e807e421f9466e4883a480b82b1e71f19e.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"id\": \"pl_a8680e95f49c4f15bc068bdcd9e620f3\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:42Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_0a6f94b2055f4d7888ee1294c5b4fece\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b1784194fdd8469fade7b00b5f5e9a7e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_119edccd62c24583b6e7f59ced7b5d49\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fe13d12f237c4ece984468ced5737017\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9434600105807076063043\",\n \"messages\": [],\n \"order_id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "18360" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf7731e786c4e5003605ed" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.741378" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/orders/order_64ba299ed95a46a4a3a341cb78e5fdf7/buy" + }, + "duration": 1946 + } +] \ No newline at end of file diff --git a/src/test/cassettes/order/create.json b/src/test/cassettes/order/create.json new file mode 100644 index 000000000..0ebc26cf5 --- /dev/null +++ b/src/test/cassettes/order/create.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823916, + "request": { + "body": "{\n \"order\": {\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipments\": [\n {\n \"parcel\": {\n \"weight\": 10.2\n }\n },\n {\n \"parcel\": {\n \"weight\": 17.5\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6501c4435be811efa2a63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e4b5578a6259435b86c094882a982454\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f9e87f551e834eb0bad1532c85b099c4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e4b5578a6259435b86c094882a982454\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fbd17de95ec9434ab5ab9fa1688a53bf\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e4b5578a6259435b86c094882a982454\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cb148fb402df470d990e139882912791\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6501c4435be811efa2a63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_650392c95be811efb741ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_e4b5578a6259435b86c094882a982454\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_650392c95be811efb741ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_082d308d497843198c9e2e079b4f621f\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6501c4435be811efa2a63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:36Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e4b5578a6259435b86c094882a982454\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:36Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f9e87f551e834eb0bad1532c85b099c4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:36Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e4b5578a6259435b86c094882a982454\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:36Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fbd17de95ec9434ab5ab9fa1688a53bf\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:36Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e4b5578a6259435b86c094882a982454\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:36Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cb148fb402df470d990e139882912791\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6501c4435be811efa2a63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": \"order_ca8e568f95cf4fb687ecb3e49382f66b\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_650392c95be811efb741ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_2cb956b4e37a4d66abcc69728583cb34\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_650392c95be811efb741ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_5eb5df74e19c4c09850ca2ef6693d9fa\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6501c4435be811efa2a63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:36Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_2cb956b4e37a4d66abcc69728583cb34\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:36Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3355215d75c4421984bdc64e23b278d9\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:36Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_2cb956b4e37a4d66abcc69728583cb34\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:36Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_c05d5247c4ca4d99b9838c4e67c938db\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:36Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_2cb956b4e37a4d66abcc69728583cb34\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:36Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1c0c36b923404894b7e9962d1dc18f1a\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6501c4435be811efa2a63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_ca8e568f95cf4fb687ecb3e49382f66b\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:36Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_650392c95be811efb741ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_ca8e568f95cf4fb687ecb3e49382f66b\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_650392c95be811efb741ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "14670" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf772be786c4dd0036005d" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.890360" + ], + "location": [ + "/api/v2/orders/order_ca8e568f95cf4fb687ecb3e49382f66b" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "duration": 1099 + } +] \ No newline at end of file diff --git a/src/test/cassettes/order/get_rates.json b/src/test/cassettes/order/get_rates.json new file mode 100644 index 000000000..fe494a19f --- /dev/null +++ b/src/test/cassettes/order/get_rates.json @@ -0,0 +1,97 @@ +[ + { + "recordedAt": 1723823912, + "request": { + "body": "{\n \"order\": {\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipments\": [\n {\n \"parcel\": {\n \"weight\": 10.2\n }\n },\n {\n \"parcel\": {\n \"weight\": 17.5\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_627bee845be811efb26dac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_269d79e37a17454aa45bab2aa6cfae87\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_aa015e5f32574a85a9a010b858d29d4e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_269d79e37a17454aa45bab2aa6cfae87\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6d3849693a204529b8793b4d47d230e7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_269d79e37a17454aa45bab2aa6cfae87\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_641b1bcaf5a54d4a96319ee96faf46f3\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:31Z\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_627bee845be811efb26dac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:31Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:31Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_627df8865be811efa1753cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_269d79e37a17454aa45bab2aa6cfae87\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_627df8865be811efa1753cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:31Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:31Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_4a240314851743819ffa437dc4b125ae\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_627bee845be811efb26dac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_269d79e37a17454aa45bab2aa6cfae87\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_aa015e5f32574a85a9a010b858d29d4e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_269d79e37a17454aa45bab2aa6cfae87\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6d3849693a204529b8793b4d47d230e7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_269d79e37a17454aa45bab2aa6cfae87\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_641b1bcaf5a54d4a96319ee96faf46f3\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_627bee845be811efb26dac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": \"order_a8804bff91244c2ca5688d4e4fa9cf3a\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:31Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:31Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_627df8865be811efa1753cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_59a0bfac7f9d46de8355e4278797e339\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_627df8865be811efa1753cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:31Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:31Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_40e74dbdbbea4e6682fda21f2cbd732e\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_627bee845be811efb26dac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59a0bfac7f9d46de8355e4278797e339\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2731522747bc41a08bb2cbd6d4125de2\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59a0bfac7f9d46de8355e4278797e339\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_5b8d22371f414d1c853b549c6ebe61b7\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59a0bfac7f9d46de8355e4278797e339\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_05f2932317824bceb0b2c4458ccdd047\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_627bee845be811efb26dac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_a8804bff91244c2ca5688d4e4fa9cf3a\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_627df8865be811efa1753cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_a8804bff91244c2ca5688d4e4fa9cf3a\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:31+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:31+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_627df8865be811efa1753cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "14670" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf7727e786c4bf0035fbd4" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.867037" + ], + "location": [ + "/api/v2/orders/order_a8804bff91244c2ca5688d4e4fa9cf3a" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "duration": 1076 + } +] \ No newline at end of file diff --git a/src/test/cassettes/order/lowest_rate.json b/src/test/cassettes/order/lowest_rate.json new file mode 100644 index 000000000..59ab13bfc --- /dev/null +++ b/src/test/cassettes/order/lowest_rate.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823915, + "request": { + "body": "{\n \"order\": {\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipments\": [\n {\n \"parcel\": {\n \"weight\": 10.2\n }\n },\n {\n \"parcel\": {\n \"weight\": 17.5\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_644315695be811efb6d9ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_8f6eccc16cbf4dbe8131610413aa08d6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d25d487c95894606b354c0151247056c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_8f6eccc16cbf4dbe8131610413aa08d6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f8c78dccdf8b42048744a2c56a4861dc\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_8f6eccc16cbf4dbe8131610413aa08d6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ffd6922519dc473cb67bac126f4933ce\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:34Z\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_644315695be811efb6d9ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:34Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:34Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6444d3755be811efb6daac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_8f6eccc16cbf4dbe8131610413aa08d6\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6444d3755be811efb6daac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:34Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:34Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_b94903eaa864461abc2ee3410524b29d\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_644315695be811efb6d9ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_8f6eccc16cbf4dbe8131610413aa08d6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d25d487c95894606b354c0151247056c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_8f6eccc16cbf4dbe8131610413aa08d6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f8c78dccdf8b42048744a2c56a4861dc\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_8f6eccc16cbf4dbe8131610413aa08d6\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ffd6922519dc473cb67bac126f4933ce\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_644315695be811efb6d9ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": \"order_764ce39790bd41d48ecd0244b92f8b37\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:34Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:34Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6444d3755be811efb6daac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_f58127d5bf2e4ee5b260d15b464f4be5\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6444d3755be811efb6daac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:34Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:34Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_be13ad8f6c9743919f34a19f9d223aae\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_644315695be811efb6d9ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f58127d5bf2e4ee5b260d15b464f4be5\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ae3e97cc30044ff79d9601ef495c2aea\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f58127d5bf2e4ee5b260d15b464f4be5\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ba0365a6c02346fe8cd7a9797bc4d6bf\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:35Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f58127d5bf2e4ee5b260d15b464f4be5\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9ea57ce26c38462488f4621c0c13f3e3\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_644315695be811efb6d9ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_764ce39790bd41d48ecd0244b92f8b37\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:35Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6444d3755be811efb6daac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_764ce39790bd41d48ecd0244b92f8b37\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6444d3755be811efb6daac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "14670" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf772ae786c4c40035fefa" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.832902" + ], + "location": [ + "/api/v2/orders/order_764ce39790bd41d48ecd0244b92f8b37" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "duration": 1033 + } +] \ No newline at end of file diff --git a/src/test/cassettes/order/new_rate.json b/src/test/cassettes/order/new_rate.json new file mode 100644 index 000000000..21567b8ea --- /dev/null +++ b/src/test/cassettes/order/new_rate.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823917, + "request": { + "body": "{\n \"order\": {\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipments\": [\n {\n \"parcel\": {\n \"weight\": 10.2\n }\n },\n {\n \"parcel\": {\n \"weight\": 17.5\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b966bf4307a048a393c0cc0cabfddbd4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e5e6f1c516dc465184a8bc644eb98f3d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_173d460bc0334d65b5552955d956900f\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_f47943fca71c44bd87e259d7f10ba60f\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b966bf4307a048a393c0cc0cabfddbd4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e5e6f1c516dc465184a8bc644eb98f3d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_173d460bc0334d65b5552955d956900f\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": \"order_7d92ec045a4a4d4587ca6739e571f36a\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_6ad8c8dddc944c96a3c75a0ff4cab9e2\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_10b2d1e134c1459b83659ff8ddcc5453\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_6ad8c8dddc944c96a3c75a0ff4cab9e2\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_857f2175bec846de9cb106fb3a6c3441\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_6ad8c8dddc944c96a3c75a0ff4cab9e2\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f4f929e4dded4cd8bcb44aed63a1cbe5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_6ad8c8dddc944c96a3c75a0ff4cab9e2\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a237bdd8eed94a4ea20e77c56986c0b6\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_7d92ec045a4a4d4587ca6739e571f36a\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_7d92ec045a4a4d4587ca6739e571f36a\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "14670" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf772ce786c4df0036019e" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.871235" + ], + "location": [ + "/api/v2/orders/order_7d92ec045a4a4d4587ca6739e571f36a" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "duration": 1070 + }, + { + "recordedAt": 1723823919, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/orders/order_7d92ec045a4a4d4587ca6739e571f36a/rates" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_62a01f86165a4ab9bdd4573966164872\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bbb2c7b7ccf84f46876971aaf251f1d1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_816de4b192054508a3d62e05939c0976\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_f47943fca71c44bd87e259d7f10ba60f\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_62a01f86165a4ab9bdd4573966164872\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bbb2c7b7ccf84f46876971aaf251f1d1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7705bcdd4c1c47a582861319ff55535d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_816de4b192054508a3d62e05939c0976\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_7d92ec045a4a4d4587ca6739e571f36a\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_6ad8c8dddc944c96a3c75a0ff4cab9e2\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:37Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_10b2d1e134c1459b83659ff8ddcc5453\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_6ad8c8dddc944c96a3c75a0ff4cab9e2\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1c784c17a26241bf941e2e3bc4ddec2d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_6ad8c8dddc944c96a3c75a0ff4cab9e2\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3f34a710a1e0482b84de414ca70439d0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_6ad8c8dddc944c96a3c75a0ff4cab9e2\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1c70dd943a164c968cb0b3bcdadcbebe\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_65c859d25be811efb3d5ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_7d92ec045a4a4d4587ca6739e571f36a\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:37Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_7d92ec045a4a4d4587ca6739e571f36a\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_65ca3aa55be811efb3d6ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "13559" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf772ee786c4e1003602f5" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.164158" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/orders/order_7d92ec045a4a4d4587ca6739e571f36a/rates" + }, + "duration": 1450 + } +] \ No newline at end of file diff --git a/src/test/cassettes/order/retrieve.json b/src/test/cassettes/order/retrieve.json new file mode 100644 index 000000000..3dac71f69 --- /dev/null +++ b/src/test/cassettes/order/retrieve.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823913, + "request": { + "body": "{\n \"order\": {\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipments\": [\n {\n \"parcel\": {\n \"weight\": 10.2\n }\n },\n {\n \"parcel\": {\n \"weight\": 17.5\n }\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_77542cd2ee9740f58d715b849aea3c79\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a8cf99c8a3084c11adbcef4228c30571\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a85028ccbf1f47d1a3e2393c2dba4a31\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_b47d62c739584b15a819a9b26726e603\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_77542cd2ee9740f58d715b849aea3c79\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a8cf99c8a3084c11adbcef4228c30571\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a85028ccbf1f47d1a3e2393c2dba4a31\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": \"order_b503661683c64d18895dca080873ac33\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_948cbd7eb68843819a27eb2693df3d78\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_2ba6ff7e56aa4ed8b6575c8cf0b4f0ba\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_948cbd7eb68843819a27eb2693df3d78\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a41cabf5ed9e49a49c358ddb13314ae1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_948cbd7eb68843819a27eb2693df3d78\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9a40b2367adf43d1b06f8019d065718b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_948cbd7eb68843819a27eb2693df3d78\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6312dcb46b7c4455b779ea55546e37cd\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_b503661683c64d18895dca080873ac33\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_b503661683c64d18895dca080873ac33\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "14670" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf7728e786c4c10035fd10" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.850054" + ], + "location": [ + "/api/v2/orders/order_b503661683c64d18895dca080873ac33" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "duration": 1054 + }, + { + "recordedAt": 1723823914, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/orders/order_b503661683c64d18895dca080873ac33" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"70.30\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"80.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"70.30\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_77542cd2ee9740f58d715b849aea3c79\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"17.22\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"22.30\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"14.48\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a8cf99c8a3084c11adbcef4228c30571\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"12.82\",\n \"created_at\": null,\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"17.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"11.40\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a85028ccbf1f47d1a3e2393c2dba4a31\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_b47d62c739584b15a819a9b26726e603\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_77542cd2ee9740f58d715b849aea3c79\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a8cf99c8a3084c11adbcef4228c30571\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e23c49b421dd46cca9d0e6cba84f60a4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a85028ccbf1f47d1a3e2393c2dba4a31\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_b503661683c64d18895dca080873ac33\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_948cbd7eb68843819a27eb2693df3d78\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:32Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:32Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_2ba6ff7e56aa4ed8b6575c8cf0b4f0ba\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_948cbd7eb68843819a27eb2693df3d78\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a41cabf5ed9e49a49c358ddb13314ae1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_948cbd7eb68843819a27eb2693df3d78\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9a40b2367adf43d1b06f8019d065718b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:33Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_948cbd7eb68843819a27eb2693df3d78\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6312dcb46b7c4455b779ea55546e37cd\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_63409f565be811efb2cdac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": \"order_b503661683c64d18895dca080873ac33\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:33Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_b503661683c64d18895dca080873ac33\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6342240b5be811efa1d03cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "13559" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7729e786c4c20035fe5a" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.153669" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/orders/order_b503661683c64d18895dca080873ac33" + }, + "duration": 352 + } +] \ No newline at end of file diff --git a/src/test/cassettes/paginated_collections/next_page.json b/src/test/cassettes/paginated_collections/next_page.json new file mode 100644 index 000000000..02dc86f89 --- /dev/null +++ b/src/test/cassettes/paginated_collections/next_page.json @@ -0,0 +1,174 @@ +[ + { + "recordedAt": 1723823827, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"addresses\": [\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:06+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_2fc788aa5be811ef811f3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:06+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_2fc51c395be811ef811d3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:56:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_2857090e5be811efbddb3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_2855588b5be811ef932eac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:56:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_232d19035be811ef8bb4ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2337" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76d3e786bc180035a4bd" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.045794" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 251 + }, + { + "recordedAt": 1723823828, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/addresses?%62%65%66%6F%72%65%5F%69%64\u003d%61%64%72%5F%32%33%32%64%31%39%30%33%35%62%65%38%31%31%65%66%38%62%62%34%61%63%31%66%36%62%63%35%33%33%34%32" + }, + "response": { + "body": "{\n \"addresses\": [\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_232b887b5be811ef90ddac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:44+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_2279ba605be811ef8b62ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:44+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_227406095be811ef8cf7ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:42+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_21907c4c5be811efbac03cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:42+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_218df41f5be811ef900dac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:41+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:41+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_20fba7295be811efba703cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:41+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:41+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_20f631875be811ef8fbcac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:40+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:40+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_201e9a175be811ef8a5fac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:40+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:40+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_201c1dc75be811ef8bd6ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_1e0f386b5be811efb9393cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_1e09965d5be811ef8e70ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-07-24T22:21:52+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-07-24T22:21:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_206020f74a0b11efb5863cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-07-24T22:21:51+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-07-24T22:21:51+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_205b6acd4a0b11efa1f6ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-24T22:21:51+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-24T22:21:51+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_201f28e84a0b11efb5723cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-07-24T22:21:51+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-24T22:21:51+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_201de2d64a0b11efa1dfac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-07-24T22:21:51+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-24T22:21:51+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_1fc977634a0b11efa1c8ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-24T22:21:51+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-24T22:21:51+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_1fc7888a4a0b11ef93deac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-07-24T22:21:50+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-24T22:21:50+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_1f7755694a0b11efb5213cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-07-24T22:21:50+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-24T22:21:50+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_1f75d29c4a0b11efb5203cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-07-24T22:21:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-07-24T22:21:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_18e97c624a0b11ef9f86ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "11107" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76d3e786bc190035a512" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.056175" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses?%62%65%66%6F%72%65%5F%69%64\u003d%61%64%72%5F%32%33%32%64%31%39%30%33%35%62%65%38%31%31%65%66%38%62%62%34%61%63%31%66%36%62%63%35%33%33%34%32" + }, + "duration": 269 + } +] \ No newline at end of file diff --git a/src/test/cassettes/paginated_collections/next_page_size_limit.json b/src/test/cassettes/paginated_collections/next_page_size_limit.json new file mode 100644 index 000000000..112396a0e --- /dev/null +++ b/src/test/cassettes/paginated_collections/next_page_size_limit.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1723823828, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"addresses\": [\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:06+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_2fc788aa5be811ef811f3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:06+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_2fc51c395be811ef811d3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:56:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_2857090e5be811efbddb3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_2855588b5be811ef932eac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:56:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_232d19035be811ef8bb4ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2337" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76d4e786bc1a0035a57e" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.039237" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 244 + }, + { + "recordedAt": 1723823828, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%61%64%72%5F%32%33%32%64%31%39%30%33%35%62%65%38%31%31%65%66%38%62%62%34%61%63%31%66%36%62%63%35%33%33%34%32" + }, + "response": { + "body": "{\n \"addresses\": [\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_232b887b5be811ef90ddac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:44+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_2279ba605be811ef8b62ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:56:44+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:56:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_227406095be811ef8cf7ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:56:42+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:56:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_21907c4c5be811efbac03cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:56:42+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:56:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_218df41f5be811ef900dac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2893" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76d4e786bc1b0035a5ce" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.048759" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/addresses?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%61%64%72%5F%32%33%32%64%31%39%30%33%35%62%65%38%31%31%65%66%38%62%62%34%61%63%31%66%36%62%63%35%33%33%34%32" + }, + "duration": 261 + } +] \ No newline at end of file diff --git a/src/test/cassettes/parcel/create.json b/src/test/cassettes/parcel/create.json new file mode 100644 index 000000000..bdaeeb305 --- /dev/null +++ b/src/test/cassettes/parcel/create.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823866, + "request": { + "body": "{\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/parcels" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:46Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:57:46Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_b10a0d7fa8614d3e85ca83d8507469ee\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "229" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76fae786bd250035cd80" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.029591" + ], + "location": [ + "/api/v2/parcels/prcl_b10a0d7fa8614d3e85ca83d8507469ee" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/parcels" + }, + "duration": 241 + } +] \ No newline at end of file diff --git a/src/test/cassettes/parcel/retrieve.json b/src/test/cassettes/parcel/retrieve.json new file mode 100644 index 000000000..540b19629 --- /dev/null +++ b/src/test/cassettes/parcel/retrieve.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823866, + "request": { + "body": "{\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/parcels" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:46Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:57:46Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_7fb2d970236944bba7d3b5ff1f75638b\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "229" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76fae786bd220035cccd" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.048449" + ], + "location": [ + "/api/v2/parcels/prcl_7fb2d970236944bba7d3b5ff1f75638b" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/parcels" + }, + "duration": 258 + }, + { + "recordedAt": 1723823866, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/parcels/prcl_7fb2d970236944bba7d3b5ff1f75638b" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:46Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:57:46Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_7fb2d970236944bba7d3b5ff1f75638b\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "229" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76fae786bd230035cd15" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.027146" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/parcels/prcl_7fb2d970236944bba7d3b5ff1f75638b" + }, + "duration": 229 + } +] \ No newline at end of file diff --git a/src/test/cassettes/payment_method/all.json b/src/test/cassettes/payment_method/all.json new file mode 100644 index 000000000..3717418d9 --- /dev/null +++ b/src/test/cassettes/payment_method/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823877, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/payment_methods" + }, + "response": { + "body": "{\n \"secondary_payment_method\": null,\n \"id\": \"cust_815cb5adf39548fc8ec9ee928cd51a96\",\n \"primary_payment_method\": null,\n \"object\": \"PaymentMethods\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "134" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7704e786c0bc0035d6db" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.083029" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/payment_methods" + }, + "duration": 287 + } +] \ No newline at end of file diff --git a/src/test/cassettes/pickup/all.json b/src/test/cassettes/pickup/all.json new file mode 100644 index 000000000..c30fcde5d --- /dev/null +++ b/src/test/cassettes/pickup/all.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823832, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/pickups?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"pickups\": [\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:54+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:54+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d96685b5a4ef11ee96b5ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:54Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:55Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:55Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_a965676512e24485bf2d50e3e317752c\",\n \"pickup_id\": \"pickup_ec9e3bb5252a4db3b5c479f2954aac6f\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC63906512\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:57Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_ec9e3bb5252a4db3b5c479f2954aac6f\",\n \"object\": \"Pickup\",\n \"status\": \"scheduled\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:52+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d7d56f39a4ef11ee95fdac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:52Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:52Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:52Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_e5c8e252781e4ec0ba025ca79fbea91e\",\n \"pickup_id\": \"pickup_ec95cdda44334729af451277bacb5041\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:52Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_ec95cdda44334729af451277bacb5041\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:46+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:46+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d4c18861a4ef11eeb194ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:46Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:47Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:47Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_188e197c7b3943ca9ab572ff9ac22bbc\",\n \"pickup_id\": \"pickup_7324ea25c3fd4f5ea5182681bf6960d6\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC63906736\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:50Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_7324ea25c3fd4f5ea5182681bf6960d6\",\n \"object\": \"Pickup\",\n \"status\": \"canceled\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:44+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d31ffdd2a4ef11eea5403cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:44Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:45Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:45Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_0c35750982174f7393bbc1536ccda5d3\",\n \"pickup_id\": \"pickup_89f4f639683049d8ab5a1c8526c87cf7\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:44Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_89f4f639683049d8ab5a1c8526c87cf7\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:41+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:41+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d162b4bea4ef11eea43d3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:41Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:42Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:42Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_cefd58afaf694649adcf39156b92f52b\",\n \"pickup_id\": \"pickup_1ce4c97001ad493fb176eb254f5c200d\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:41Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_1ce4c97001ad493fb176eb254f5c200d\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "5840" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76d7e786bc3d0035a9e3" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.303792" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 505 + } +] \ No newline at end of file diff --git a/src/test/cassettes/pickup/buy.json b/src/test/cassettes/pickup/buy.json new file mode 100644 index 000000000..05ddc8091 --- /dev/null +++ b/src/test/cassettes/pickup/buy.json @@ -0,0 +1,272 @@ +[ + { + "recordedAt": 1735856304, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2025-01-02T22:18:23Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2025-01-02T22:18:24Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:18:24Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:24Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b1ee589042d24cac8a26453053f266c4\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2025-01-02T22:18:24Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"tracking_code\": \"9400100208271116082709\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzkzZDVhNjViMGIyZDQ0NDBiYTBhZjk1YjEzNmE1ZTJk\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:18:24Z\",\n \"signed_by\": null,\n \"id\": \"trk_93d5a65b0b2d4440ba0af95b136a5e2d\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:18:23+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:23+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7b386d2ec95711efa64bac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:18:23+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:23+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7b386d2ec95711efa64bac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2025-01-02T22:18:24Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e82a20d8b9c83b474eaf4880c700f2d06c.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2025-01-02T22:18:24Z\",\n \"id\": \"pl_e092df76438e4539b16f8353d40ce79c\",\n \"label_zpl_url\": null,\n \"label_date\": \"2025-01-02T22:18:24Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2025-01-02T22:18:23Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2025-01-02T22:18:23Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_15dd44955acf45ce982e37e6f9d6e338\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:18:23+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:18:24+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7b359110c95711efb73dac1f6bc53342\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.55\",\n \"created_at\": \"2025-01-02T22:18:23Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.20\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:23Z\",\n \"rate\": \"7.20\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_487f4f25bf474a2bb03dd1820019aff4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:18:23Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:23Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b1ee589042d24cac8a26453053f266c4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"34.10\",\n \"created_at\": \"2025-01-02T22:18:23Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"39.00\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:23Z\",\n \"rate\": \"34.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bdbdf0adf43a47308ec1be9206160eb3\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:18:23+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:18:24+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7b359110c95711efb73dac1f6bc53342\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208271116082709\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6550" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb56nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "afab89c4677710afe78854be004f871a" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.888250" + ], + "location": [ + "/api/v2/shipments/shp_c4aec94772b84c33ac5ece85238f8c22" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1106 + }, + { + "recordedAt": 1735856306, + "request": { + "body": "{\n \"pickup\": {\n \"max_datetime\": \"2025-01-03\",\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipment\": {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:23 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_15dd44955acf45ce982e37e6f9d6e338\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:23 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.55,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:23 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 7.2,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"currency\": \"USD\",\n \"id\": \"rate_487f4f25bf474a2bb03dd1820019aff4\",\n \"retailRate\": 10.2,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:23 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:23 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"currency\": \"USD\",\n \"id\": \"rate_b1ee589042d24cac8a26453053f266c4\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:23 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 34.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:23 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 34.1,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"currency\": \"USD\",\n \"id\": \"rate_bdbdf0adf43a47308ec1be9206160eb3\",\n \"retailRate\": 39.0,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:23 PM\"\n }\n ],\n \"trackingCode\": \"9400100208271116082709\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:23 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_7b359110c95711efb73dac1f6bc53342\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:24 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:23 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_7b386d2ec95711efa64bac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:23 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:24 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"currency\": \"USD\",\n \"id\": \"rate_b1ee589042d24cac8a26453053f266c4\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:24 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:23 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:23 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_7b359110c95711efb73dac1f6bc53342\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:24 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100208271116082709\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:24 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzkzZDVhNjViMGIyZDQ0NDBiYTBhZjk1YjEzNmE1ZTJk\",\n \"trackingDetails\": [],\n \"id\": \"trk_93d5a65b0b2d4440ba0af95b136a5e2d\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:24 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:23 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_7b386d2ec95711efa64bac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:23 PM\"\n },\n \"id\": \"shp_c4aec94772b84c33ac5ece85238f8c22\",\n \"postageLabel\": {\n \"createdAt\": \"Jan 2, 2025, 3:18:24 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_e092df76438e4539b16f8353d40ce79c\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e82a20d8b9c83b474eaf4880c700f2d06c.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:24 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:24 PM\"\n },\n \"min_datetime\": \"2025-01-03\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:18:25+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7bf5d649c95711efa6cbac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:18:25Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:18:26Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:18:26Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_cc1060b46158488bad23afb7790c92a6\",\n \"pickup_id\": \"pickup_2f687f9a294845e9b868ca5886209fad\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:18:25Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_2f687f9a294845e9b868ca5886209fad\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1157" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "afab89c8677710b1e78854c0004f8946" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.126662" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "duration": 1332 + }, + { + "recordedAt": 1735856310, + "request": { + "body": "{\n \"carrier\": \"USPS\",\n \"service\": \"NextDay\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_2f687f9a294845e9b868ca5886209fad/buy" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:18:25+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7bf5d649c95711efa6cbac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:18:25Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:18:26Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:18:26Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_cc1060b46158488bad23afb7790c92a6\",\n \"pickup_id\": \"pickup_2f687f9a294845e9b868ca5886209fad\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC64874562\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:18:30Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_2f687f9a294845e9b868ca5886209fad\",\n \"object\": \"Pickup\",\n \"status\": \"scheduled\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1168" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "afab89c7677710b2e78854c2004f8bc3" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "4.405836" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_2f687f9a294845e9b868ca5886209fad/buy" + }, + "duration": 4616 + } +] \ No newline at end of file diff --git a/src/test/cassettes/pickup/buy_with_rate.json b/src/test/cassettes/pickup/buy_with_rate.json new file mode 100644 index 000000000..c32df5b90 --- /dev/null +++ b/src/test/cassettes/pickup/buy_with_rate.json @@ -0,0 +1,272 @@ +[ + { + "recordedAt": 1735856315, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2025-01-02T22:18:35Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2025-01-02T22:18:35Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:18:35Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:35Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_22bda26cf44740288e2415df9a17d873\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2025-01-02T22:18:35Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"tracking_code\": \"9400100208271116082723\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzQ1ZTNjNjE3NmUzYzRiMmNiZTU3YmEwMjdkN2E5ZDk5\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:18:35Z\",\n \"signed_by\": null,\n \"id\": \"trk_45e3c6176e3c4b2cbe57ba027d7a9d99\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:18:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_81f4f1dbc95711ef824e3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:18:35+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_81f4f1dbc95711ef824e3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2025-01-02T22:18:35Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e8463200e83a484f21b23a1f844f39103a.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2025-01-02T22:18:35Z\",\n \"id\": \"pl_ee67a6f25cef4362a612da2c66b49086\",\n \"label_zpl_url\": null,\n \"label_date\": \"2025-01-02T22:18:35Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2025-01-02T22:18:35Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2025-01-02T22:18:35Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_7394fb4b21514d7c8ffc0b9d400546d2\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:18:35+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:18:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_81f258a4c95711ef824a3cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:18:35Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:35Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_22bda26cf44740288e2415df9a17d873\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"34.10\",\n \"created_at\": \"2025-01-02T22:18:35Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"39.00\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:35Z\",\n \"rate\": \"34.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8508af4f01fa421b832f4b32a948bb1a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.55\",\n \"created_at\": \"2025-01-02T22:18:35Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.20\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:35Z\",\n \"rate\": \"7.20\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b9f5f3c5933241f383096b2d314efa03\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:18:35+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:18:35+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_81f258a4c95711ef824a3cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208271116082723\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6550" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710ee677710bbe78854fc004a0637" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.801793" + ], + "location": [ + "/api/v2/shipments/shp_31195c38b9a9416eac34a25743865433" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1010 + }, + { + "recordedAt": 1735856317, + "request": { + "body": "{\n \"pickup\": {\n \"max_datetime\": \"2025-01-03\",\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipment\": {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_7394fb4b21514d7c8ffc0b9d400546d2\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"currency\": \"USD\",\n \"id\": \"rate_22bda26cf44740288e2415df9a17d873\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 34.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 34.1,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"currency\": \"USD\",\n \"id\": \"rate_8508af4f01fa421b832f4b32a948bb1a\",\n \"retailRate\": 39.0,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.55,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 7.2,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"currency\": \"USD\",\n \"id\": \"rate_b9f5f3c5933241f383096b2d314efa03\",\n \"retailRate\": 10.2,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n }\n ],\n \"trackingCode\": \"9400100208271116082723\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_81f258a4c95711ef824a3cecef1b359e\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_81f4f1dbc95711ef824e3cecef1b359e\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"currency\": \"USD\",\n \"id\": \"rate_22bda26cf44740288e2415df9a17d873\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_81f258a4c95711ef824a3cecef1b359e\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100208271116082723\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzQ1ZTNjNjE3NmUzYzRiMmNiZTU3YmEwMjdkN2E5ZDk5\",\n \"trackingDetails\": [],\n \"id\": \"trk_45e3c6176e3c4b2cbe57ba027d7a9d99\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_81f4f1dbc95711ef824e3cecef1b359e\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n \"id\": \"shp_31195c38b9a9416eac34a25743865433\",\n \"postageLabel\": {\n \"createdAt\": \"Jan 2, 2025, 3:18:35 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_ee67a6f25cef4362a612da2c66b49086\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e8463200e83a484f21b23a1f844f39103a.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:35 PM\"\n },\n \"min_datetime\": \"2025-01-03\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:18:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_82adb3aec95711ef82c83cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:18:36Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:18:37Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:18:37Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_9c62ce4a8e3c4d9a90dddd4804e95661\",\n \"pickup_id\": \"pickup_ccc1bf4275774d4f84575e1113c3b118\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:18:36Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_ccc1bf4275774d4f84575e1113c3b118\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1157" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710f3677710bce78854fe004a0827" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.842640" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "duration": 1058 + }, + { + "recordedAt": 1735856319, + "request": { + "body": "{\n \"carrier\": \"USPS\",\n \"service\": \"NextDay\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_ccc1bf4275774d4f84575e1113c3b118/buy" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:18:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_82adb3aec95711ef82c83cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:18:36Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:18:37Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:18:37Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_9c62ce4a8e3c4d9a90dddd4804e95661\",\n \"pickup_id\": \"pickup_ccc1bf4275774d4f84575e1113c3b118\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC64874478\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:18:39Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_ccc1bf4275774d4f84575e1113c3b118\",\n \"object\": \"Pickup\",\n \"status\": \"scheduled\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1168" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710f5677710bde7885500004a09e6" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "2.168661" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_ccc1bf4275774d4f84575e1113c3b118/buy" + }, + "duration": 2381 + } +] \ No newline at end of file diff --git a/src/test/cassettes/pickup/cancel.json b/src/test/cassettes/pickup/cancel.json new file mode 100644 index 000000000..a6805926d --- /dev/null +++ b/src/test/cassettes/pickup/cancel.json @@ -0,0 +1,358 @@ +[ + { + "recordedAt": 1735856480, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2025-01-02T22:21:18Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2025-01-02T22:21:19Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:21:19Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:19Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4e5d2ecd8ca448d5ba5f70bc474af477\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2025-01-02T22:21:19Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"tracking_code\": \"9400100208271116082754\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzdmNjUzYmI5NjMwNTQ0NTY5ZWY3MmEwYWY4YzYwYzE0\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:21:19Z\",\n \"signed_by\": null,\n \"id\": \"trk_7f653bb9630544569ef72a0af8c60c14\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:21:18+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:18+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_e395ec8fc95711ef9f8aac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:21:18+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:18+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_e395ec8fc95711ef9f8aac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2025-01-02T22:21:19Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e852ad5bb114844b65bf8b5b2574180ed6.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2025-01-02T22:21:19Z\",\n \"id\": \"pl_be857ba3a180400ead62214f58b38851\",\n \"label_zpl_url\": null,\n \"label_date\": \"2025-01-02T22:21:19Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2025-01-02T22:21:18Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2025-01-02T22:21:18Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_495288bc9216437087a5ad87d652a578\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:21:18+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:21:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_e3932fa3c95711ef8766ac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"34.10\",\n \"created_at\": \"2025-01-02T22:21:19Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"39.00\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:19Z\",\n \"rate\": \"34.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_afc1f920d5b74d1fa513c6a14c5c4a6d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.55\",\n \"created_at\": \"2025-01-02T22:21:19Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.20\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:19Z\",\n \"rate\": \"7.20\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_5834b73bb24645cdb1dadf8461f3605a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:21:19Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:19Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4e5d2ecd8ca448d5ba5f70bc474af477\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:21:18+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:21:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_e3932fa3c95711ef8766ac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208271116082754\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6550" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710f46777115ee7886ae6004ad7c2" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.123672" + ], + "location": [ + "/api/v2/shipments/shp_e66ff5ca55ab458c844e4d1ffc85e321" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1340 + }, + { + "recordedAt": 1735856481, + "request": { + "body": "{\n \"pickup\": {\n \"max_datetime\": \"2025-01-03\",\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipment\": {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:18 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_495288bc9216437087a5ad87d652a578\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:18 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 34.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:19 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 34.1,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"currency\": \"USD\",\n \"id\": \"rate_afc1f920d5b74d1fa513c6a14c5c4a6d\",\n \"retailRate\": 39.0,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:19 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.55,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:19 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 7.2,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"currency\": \"USD\",\n \"id\": \"rate_5834b73bb24645cdb1dadf8461f3605a\",\n \"retailRate\": 10.2,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:19 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:19 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"currency\": \"USD\",\n \"id\": \"rate_4e5d2ecd8ca448d5ba5f70bc474af477\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:19 PM\"\n }\n ],\n \"trackingCode\": \"9400100208271116082754\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:18 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_e3932fa3c95711ef8766ac1f6bc539ae\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:19 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:18 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_e395ec8fc95711ef9f8aac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:18 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:19 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"currency\": \"USD\",\n \"id\": \"rate_4e5d2ecd8ca448d5ba5f70bc474af477\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:19 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:18 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:18 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_e3932fa3c95711ef8766ac1f6bc539ae\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:19 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100208271116082754\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:19 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzdmNjUzYmI5NjMwNTQ0NTY5ZWY3MmEwYWY4YzYwYzE0\",\n \"trackingDetails\": [],\n \"id\": \"trk_7f653bb9630544569ef72a0af8c60c14\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:19 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:18 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_e395ec8fc95711ef9f8aac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:18 PM\"\n },\n \"id\": \"shp_e66ff5ca55ab458c844e4d1ffc85e321\",\n \"postageLabel\": {\n \"createdAt\": \"Jan 2, 2025, 3:21:19 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_be857ba3a180400ead62214f58b38851\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e852ad5bb114844b65bf8b5b2574180ed6.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:19 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:19 PM\"\n },\n \"min_datetime\": \"2025-01-03\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:21:20+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_e48347dac95711efa009ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:21:20Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:21:21Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:21:21Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_3220c7e9c2844373b4028a582a7fa601\",\n \"pickup_id\": \"pickup_5f249ade4ce348f5ac1a8b7fad7912a2\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:21:20Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_5f249ade4ce348f5ac1a8b7fad7912a2\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1157" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb57nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710ee67771160e7886ae8004ad964" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.109154" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "duration": 1329 + }, + { + "recordedAt": 1735856484, + "request": { + "body": "{\n \"carrier\": \"USPS\",\n \"service\": \"NextDay\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_5f249ade4ce348f5ac1a8b7fad7912a2/buy" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:21:20+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_e48347dac95711efa009ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:21:20Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:21:21Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:21:21Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_3220c7e9c2844373b4028a582a7fa601\",\n \"pickup_id\": \"pickup_5f249ade4ce348f5ac1a8b7fad7912a2\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC64874480\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:21:24Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_5f249ade4ce348f5ac1a8b7fad7912a2\",\n \"object\": \"Pickup\",\n \"status\": \"scheduled\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1168" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb58nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710f067771161e7886aea004adb0f" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "2.491198" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_5f249ade4ce348f5ac1a8b7fad7912a2/buy" + }, + "duration": 2706 + }, + { + "recordedAt": 1735856485, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_5f249ade4ce348f5ac1a8b7fad7912a2/cancel" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:21:20+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_e48347dac95711efa009ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:21:20Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:21:21Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:21:21Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_3220c7e9c2844373b4028a582a7fa601\",\n \"pickup_id\": \"pickup_5f249ade4ce348f5ac1a8b7fad7912a2\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC64874480\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:21:25Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_5f249ade4ce348f5ac1a8b7fad7912a2\",\n \"object\": \"Pickup\",\n \"status\": \"canceled\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1167" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb54nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710f267771164e7886aeb004ade71" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.607584" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_5f249ade4ce348f5ac1a8b7fad7912a2/cancel" + }, + "duration": 819 + } +] \ No newline at end of file diff --git a/src/test/cassettes/pickup/create.json b/src/test/cassettes/pickup/create.json new file mode 100644 index 000000000..c45eeef15 --- /dev/null +++ b/src/test/cassettes/pickup/create.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1735856313, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2025-01-02T22:18:32Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2025-01-02T22:18:33Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:18:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:32Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b09ce9251e014b1db1271d8c352a5224\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2025-01-02T22:18:33Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"tracking_code\": \"9400100208271116082716\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzNlOTc5ZmVjMzNkNTRiMzg5OWFiNmM4MzViNWFjNDkw\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:18:33Z\",\n \"signed_by\": null,\n \"id\": \"trk_3e979fec33d54b3899ab6c835b5ac490\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:18:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_803e4839c95711efa988ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:18:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_803e4839c95711efa988ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2025-01-02T22:18:32Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e8359f9746ef624ea8b341a7aa07a41051.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2025-01-02T22:18:33Z\",\n \"id\": \"pl_a8aa952fd3a243bb8cea9381cf16691e\",\n \"label_zpl_url\": null,\n \"label_date\": \"2025-01-02T22:18:32Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2025-01-02T22:18:32Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2025-01-02T22:18:32Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_7cc51ba81a7349738c5fd85de6f8a357\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:18:32+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:18:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_803bd2cec95711ef81493cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"34.10\",\n \"created_at\": \"2025-01-02T22:18:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"39.00\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:32Z\",\n \"rate\": \"34.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_45fac100d0854658862bbbfa2036de4b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.55\",\n \"created_at\": \"2025-01-02T22:18:32Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.20\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:32Z\",\n \"rate\": \"7.20\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1f29ef7db4bd46f7b82712d27669d503\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:18:32Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:18:32Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b09ce9251e014b1db1271d8c352a5224\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:18:32+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:18:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_803bd2cec95711ef81493cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208271116082716\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6550" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710f4677710b8e78854e1004a02b7" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.000854" + ], + "location": [ + "/api/v2/shipments/shp_c3ab4e43ed1d4158a5f69096d35eb444" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1217 + }, + { + "recordedAt": 1735856314, + "request": { + "body": "{\n \"pickup\": {\n \"max_datetime\": \"2025-01-03\",\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipment\": {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_7cc51ba81a7349738c5fd85de6f8a357\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:32 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 34.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 34.1,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"currency\": \"USD\",\n \"id\": \"rate_45fac100d0854658862bbbfa2036de4b\",\n \"retailRate\": 39.0,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:32 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.55,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 7.2,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"currency\": \"USD\",\n \"id\": \"rate_1f29ef7db4bd46f7b82712d27669d503\",\n \"retailRate\": 10.2,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:32 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"currency\": \"USD\",\n \"id\": \"rate_b09ce9251e014b1db1271d8c352a5224\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:32 PM\"\n }\n ],\n \"trackingCode\": \"9400100208271116082716\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_803bd2cec95711ef81493cecef1b359e\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:32 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_803e4839c95711efa988ac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:32 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"currency\": \"USD\",\n \"id\": \"rate_b09ce9251e014b1db1271d8c352a5224\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:32 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_803bd2cec95711ef81493cecef1b359e\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:32 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100208271116082716\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:33 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzNlOTc5ZmVjMzNkNTRiMzg5OWFiNmM4MzViNWFjNDkw\",\n \"trackingDetails\": [],\n \"id\": \"trk_3e979fec33d54b3899ab6c835b5ac490\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:33 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_803e4839c95711efa988ac1f6bc539aa\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:32 PM\"\n },\n \"id\": \"shp_c3ab4e43ed1d4158a5f69096d35eb444\",\n \"postageLabel\": {\n \"createdAt\": \"Jan 2, 2025, 3:18:32 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_a8aa952fd3a243bb8cea9381cf16691e\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e8359f9746ef624ea8b341a7aa07a41051.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:33 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Jan 2, 2025, 3:18:33 PM\"\n },\n \"min_datetime\": \"2025-01-03\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:18:33+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:18:33+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_81169ee1c95711efbb09ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:18:33Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:18:34Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:18:34Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_003090dc078e430ca85027782225c1ef\",\n \"pickup_id\": \"pickup_b9cc3f771cb748018cbfd60b9c42fe76\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:18:33Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_b9cc3f771cb748018cbfd60b9c42fe76\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1157" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710f4677710b9e78854e3004a042d" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.146652" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "duration": 1353 + } +] \ No newline at end of file diff --git a/src/test/cassettes/pickup/get_next_page.json b/src/test/cassettes/pickup/get_next_page.json new file mode 100644 index 000000000..be4b85b71 --- /dev/null +++ b/src/test/cassettes/pickup/get_next_page.json @@ -0,0 +1,174 @@ +[ + { + "recordedAt": 1723823831, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/pickups?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"pickups\": [\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:54+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:54+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d96685b5a4ef11ee96b5ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:54Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:55Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:55Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_a965676512e24485bf2d50e3e317752c\",\n \"pickup_id\": \"pickup_ec9e3bb5252a4db3b5c479f2954aac6f\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC63906512\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:57Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_ec9e3bb5252a4db3b5c479f2954aac6f\",\n \"object\": \"Pickup\",\n \"status\": \"scheduled\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:52+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d7d56f39a4ef11ee95fdac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:52Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:52Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:52Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_e5c8e252781e4ec0ba025ca79fbea91e\",\n \"pickup_id\": \"pickup_ec95cdda44334729af451277bacb5041\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:52Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_ec95cdda44334729af451277bacb5041\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:46+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:46+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d4c18861a4ef11eeb194ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:46Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:47Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:47Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_188e197c7b3943ca9ab572ff9ac22bbc\",\n \"pickup_id\": \"pickup_7324ea25c3fd4f5ea5182681bf6960d6\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC63906736\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:50Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_7324ea25c3fd4f5ea5182681bf6960d6\",\n \"object\": \"Pickup\",\n \"status\": \"canceled\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:44+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d31ffdd2a4ef11eea5403cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:44Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:45Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:45Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_0c35750982174f7393bbc1536ccda5d3\",\n \"pickup_id\": \"pickup_89f4f639683049d8ab5a1c8526c87cf7\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:44Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_89f4f639683049d8ab5a1c8526c87cf7\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:41+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:41+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_d162b4bea4ef11eea43d3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:41Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:42Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:42Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_cefd58afaf694649adcf39156b92f52b\",\n \"pickup_id\": \"pickup_1ce4c97001ad493fb176eb254f5c200d\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:41Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_1ce4c97001ad493fb176eb254f5c200d\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "5840" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76d7e786bc3b0035a8f6" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.184014" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 385 + }, + { + "recordedAt": 1723823831, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/pickups?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%70%69%63%6B%75%70%5F%31%63%65%34%63%39%37%30%30%31%61%64%34%39%33%66%62%31%37%36%65%62%32%35%34%66%35%63%32%30%30%64" + }, + "response": { + "body": "{\n \"pickups\": [\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-27T19:40:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-27T19:40:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_ce66bb09a4ef11ee90edac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-28T00:00:00Z\",\n \"created_at\": \"2023-12-27T19:40:36Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-27T19:40:37Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-27T19:40:37Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_bb247171f1d24634974aed83834bc665\",\n \"pickup_id\": \"pickup_c1e228bb501e491e8f166f04295268d9\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC63906734\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-28T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-27T19:40:39Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_c1e228bb501e491e8f166f04295268d9\",\n \"object\": \"Pickup\",\n \"status\": \"scheduled\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-07T19:04:52+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-07T19:04:52+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_802f63fb953311eea26dac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-08T00:00:00Z\",\n \"created_at\": \"2023-12-07T19:04:52Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-07T19:04:52Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-07T19:04:52Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_0978a9a4e0684527acca630b960bfece\",\n \"pickup_id\": \"pickup_0c7724d352b14847a4ea2aac73bd2ad9\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC63811662\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-08T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-07T19:04:54Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_0c7724d352b14847a4ea2aac73bd2ad9\",\n \"object\": \"Pickup\",\n \"status\": \"scheduled\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-07T19:04:48+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-07T19:04:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7de6733d953311eea0ffac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-08T00:00:00Z\",\n \"created_at\": \"2023-12-07T19:04:48Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-07T19:04:49Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-07T19:04:49Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_276fb7c190da4c7faeac518c4eaedf52\",\n \"pickup_id\": \"pickup_74f7ec1f63ef4a188ef9302e4f67efae\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-08T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-07T19:04:48Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_74f7ec1f63ef4a188ef9302e4f67efae\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-07T19:04:40+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-07T19:04:40+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_79566ac6953311ee8e4d3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-08T00:00:00Z\",\n \"created_at\": \"2023-12-07T19:04:40Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-07T19:04:41Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-07T19:04:41Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_7dceb3a32eb6442b90caaf167fc923a4\",\n \"pickup_id\": \"pickup_001d444c599c40b1950cbb79fadaaaf1\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": \"WTC63811660\",\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-08T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-07T19:04:45Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_001d444c599c40b1950cbb79fadaaaf1\",\n \"object\": \"Pickup\",\n \"status\": \"canceled\"\n },\n {\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2023-12-07T19:04:37+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2023-12-07T19:04:37+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_77288a7c953311ee9cb0ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2023-12-08T00:00:00Z\",\n \"created_at\": \"2023-12-07T19:04:37Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2023-12-07T19:04:37Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2023-12-07T19:04:37Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_bccf23c83abd4f09817afbc87d15dd46\",\n \"pickup_id\": \"pickup_1efd0f7107e6428a9fc605b7f1dc4b64\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2023-12-08T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2023-12-07T19:04:37Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_1efd0f7107e6428a9fc605b7f1dc4b64\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "5851" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf76d7e786bc3c0035a960" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.203378" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%70%69%63%6B%75%70%5F%31%63%65%34%63%39%37%30%30%31%61%64%34%39%33%66%62%31%37%36%65%62%32%35%34%66%35%63%32%30%30%64" + }, + "duration": 407 + } +] \ No newline at end of file diff --git a/src/test/cassettes/pickup/lowest_rate.json b/src/test/cassettes/pickup/lowest_rate.json new file mode 100644 index 000000000..9f90e4ac5 --- /dev/null +++ b/src/test/cassettes/pickup/lowest_rate.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1735856477, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2025-01-02T22:21:16Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2025-01-02T22:21:17Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:21:17Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:17Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_42f13bc38d614be690a3632e2111e029\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2025-01-02T22:21:17Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"tracking_code\": \"9400100208271116082747\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2I4MTRiNzFhMjdmZDRjZTdhMTMwYjk1ODA1MDZkNmVk\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:21:17Z\",\n \"signed_by\": null,\n \"id\": \"trk_b814b71a27fd4ce7a130b9580506d6ed\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:21:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_e23945e8c95711efafe8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:21:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_e23945e8c95711efafe8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2025-01-02T22:21:17Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e8c40d932bf9ba472a9fe4b471f9736679.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2025-01-02T22:21:17Z\",\n \"id\": \"pl_d5b40ec9c2cc4eb09d57b2d0fa3426de\",\n \"label_zpl_url\": null,\n \"label_date\": \"2025-01-02T22:21:17Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2025-01-02T22:21:16Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2025-01-02T22:21:16Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_5c7537a9197a46e4b290ea1165c1f426\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:21:16+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:21:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_e236b63fc95711efb6683cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"34.10\",\n \"created_at\": \"2025-01-02T22:21:16Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"39.00\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:16Z\",\n \"rate\": \"34.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fd9fddb987174474a7d8f252ff2ac329\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.55\",\n \"created_at\": \"2025-01-02T22:21:16Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.20\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:16Z\",\n \"rate\": \"7.20\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_24ca96e5fb6f4e668d9e9bb126b0a203\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:21:16Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:16Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_42f13bc38d614be690a3632e2111e029\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:21:16+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:21:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_e236b63fc95711efb6683cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208271116082747\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6550" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710f26777115ce7886acb004ad57f" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.902526" + ], + "location": [ + "/api/v2/shipments/shp_d12aadc2d7bb41c89f7e56f2c90554de" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1111 + }, + { + "recordedAt": 1735856478, + "request": { + "body": "{\n \"pickup\": {\n \"max_datetime\": \"2025-01-03\",\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipment\": {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:16 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_5c7537a9197a46e4b290ea1165c1f426\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:16 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 34.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:16 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 34.1,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"currency\": \"USD\",\n \"id\": \"rate_fd9fddb987174474a7d8f252ff2ac329\",\n \"retailRate\": 39.0,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:16 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.55,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:16 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 7.2,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"currency\": \"USD\",\n \"id\": \"rate_24ca96e5fb6f4e668d9e9bb126b0a203\",\n \"retailRate\": 10.2,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:16 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:16 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"currency\": \"USD\",\n \"id\": \"rate_42f13bc38d614be690a3632e2111e029\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:16 PM\"\n }\n ],\n \"trackingCode\": \"9400100208271116082747\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:16 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_e236b63fc95711efb6683cecef1b359e\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:16 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:16 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_e23945e8c95711efafe8ac1f6bc53342\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:16 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:17 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"currency\": \"USD\",\n \"id\": \"rate_42f13bc38d614be690a3632e2111e029\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:17 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:16 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:16 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_e236b63fc95711efb6683cecef1b359e\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:16 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100208271116082747\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:17 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrX2I4MTRiNzFhMjdmZDRjZTdhMTMwYjk1ODA1MDZkNmVk\",\n \"trackingDetails\": [],\n \"id\": \"trk_b814b71a27fd4ce7a130b9580506d6ed\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:17 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:16 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_e23945e8c95711efafe8ac1f6bc53342\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:16 PM\"\n },\n \"id\": \"shp_d12aadc2d7bb41c89f7e56f2c90554de\",\n \"postageLabel\": {\n \"createdAt\": \"Jan 2, 2025, 3:21:17 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_d5b40ec9c2cc4eb09d57b2d0fa3426de\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e8c40d932bf9ba472a9fe4b471f9736679.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:17 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:17 PM\"\n },\n \"min_datetime\": \"2025-01-03\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:21:17+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:17+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_e2fa515fc95711efb6cd3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:21:17Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:21:18Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:21:18Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_5040110c599048bca7b59fac6ddf65fa\",\n \"pickup_id\": \"pickup_899fa045c93c430c8d7e84adc3ee81ed\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:21:17Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_899fa045c93c430c8d7e84adc3ee81ed\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1157" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710ef6777115de7886acd004ad6bc" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.648418" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "duration": 865 + } +] \ No newline at end of file diff --git a/src/test/cassettes/pickup/retrieve.json b/src/test/cassettes/pickup/retrieve.json new file mode 100644 index 000000000..d8c9c304a --- /dev/null +++ b/src/test/cassettes/pickup/retrieve.json @@ -0,0 +1,272 @@ +[ + { + "recordedAt": 1735856473, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2025-01-02T22:21:12Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2025-01-02T22:21:13Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:21:13Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:13Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ce53650487b048c48688059d5fa6c24d\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2025-01-02T22:21:13Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"tracking_code\": \"9400100208271116082730\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzU1NzM2ZTI1M2Q3MzRlY2Y4YjEyNzY3MmY2NjBhYWY3\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:21:13Z\",\n \"signed_by\": null,\n \"id\": \"trk_55736e253d734ecf8b127672f660aaf7\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:21:12+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:12+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_e008f983c95711efaec4ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-01-02T22:21:12+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:12+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_e008f983c95711efaec4ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2025-01-02T22:21:13Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e8ae42dc566b8748be9bd58c10b8e40bf7.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2025-01-02T22:21:13Z\",\n \"id\": \"pl_cc24056d488b42f4a53abe96b86b1371\",\n \"label_zpl_url\": null,\n \"label_date\": \"2025-01-02T22:21:13Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2025-01-02T22:21:12Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2025-01-02T22:21:12Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_13ab9db8a0204dc2aff9b9770d00c36a\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:21:12+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:21:13+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_e0072f9cc95711ef858bac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.55\",\n \"created_at\": \"2025-01-02T22:21:13Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.20\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:13Z\",\n \"rate\": \"7.20\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ebf7b6ac02c84e868c0c219276b2278d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.70\",\n \"created_at\": \"2025-01-02T22:21:13Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:13Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ce53650487b048c48688059d5fa6c24d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"34.10\",\n \"created_at\": \"2025-01-02T22:21:13Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"39.00\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-01-02T22:21:13Z\",\n \"rate\": \"34.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cd8f4d4e1d244c69905bdbba79c9c924\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-01-02T22:21:12+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-01-02T22:21:13+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_e0072f9cc95711ef858bac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208271116082730\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6550" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710ee67771158e7886ac6004ad1ca" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.863532" + ], + "location": [ + "/api/v2/shipments/shp_47d30c1de3334fe88826c1016d8687ec" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1081 + }, + { + "recordedAt": 1735856475, + "request": { + "body": "{\n \"pickup\": {\n \"max_datetime\": \"2025-01-03\",\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"shipment\": {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:12 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_13ab9db8a0204dc2aff9b9770d00c36a\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:12 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.55,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:13 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 7.2,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"currency\": \"USD\",\n \"id\": \"rate_ebf7b6ac02c84e868c0c219276b2278d\",\n \"retailRate\": 10.2,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:13 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:13 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"currency\": \"USD\",\n \"id\": \"rate_ce53650487b048c48688059d5fa6c24d\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:13 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 34.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:13 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 34.1,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"currency\": \"USD\",\n \"id\": \"rate_cd8f4d4e1d244c69905bdbba79c9c924\",\n \"retailRate\": 39.0,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:13 PM\"\n }\n ],\n \"trackingCode\": \"9400100208271116082730\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:12 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_e0072f9cc95711ef858bac1f6bc539ae\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:13 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:12 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_e008f983c95711efaec4ac1f6bc53342\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:12 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.7,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:13 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"currency\": \"USD\",\n \"id\": \"rate_ce53650487b048c48688059d5fa6c24d\",\n \"retailRate\": 8.85,\n \"object\": \"Rate\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:13 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:12 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:12 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_e0072f9cc95711ef858bac1f6bc539ae\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:13 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100208271116082730\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:13 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzU1NzM2ZTI1M2Q3MzRlY2Y4YjEyNzY3MmY2NjBhYWY3\",\n \"trackingDetails\": [],\n \"id\": \"trk_55736e253d734ecf8b127672f660aaf7\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:13 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Jan 2, 2025, 3:21:12 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_e008f983c95711efaec4ac1f6bc53342\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:12 PM\"\n },\n \"id\": \"shp_47d30c1de3334fe88826c1016d8687ec\",\n \"postageLabel\": {\n \"createdAt\": \"Jan 2, 2025, 3:21:13 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_cc24056d488b42f4a53abe96b86b1371\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250102/e8ae42dc566b8748be9bd58c10b8e40bf7.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:13 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Jan 2, 2025, 3:21:13 PM\"\n },\n \"min_datetime\": \"2025-01-03\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:21:14+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:14+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_e0c673bec95711efaf1fac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:21:14Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:21:15Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:21:15Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_38562fa2203a42d5be9cecf0c5fa3407\",\n \"pickup_id\": \"pickup_fbcecc96f5ec425ca2665f4e006df009\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:21:14Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_fbcecc96f5ec425ca2665f4e006df009\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1157" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710f36777115ae7886ac8004ad32e" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.681109" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups" + }, + "duration": 1906 + }, + { + "recordedAt": 1735856476, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_fbcecc96f5ec425ca2665f4e006df009" + }, + "response": { + "body": "{\n \"instructions\": \"Pickup at front door\",\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-01-02T22:21:14+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-01-02T22:21:14+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_e0c673bec95711efaf1fac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"min_datetime\": \"2025-01-03T00:00:00Z\",\n \"created_at\": \"2025-01-02T22:21:14Z\",\n \"pickup_rates\": [\n {\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-01-02T22:21:15Z\",\n \"rate\": \"0.00\",\n \"service\": \"NextDay\",\n \"created_at\": \"2025-01-02T22:21:15Z\",\n \"currency\": \"USD\",\n \"id\": \"pickuprate_38562fa2203a42d5be9cecf0c5fa3407\",\n \"pickup_id\": \"pickup_fbcecc96f5ec425ca2665f4e006df009\",\n \"object\": \"PickupRate\"\n }\n ],\n \"confirmation\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"max_datetime\": \"2025-01-03T00:00:00Z\",\n \"is_account_address\": false,\n \"updated_at\": \"2025-01-02T22:21:14Z\",\n \"messages\": [],\n \"carrier_accounts\": [],\n \"id\": \"pickup_fbcecc96f5ec425ca2665f4e006df009\",\n \"object\": \"Pickup\",\n \"status\": \"unknown\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1157" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "379710ef6777115ce7886ac9004ad4f6" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.153489" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202501022109-2fb261155f-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/pickups/pickup_fbcecc96f5ec425ca2665f4e006df009" + }, + "duration": 357 + } +] \ No newline at end of file diff --git a/src/test/cassettes/rate/retrieve.json b/src/test/cassettes/rate/retrieve.json new file mode 100644 index 000000000..334120e50 --- /dev/null +++ b/src/test/cassettes/rate/retrieve.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823827, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:57:06Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:57:07Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:06+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_2fc788aa5be811ef811f3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_f2fb100e7468419db9f29a83a2a5d20a\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:57:06+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_2fc788aa5be811ef811f3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:06Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:57:06Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_e06032f638554e30ad70a91fcee0ea1b\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:06+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_2fc51c395be811ef811d3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:57:06Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f2fb100e7468419db9f29a83a2a5d20a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:06Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3c7c64b0d0f34fc0a0da584986569f67\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:57:06Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f2fb100e7468419db9f29a83a2a5d20a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:06Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f96267b99ff24da18c62ee3e0e2c63a0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:57:07Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f2fb100e7468419db9f29a83a2a5d20a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:07Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6e7e7f905fc44475aa503d399bea90c5\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:06+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_2fc51c395be811ef811d3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5436" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76d2e786b9080035a342" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.658150" + ], + "location": [ + "/api/v2/shipments/shp_f2fb100e7468419db9f29a83a2a5d20a" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 862 + }, + { + "recordedAt": 1723823827, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/rates/rate_3c7c64b0d0f34fc0a0da584986569f67" + }, + "response": { + "body": "{\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:57:06Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f2fb100e7468419db9f29a83a2a5d20a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:06Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3c7c64b0d0f34fc0a0da584986569f67\",\n \"object\": \"Rate\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "537" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76d3e786b9090035a432" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.216382" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/rates/rate_3c7c64b0d0f34fc0a0da584986569f67" + }, + "duration": 413 + } +] \ No newline at end of file diff --git a/src/test/cassettes/referral_customer/add_bank_account_from_stripe.json b/src/test/cassettes/referral_customer/add_bank_account_from_stripe.json new file mode 100644 index 000000000..a22b51d94 --- /dev/null +++ b/src/test/cassettes/referral_customer/add_bank_account_from_stripe.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1742503697, + "request": { + "body": "{\n \"financial_connections_id\": \"fca_0QAc7sDqT4huGUvdf6BahYa9\",\n \"mandate_data\": {\n \"ip_address\": \"127.0.0.1\",\n \"accepted_at\": 1.72251073E9,\n \"user_agent\": \"Mozilla/5.0\"\n },\n \"priority\": \"primary\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/bank_accounts" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"BANK_ACCOUNT.INVALID_PARAMS\",\n \"message\": \"account_holder_name must be present when creating a Financial Connections payment method\",\n \"errors\": []\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 422 Unprocessable Entity" + ], + "content-length": [ + "161" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "64f5803467dc7f11e2baa010002efd3c" + ], + "x-proxied": [ + "intlb4nuq 284c5d344a", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.036008" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202503202010-5de35d6868-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 422, + "message": "Unprocessable Entity" + }, + "uri": "https://api.easypost.com/v2/bank_accounts" + }, + "duration": 146 + } +] \ No newline at end of file diff --git a/src/test/cassettes/referral_customer/add_credit_card_from_stripe.json b/src/test/cassettes/referral_customer/add_credit_card_from_stripe.json new file mode 100644 index 000000000..a11a1a9ec --- /dev/null +++ b/src/test/cassettes/referral_customer/add_credit_card_from_stripe.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1742503697, + "request": { + "body": "{\n \"credit_card\": {\n \"payment_method_id\": \"pm_0Pn6bQDqT4huGUvd0CjpRerH\",\n \"priority\": \"primary\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/credit_cards" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"CREDIT_CARD.NOT_FOUND\",\n \"message\": \"Stripe::PaymentMethod does not exist for the specified reference_id\",\n \"errors\": []\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 404 Not Found" + ], + "content-length": [ + "134" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "64f5803167dc7f11e2baa012002efd6f" + ], + "x-proxied": [ + "intlb3nuq 284c5d344a", + "extlb1nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.444659" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202503202010-5de35d6868-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 404, + "message": "Not Found" + }, + "uri": "https://api.easypost.com/v2/credit_cards" + }, + "duration": 562 + } +] \ No newline at end of file diff --git a/src/test/cassettes/referral_customer/all.json b/src/test/cassettes/referral_customer/all.json new file mode 100644 index 000000000..8283a12d9 --- /dev/null +++ b/src/test/cassettes/referral_customer/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823879, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/referral_customers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"referral_customers\": [\n {\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2022-04-26T15:50:28Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"Firstname Lastname\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_634b6daa05744bfaa205058f06864363\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": \"100.00\",\n \"verified\": true,\n \"created_at\": \"2022-04-27T20:20:52Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": \"100.00\",\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": \"0.00\",\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": true,\n \"name\": \"Firstname Lastname\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_35cb81fb8af1454dabf1f6afa7330634\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2022-04-28T22:34:38Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"test test\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_fa93cc16bcc24c078ee057ce82f38eed\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2022-04-29T19:35:33Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"test test\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_4a22730cdc844ce1bc2efbed999c869f\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"test@test.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": \"100.00\",\n \"verified\": true,\n \"created_at\": \"2022-05-02T18:48:22Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": \"100.00\",\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": \"0.00\",\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": true,\n \"name\": \"Firstname Lastname\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_488e391395f4416196a31965fecac409\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2858" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7706e786c0c10035d908" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.237363" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/referral_customers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 434 + } +] \ No newline at end of file diff --git a/src/test/cassettes/referral_customer/create.json b/src/test/cassettes/referral_customer/create.json new file mode 100644 index 000000000..3ad5adb81 --- /dev/null +++ b/src/test/cassettes/referral_customer/create.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823883, + "request": { + "body": "{\n \"user\": {\n \"phone\": \"REDACTED\",\n \"name\": \"Test Referral\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/referral_customers" + }, + "response": { + "body": "{\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:58:03Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0375\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"Test Referral\",\n \"insurance_fee_rate\": \"0.01\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_7294fa8b75d247318ce711cc6346469e\",\n \"api_keys\": [],\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"referral_customer_b0719983252a4e56a479d5f902fbfdb4@donotemail.easypost.com\",\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1021" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf770be786c0df0035de2f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.607568" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/referral_customers" + }, + "duration": 822 + } +] \ No newline at end of file diff --git a/src/test/cassettes/referral_customer/create_bad_stripe_token.json b/src/test/cassettes/referral_customer/create_bad_stripe_token.json new file mode 100644 index 000000000..62c6c0e9d --- /dev/null +++ b/src/test/cassettes/referral_customer/create_bad_stripe_token.json @@ -0,0 +1,191 @@ +[ + { + "recordedAt": 1723823877, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/partners/stripe_public_key" + }, + "response": { + "body": "{\n \"public_key\": \"pk_x3JSr5eOVWNTLRej8cZDde9VQ0AT5\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "49" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7705e786c0bd0035d721" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.027043" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/partners/stripe_public_key" + }, + "duration": 234 + }, + { + "recordedAt": 1723823877, + "request": { + "body": "", + "method": "POST", + "headers": { + "Content-Type": [ + "application/x-www-form-urlencoded" + ] + }, + "uri": "https://api.stripe.com/v1/tokens?card%5Bnumber%5D\u003d1234\u0026card%5Bcvc%5D\u003d1234\u0026card%5Bexp_month%5D\u003d1234\u0026card%5Bexp_year%5D\u003d1234?%63%61%72%64%5B%63%76%63%5D\u003d%52%45%44%41%43%54%45%44\u0026%63%61%72%64%5B%65%78%70%5F%79%65%61%72%5D\u003d%31%32%33%34\u0026%63%61%72%64%5B%6E%75%6D%62%65%72%5D\u003d%52%45%44%41%43%54%45%44\u0026%63%61%72%64%5B%65%78%70%5F%6D%6F%6E%74%68%5D\u003d%31%32%33%34" + }, + "response": { + "body": "{\n \"error\": {\n \"doc_url\": \"https://stripe.com/docs/error-codes/invalid-number\",\n \"code\": \"invalid_number\",\n \"param\": \"number\",\n \"message\": \"The card number is not a valid credit card number.\",\n \"type\": \"card_error\",\n \"request_log_url\": \"https://dashboard.stripe.com/logs/req_UJTBvZhpAxDxco?t\\u003d1723823877\"\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 402 Payment Required" + ], + "Server": [ + "nginx" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Methods": [ + "GET,HEAD,PUT,PATCH,POST,DELETE" + ], + "Idempotency-Key": [ + "8528839b-26b7-4e9b-9716-28d8d71d4bfd" + ], + "Original-Request": [ + "req_UJTBvZhpAxDxco" + ], + "Stripe-Version": [ + "2020-08-27" + ], + "Stripe-Should-Retry": [ + "false" + ], + "Access-Control-Expose-Headers": [ + "Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required" + ], + "Strict-Transport-Security": [ + "max-age\u003d63072000; includeSubDomains; preload" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Report-To": [ + "{\"group\":\"coop\",\"max_age\":8640,\"endpoints\":[{\"url\":\"https://q.stripe.com/coop-report?s\u003dpayins-bapi-srv\"}],\"include_subdomains\":true}" + ], + "Content-Security-Policy": [ + "report-uri https://q.stripe.com/csp-report?p\u003dv1%2Ftokens; block-all-mixed-content; default-src \u0027none\u0027; base-uri \u0027none\u0027; form-action \u0027none\u0027; frame-ancestors \u0027none\u0027; img-src \u0027self\u0027; script-src \u0027self\u0027 \u0027report-sample\u0027; style-src \u0027self\u0027" + ], + "Cross-Origin-Opener-Policy-Report-Only": [ + "same-origin; report-to\u003d\"coop\"" + ], + "Content-Length": [ + "329" + ], + "Access-Control-Max-Age": [ + "300" + ], + "Request-Id": [ + "req_UJTBvZhpAxDxco" + ], + "Content-Type": [ + "application/json" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Connection": [ + "keep-alive" + ], + "Reporting-Endpoints": [ + "coop\u003d\"https://q.stripe.com/coop-report?s\u003dpayins-bapi-srv\"" + ], + "Date": [ + "Fri, 16 Aug 2024 15:57:57 GMT" + ], + "X-Stripe-Priority-Routing-Enabled": [ + "true" + ], + "Cache-Control": [ + "no-cache, no-store" + ], + "Vary": [ + "Origin" + ], + "X-Stripe-Routing-Context-Priority-Tier": [ + "livemode-critical" + ] + }, + "status": { + "code": 402, + "message": "Payment Required" + }, + "uri": "https://api.stripe.com/v1/tokens?card%5Bnumber%5D\u003d1234\u0026card%5Bcvc%5D\u003d1234\u0026card%5Bexp_month%5D\u003d1234\u0026card%5Bexp_year%5D\u003d1234?%63%61%72%64%5B%63%76%63%5D\u003d%52%45%44%41%43%54%45%44\u0026%63%61%72%64%5B%65%78%70%5F%79%65%61%72%5D\u003d%31%32%33%34\u0026%63%61%72%64%5B%6E%75%6D%62%65%72%5D\u003d%52%45%44%41%43%54%45%44\u0026%63%61%72%64%5B%65%78%70%5F%6D%6F%6E%74%68%5D\u003d%31%32%33%34" + }, + "duration": 318 + } +] \ No newline at end of file diff --git a/src/test/cassettes/referral_customer/get_next_page.json b/src/test/cassettes/referral_customer/get_next_page.json new file mode 100644 index 000000000..71d6074d0 --- /dev/null +++ b/src/test/cassettes/referral_customer/get_next_page.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1723823878, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/referral_customers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"referral_customers\": [\n {\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2022-04-26T15:50:28Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"Firstname Lastname\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_634b6daa05744bfaa205058f06864363\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": \"100.00\",\n \"verified\": true,\n \"created_at\": \"2022-04-27T20:20:52Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": \"100.00\",\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": \"0.00\",\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": true,\n \"name\": \"Firstname Lastname\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_35cb81fb8af1454dabf1f6afa7330634\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2022-04-28T22:34:38Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"test test\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_fa93cc16bcc24c078ee057ce82f38eed\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2022-04-29T19:35:33Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"test test\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_4a22730cdc844ce1bc2efbed999c869f\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"test@test.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": \"100.00\",\n \"verified\": true,\n \"created_at\": \"2022-05-02T18:48:22Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": \"100.00\",\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": \"0.00\",\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": true,\n \"name\": \"Firstname Lastname\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_488e391395f4416196a31965fecac409\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2858" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7705e786c0bf0035d7d3" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.382369" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/referral_customers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 582 + }, + { + "recordedAt": 1723823878, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/referral_customers?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%75%73%65%72%5F%34%38%38%65%33%39%31%33%39%35%66%34%34%31%36%31%39%36%61%33%31%39%36%35%66%65%63%61%63%34%30%39" + }, + "response": { + "body": "{\n \"referral_customers\": [\n {\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2022-04-29T19:35:33Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"test test\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_4a22730cdc844ce1bc2efbed999c869f\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"test@test.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2022-04-28T22:34:38Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"test test\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_fa93cc16bcc24c078ee057ce82f38eed\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": \"100.00\",\n \"verified\": true,\n \"created_at\": \"2022-04-27T20:20:52Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": \"100.00\",\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": \"0.00\",\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": true,\n \"name\": \"Firstname Lastname\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_35cb81fb8af1454dabf1f6afa7330634\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n },\n {\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2022-04-26T15:50:28Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"Firstname Lastname\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_634b6daa05744bfaa205058f06864363\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"email@example.com\",\n \"object\": \"User\"\n }\n ],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2285" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf7706e786c0c00035d898" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.200041" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/referral_customers?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%75%73%65%72%5F%34%38%38%65%33%39%31%33%39%35%66%34%34%31%36%31%39%36%61%33%31%39%36%35%66%65%63%61%63%34%30%39" + }, + "duration": 412 + } +] \ No newline at end of file diff --git a/src/test/cassettes/referral_customer/referral_add_credit_card.json b/src/test/cassettes/referral_customer/referral_add_credit_card.json new file mode 100644 index 000000000..8045f040c --- /dev/null +++ b/src/test/cassettes/referral_customer/referral_add_credit_card.json @@ -0,0 +1,280 @@ +[ + { + "recordedAt": 1723824484, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/partners/stripe_public_key" + }, + "response": { + "body": "{\n \"public_key\": \"pk_x3JSr5eOVWNTLRej8cZDde9VQ0AT5\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "49" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "0580883166bf7964e787564d003794f6" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb2nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.026426" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/partners/stripe_public_key" + }, + "duration": 224 + }, + { + "recordedAt": 1723824484, + "request": { + "body": "", + "method": "POST", + "headers": { + "Content-Type": [ + "application/x-www-form-urlencoded" + ] + }, + "uri": "https://api.stripe.com/v1/tokens?card%5Bnumber%5D\u003d4536410136126170\u0026card%5Bcvc%5D\u003d778\u0026card%5Bexp_month%5D\u003d5\u0026card%5Bexp_year%5D\u003d2028?%63%61%72%64%5B%63%76%63%5D\u003d%52%45%44%41%43%54%45%44\u0026%63%61%72%64%5B%65%78%70%5F%79%65%61%72%5D\u003d%32%30%32%38\u0026%63%61%72%64%5B%6E%75%6D%62%65%72%5D\u003d%52%45%44%41%43%54%45%44\u0026%63%61%72%64%5B%65%78%70%5F%6D%6F%6E%74%68%5D\u003d%35" + }, + "response": { + "body": "{\n \"livemode\": true,\n \"created\": 1.723824484E9,\n \"client_ip\": \"REDACTED\",\n \"id\": \"tok_0PoSh6DqT4huGUvd5K2dAq31\",\n \"used\": false,\n \"type\": \"card\",\n \"card\": {\n \"address_zip_check\": null,\n \"country\": \"US\",\n \"last4\": \"6170\",\n \"funding\": \"credit\",\n \"wallet\": null,\n \"address_country\": null,\n \"address_state\": null,\n \"exp_month\": 5.0,\n \"exp_year\": 2028.0,\n \"networks\": {\n \"preferred\": null\n },\n \"address_city\": null,\n \"tokenization_method\": null,\n \"cvc_check\": \"unchecked\",\n \"address_line2\": null,\n \"address_line1\": null,\n \"name\": null,\n \"id\": \"card_0PoSh6DqT4huGUvduHN4IpK3\",\n \"address_line1_check\": null,\n \"address_zip\": null,\n \"dynamic_last4\": null,\n \"brand\": \"Visa\",\n \"object\": \"card\"\n },\n \"object\": \"token\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "Server": [ + "nginx" + ], + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Allow-Methods": [ + "GET,HEAD,PUT,PATCH,POST,DELETE" + ], + "Idempotency-Key": [ + "940f9c59-9223-4e4b-a63e-29bf2a73e9d7" + ], + "Original-Request": [ + "req_kWaAqXWA7o5QHJ" + ], + "Stripe-Version": [ + "2020-08-27" + ], + "Stripe-Should-Retry": [ + "false" + ], + "Access-Control-Expose-Headers": [ + "Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required" + ], + "Strict-Transport-Security": [ + "max-age\u003d63072000; includeSubDomains; preload" + ], + "Access-Control-Allow-Credentials": [ + "true" + ], + "Report-To": [ + "{\"group\":\"coop\",\"max_age\":8640,\"endpoints\":[{\"url\":\"https://q.stripe.com/coop-report?s\u003dpayins-bapi-srv\"}],\"include_subdomains\":true}" + ], + "Content-Security-Policy": [ + "report-uri https://q.stripe.com/csp-report?p\u003dv1%2Ftokens; block-all-mixed-content; default-src \u0027none\u0027; base-uri \u0027none\u0027; form-action \u0027none\u0027; frame-ancestors \u0027none\u0027; img-src \u0027self\u0027; script-src \u0027self\u0027 \u0027report-sample\u0027; style-src \u0027self\u0027" + ], + "Cross-Origin-Opener-Policy-Report-Only": [ + "same-origin; report-to\u003d\"coop\"" + ], + "Content-Length": [ + "788" + ], + "Access-Control-Max-Age": [ + "300" + ], + "Request-Id": [ + "req_kWaAqXWA7o5QHJ" + ], + "Content-Type": [ + "application/json" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Connection": [ + "keep-alive" + ], + "Reporting-Endpoints": [ + "coop\u003d\"https://q.stripe.com/coop-report?s\u003dpayins-bapi-srv\"" + ], + "Date": [ + "Fri, 16 Aug 2024 16:08:04 GMT" + ], + "X-Stripe-Priority-Routing-Enabled": [ + "true" + ], + "Cache-Control": [ + "no-cache, no-store" + ], + "Vary": [ + "Origin" + ], + "X-Stripe-Routing-Context-Priority-Tier": [ + "livemode-critical" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.stripe.com/v1/tokens?card%5Bnumber%5D\u003d4536410136126170\u0026card%5Bcvc%5D\u003d778\u0026card%5Bexp_month%5D\u003d5\u0026card%5Bexp_year%5D\u003d2028?%63%61%72%64%5B%63%76%63%5D\u003d%52%45%44%41%43%54%45%44\u0026%63%61%72%64%5B%65%78%70%5F%79%65%61%72%5D\u003d%32%30%32%38\u0026%63%61%72%64%5B%6E%75%6D%62%65%72%5D\u003d%52%45%44%41%43%54%45%44\u0026%63%61%72%64%5B%65%78%70%5F%6D%6F%6E%74%68%5D\u003d%35" + }, + "duration": 506 + }, + { + "recordedAt": 1723824487, + "request": { + "body": "{\n \"credit_card\": {\n \"stripe_object_id\": \"tok_0PoSh6DqT4huGUvd5K2dAq31\",\n \"priority\": \"primary\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/credit_cards" + }, + "response": { + "body": "{\n \"last4\": \"6170\",\n \"disabled_at\": null,\n \"name\": null,\n \"exp_month\": 5.0,\n \"id\": \"pm_1ff40e4f4ee54a2eab85b957f199c089\",\n \"exp_year\": 2028.0,\n \"requires_mandate_collection\": false,\n \"brand\": \"Visa\",\n \"object\": \"CreditCard\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "193" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "0580883666bf7965e7875667003795de" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb2nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "2.623311" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/credit_cards" + }, + "duration": 2826 + } +] \ No newline at end of file diff --git a/src/test/cassettes/referral_customer/update.json b/src/test/cassettes/referral_customer/update.json new file mode 100644 index 000000000..fdb3ed444 --- /dev/null +++ b/src/test/cassettes/referral_customer/update.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823885, + "request": { + "body": "{\n \"user\": {\n \"phone\": \"REDACTED\",\n \"name\": \"Test Referral\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/referral_customers" + }, + "response": { + "body": "{\n \"recharge_amount\": null,\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:58:04Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": null,\n \"cc_fee_rate\": \"0.0375\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": null,\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [],\n \"parent_id\": null,\n \"has_billing_method\": null,\n \"name\": \"Test Referral\",\n \"insurance_fee_rate\": \"0.01\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_6f97218bddab44efba498134a21fd864\",\n \"api_keys\": [],\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"referral_customer_cf67554e353a4754b6ed53b9e2709fd2@donotemail.easypost.com\",\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1021" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf770ce786c0e10035df1f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.721427" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/referral_customers" + }, + "duration": 927 + }, + { + "recordedAt": 1723823885, + "request": { + "body": "{\n \"user\": {\n \"email\": \"email@example.com\"\n }\n}", + "method": "PUT", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/referral_customers/user_6f97218bddab44efba498134a21fd864" + }, + "response": { + "body": "{\n \"message\": \"Referral Customer email updated successfully\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "59" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf770de786c0e30035e02c" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.049037" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/referral_customers/user_6f97218bddab44efba498134a21fd864" + }, + "duration": 253 + } +] \ No newline at end of file diff --git a/src/test/cassettes/refund/all.json b/src/test/cassettes/refund/all.json new file mode 100644 index 000000000..73c0305cd --- /dev/null +++ b/src/test/cassettes/refund/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823872, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/refunds?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"refunds\": []\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "31" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf7700e786c07f0035d35a" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.024233" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/refunds?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 220 + } +] \ No newline at end of file diff --git a/src/test/cassettes/refund/create.json b/src/test/cassettes/refund/create.json new file mode 100644 index 000000000..c531f43be --- /dev/null +++ b/src/test/cassettes/refund/create.json @@ -0,0 +1,269 @@ +[ + { + "recordedAt": 1723823874, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_03f256d69a44470d8e39bb47baf93af1\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:57:54Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"tracking_code\": \"9400100105807076062822\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzBhZGEwYzY0YTU0NDQzYTFiMjQxMTM2MTQ2MGU2ZjBh\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"signed_by\": null,\n \"id\": \"trk_0ada0c64a54443a1b2411361460e6f0a\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_4bcd16f15be811ef93b63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_4bcd16f15be811ef93b63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e88dbc7a3cf93842f9920c71b9c3d71409.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"id\": \"pl_637972bd21af452fa61c22c68aa23fae\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:57:53Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_1553867a55f84a3bae09ab7a95a2ed22\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_4bc9c2125be811efa8b1ac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d61fb30bd1c74c19bbe5190441a9b677\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_68a60f118ce6487c948c09a8ed8736b3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_03f256d69a44470d8e39bb47baf93af1\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_4bc9c2125be811efa8b1ac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062822\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7701e786c0820035d3e0" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.972484" + ], + "location": [ + "/api/v2/shipments/shp_e2b01acfa9ce40a1beabb08665cac06d" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1172 + }, + { + "recordedAt": 1723823874, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_e2b01acfa9ce40a1beabb08665cac06d" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_03f256d69a44470d8e39bb47baf93af1\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:54Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:57:54Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:34:54Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"tracking_code\": \"9400100105807076062822\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzBhZGEwYzY0YTU0NDQzYTFiMjQxMTM2MTQ2MGU2ZjBh\",\n \"est_delivery_date\": \"2024-08-16T15:57:54Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"signed_by\": null,\n \"id\": \"trk_0ada0c64a54443a1b2411361460e6f0a\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_4bcd16f15be811ef93b63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_4bcd16f15be811ef93b63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e88dbc7a3cf93842f9920c71b9c3d71409.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"id\": \"pl_637972bd21af452fa61c22c68aa23fae\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:57:53Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_1553867a55f84a3bae09ab7a95a2ed22\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_4bc9c2125be811efa8b1ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d61fb30bd1c74c19bbe5190441a9b677\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_68a60f118ce6487c948c09a8ed8736b3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_03f256d69a44470d8e39bb47baf93af1\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_4bc9c2125be811efa8b1ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062822\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7679" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7702e786c0830035d4f6" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.154318" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_e2b01acfa9ce40a1beabb08665cac06d" + }, + "duration": 351 + }, + { + "recordedAt": 1723823875, + "request": { + "body": "{\n \"refund\": {\n \"carrier\": \"USPS\",\n \"tracking_codes\": [\n \"9400100105807076062822\"\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/refunds" + }, + "response": { + "body": "[\n {\n \"confirmation_number\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:55Z\",\n \"created_at\": \"2024-08-16T15:57:55Z\",\n \"id\": \"rfnd_6708eb7011214bd4bfbb51dc1e142100\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"tracking_code\": \"9400100105807076062822\",\n \"object\": \"Refund\",\n \"status\": \"submitted\"\n }\n]", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "297" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf7703e786c09c0035d55f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.082529" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/refunds" + }, + "duration": 285 + } +] \ No newline at end of file diff --git a/src/test/cassettes/refund/get_next_page.json b/src/test/cassettes/refund/get_next_page.json new file mode 100644 index 000000000..2ecdc2ff2 --- /dev/null +++ b/src/test/cassettes/refund/get_next_page.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823872, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/refunds?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"refunds\": []\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "31" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7700e786c07e0035d310" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.031970" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/refunds?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 239 + } +] \ No newline at end of file diff --git a/src/test/cassettes/refund/retrieve.json b/src/test/cassettes/refund/retrieve.json new file mode 100644 index 000000000..a2754f586 --- /dev/null +++ b/src/test/cassettes/refund/retrieve.json @@ -0,0 +1,174 @@ +[ + { + "recordedAt": 1723824339, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/refunds?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"refunds\": [\n {\n \"confirmation_number\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"id\": \"rfnd_8cf6654bef8445c9b19e664ed4e52e4a\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"tracking_code\": \"9400100105807076063256\",\n \"object\": \"Refund\",\n \"status\": \"submitted\"\n },\n {\n \"confirmation_number\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:55Z\",\n \"created_at\": \"2024-08-16T15:57:55Z\",\n \"id\": \"rfnd_6708eb7011214bd4bfbb51dc1e142100\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"tracking_code\": \"9400100105807076062822\",\n \"object\": \"Refund\",\n \"status\": \"submitted\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "622" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "0580883066bf78d3e7874d620036efd8" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb2nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.041848" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/refunds?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 241 + }, + { + "recordedAt": 1723824340, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/refunds/rfnd_8cf6654bef8445c9b19e664ed4e52e4a" + }, + "response": { + "body": "{\n \"confirmation_number\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"id\": \"rfnd_8cf6654bef8445c9b19e664ed4e52e4a\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"tracking_code\": \"9400100105807076063256\",\n \"object\": \"Refund\",\n \"status\": \"submitted\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "295" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "0580883166bf78d4e7874d630036f022" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb2nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.045971" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/refunds/rfnd_8cf6654bef8445c9b19e664ed4e52e4a" + }, + "duration": 252 + } +] \ No newline at end of file diff --git a/src/test/cassettes/report/all_reports.json b/src/test/cassettes/report/all_reports.json new file mode 100644 index 000000000..8a6395086 --- /dev/null +++ b/src/test/cassettes/report/all_reports.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823887, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/reports/shipment?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%79%70%65\u003d%73%68%69%70%6D%65%6E%74" + }, + "response": { + "body": "{\n \"reports\": [\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2024-08-16T15:58:06Z\",\n \"created_at\": \"2024-08-16T15:58:06Z\",\n \"id\": \"shprep_d29f8fb2230d48b6b949d3ef01956632\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2024-08-16T15:58:06Z\",\n \"created_at\": \"2024-08-16T15:58:05Z\",\n \"id\": \"shprep_904c9b5f954b4dd887cc3a5554a42560\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-12-27T19:39:08Z\",\n \"created_at\": \"2023-12-27T19:39:07Z\",\n \"id\": \"shprep_789367e2ee404ba39eb7b84b1437b25e\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-12-27T19:39:07Z\",\n \"created_at\": \"2023-12-27T19:39:07Z\",\n \"id\": \"shprep_d9b2d5f15d9942fcb91b848e9a2f3e1a\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-12-27T19:39:06Z\",\n \"created_at\": \"2023-12-27T19:39:06Z\",\n \"id\": \"shprep_8fec829b910a4a22b1366ad8af28e420\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1459" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf770fe786c1010035e222" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.055874" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/reports/shipment?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%79%70%65\u003d%73%68%69%70%6D%65%6E%74" + }, + "duration": 271 + } +] \ No newline at end of file diff --git a/src/test/cassettes/report/create_report.json b/src/test/cassettes/report/create_report.json new file mode 100644 index 000000000..ca80e2d79 --- /dev/null +++ b/src/test/cassettes/report/create_report.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823885, + "request": { + "body": "{\n \"end_date\": \"2022-05-04\",\n \"start_date\": \"2022-05-04\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/reports/shipment" + }, + "response": { + "body": "{\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2024-08-16T15:58:05Z\",\n \"created_at\": \"2024-08-16T15:58:05Z\",\n \"id\": \"shprep_904c9b5f954b4dd887cc3a5554a42560\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"new\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "283" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf770de786c0e50035e0b2" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.113861" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/reports/shipment" + }, + "duration": 310 + } +] \ No newline at end of file diff --git a/src/test/cassettes/report/create_report_with_additional_columns.json b/src/test/cassettes/report/create_report_with_additional_columns.json new file mode 100644 index 000000000..9f109d608 --- /dev/null +++ b/src/test/cassettes/report/create_report_with_additional_columns.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823887, + "request": { + "body": "{\n \"end_date\": \"2022-05-04\",\n \"additional_columns\": [\n \"from_name\",\n \"from_company\"\n ],\n \"start_date\": \"2022-05-04\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/reports/shipment" + }, + "response": { + "body": "{\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2024-08-16T15:58:07Z\",\n \"created_at\": \"2024-08-16T15:58:07Z\",\n \"id\": \"shprep_d065eed544e94cc580f22556a48f8013\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"new\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "283" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf770fe786c1030035e2a5" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.077431" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/reports/shipment" + }, + "duration": 290 + } +] \ No newline at end of file diff --git a/src/test/cassettes/report/create_report_with_columns.json b/src/test/cassettes/report/create_report_with_columns.json new file mode 100644 index 000000000..ed877aa53 --- /dev/null +++ b/src/test/cassettes/report/create_report_with_columns.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823886, + "request": { + "body": "{\n \"end_date\": \"2022-05-04\",\n \"columns\": [\n \"usps_zone\"\n ],\n \"start_date\": \"2022-05-04\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/reports/shipment" + }, + "response": { + "body": "{\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2024-08-16T15:58:06Z\",\n \"created_at\": \"2024-08-16T15:58:06Z\",\n \"id\": \"shprep_d29f8fb2230d48b6b949d3ef01956632\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"new\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "283" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf770ee786c0fe0035e12e" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.138146" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/reports/shipment" + }, + "duration": 340 + } +] \ No newline at end of file diff --git a/src/test/cassettes/report/get_next_page.json b/src/test/cassettes/report/get_next_page.json new file mode 100644 index 000000000..bc49ce44c --- /dev/null +++ b/src/test/cassettes/report/get_next_page.json @@ -0,0 +1,174 @@ +[ + { + "recordedAt": 1723823886, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/reports/shipment?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%79%70%65\u003d%73%68%69%70%6D%65%6E%74" + }, + "response": { + "body": "{\n \"reports\": [\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2024-08-16T15:58:06Z\",\n \"created_at\": \"2024-08-16T15:58:06Z\",\n \"id\": \"shprep_d29f8fb2230d48b6b949d3ef01956632\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2024-08-16T15:58:06Z\",\n \"created_at\": \"2024-08-16T15:58:05Z\",\n \"id\": \"shprep_904c9b5f954b4dd887cc3a5554a42560\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-12-27T19:39:08Z\",\n \"created_at\": \"2023-12-27T19:39:07Z\",\n \"id\": \"shprep_789367e2ee404ba39eb7b84b1437b25e\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-12-27T19:39:07Z\",\n \"created_at\": \"2023-12-27T19:39:07Z\",\n \"id\": \"shprep_d9b2d5f15d9942fcb91b848e9a2f3e1a\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-12-27T19:39:06Z\",\n \"created_at\": \"2023-12-27T19:39:06Z\",\n \"id\": \"shprep_8fec829b910a4a22b1366ad8af28e420\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1459" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf770ee786c0ff0035e18c" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.037395" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/reports/shipment?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%79%70%65\u003d%73%68%69%70%6D%65%6E%74" + }, + "duration": 243 + }, + { + "recordedAt": 1723823886, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/reports/shipment?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%79%70%65\u003d%73%68%69%70%6D%65%6E%74\u0026%62%65%66%6F%72%65%5F%69%64\u003d%73%68%70%72%65%70%5F%38%66%65%63%38%32%39%62%39%31%30%61%34%61%32%32%62%31%33%36%36%61%64%38%61%66%32%38%65%34%32%30" + }, + "response": { + "body": "{\n \"reports\": [\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-12-27T19:39:06Z\",\n \"created_at\": \"2023-12-27T19:39:05Z\",\n \"id\": \"shprep_23260a93c0464541bf87511100a27acf\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-06-07T17:51:05Z\",\n \"created_at\": \"2023-06-07T17:51:05Z\",\n \"id\": \"shprep_480eaef3080a4e6b834f0081f46e79f2\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-06-07T17:51:05Z\",\n \"created_at\": \"2023-06-07T17:51:05Z\",\n \"id\": \"shprep_bea39cf7d21b48829290104d5f058696\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-06-07T17:51:04Z\",\n \"created_at\": \"2023-06-07T17:51:04Z\",\n \"id\": \"shprep_098c647ce9684fe2a90711c7cedbd808\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n },\n {\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2023-06-07T17:51:04Z\",\n \"created_at\": \"2023-06-07T17:51:04Z\",\n \"id\": \"shprep_aea0ec64945e4f289936ec0effaed8b7\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1459" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf770ee786c1000035e1d5" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.071864" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/reports/shipment?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%79%70%65\u003d%73%68%69%70%6D%65%6E%74\u0026%62%65%66%6F%72%65%5F%69%64\u003d%73%68%70%72%65%70%5F%38%66%65%63%38%32%39%62%39%31%30%61%34%61%32%32%62%31%33%36%36%61%64%38%61%66%32%38%65%34%32%30" + }, + "duration": 290 + } +] \ No newline at end of file diff --git a/src/test/cassettes/report/retrieve_report.json b/src/test/cassettes/report/retrieve_report.json new file mode 100644 index 000000000..96d52ec1b --- /dev/null +++ b/src/test/cassettes/report/retrieve_report.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1723823888, + "request": { + "body": "{\n \"end_date\": \"2022-05-04\",\n \"start_date\": \"2022-05-04\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/reports/shipment" + }, + "response": { + "body": "{\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2024-08-16T15:58:08Z\",\n \"created_at\": \"2024-08-16T15:58:08Z\",\n \"id\": \"shprep_79e33aaf60514a97bfa3a24b7403b64f\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"new\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "283" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf770fe786c1050035e32d" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.087407" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/reports/shipment" + }, + "duration": 292 + }, + { + "recordedAt": 1723823888, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/reports/shprep_79e33aaf60514a97bfa3a24b7403b64f" + }, + "response": { + "body": "{\n \"end_date\": \"2022-05-04\",\n \"mode\": \"test\",\n \"include_children\": false,\n \"updated_at\": \"2024-08-16T15:58:08Z\",\n \"created_at\": \"2024-08-16T15:58:08Z\",\n \"id\": \"shprep_79e33aaf60514a97bfa3a24b7403b64f\",\n \"url_expires_at\": null,\n \"url\": null,\n \"object\": \"ShipmentReport\",\n \"start_date\": \"2022-05-04\",\n \"status\": \"empty\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "285" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7710e786c1060035e36f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.047575" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/reports/shprep_79e33aaf60514a97bfa3a24b7403b64f" + }, + "duration": 242 + } +] \ No newline at end of file diff --git a/src/test/cassettes/scan_form/all.json b/src/test/cassettes/scan_form/all.json new file mode 100644 index 000000000..f345dfca4 --- /dev/null +++ b/src/test/cassettes/scan_form/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723824000, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/scan_forms?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"scan_forms\": [\n {\n \"address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_883351f35be811ef8262ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"updated_at\": \"2024-08-16T15:59:45Z\",\n \"form_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240816/e85d9894fd73604ad8af0dccd779dd1aa7.pdf\",\n \"form_file_type\": null,\n \"batch_id\": \"batch_5e771df3d7cd47d2a9710fa069146f28\",\n \"created_at\": \"2024-08-16T15:59:45Z\",\n \"id\": \"sf_6eaa7fc503d54c268f98f9bfc867c05d\",\n \"confirmation\": null,\n \"message\": null,\n \"tracking_codes\": [\n \"9400100105807076063331\"\n ],\n \"object\": \"ScanForm\",\n \"status\": \"created\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "939" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7780e786ca0a003659fc" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.053633" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/scan_forms?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 256 + } +] \ No newline at end of file diff --git a/src/test/cassettes/scan_form/create.json b/src/test/cassettes/scan_form/create.json new file mode 100644 index 000000000..0459b7827 --- /dev/null +++ b/src/test/cassettes/scan_form/create.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1723824004, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T16:00:03Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T16:00:04Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T16:00:04Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:00:04Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_41f792c40c1645378f40aacaeda4eff1\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T16:00:04Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"tracking_code\": \"9400100105807076063461\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzY2MGQ2MzlkM2QyMjQ3MDRhZjZmOWZlZmZlYjUyNDhl\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T16:00:04Z\",\n \"signed_by\": null,\n \"id\": \"trk_660d639d3d224704af6f9feffeb5248e\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T16:00:03+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:00:03+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_9965e5ed5be811efbb633cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T16:00:03+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:00:03+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_9965e5ed5be811efbb633cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T16:00:04Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8c7d00d26d7714405b03c747a884a57a8.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T16:00:04Z\",\n \"id\": \"pl_67dadd60e68841cdb5924ec1e10165a1\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T16:00:04Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T16:00:03Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T16:00:03Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_de37401a07c44efdb617b48de5aa8318\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T16:00:03+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T16:00:03+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_9960ace35be811efbb623cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T16:00:03Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:00:03Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_5585c037370c4894b1e6e8ddde465a83\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T16:00:03Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:00:03Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_41f792c40c1645378f40aacaeda4eff1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T16:00:03Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:00:03Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6cf93e57f5084eb09e6d0254942ab22e\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T16:00:03+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T16:00:03+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_9960ace35be811efbb623cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063461\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf7783e7872ef600365ed4" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.132756" + ], + "location": [ + "/api/v2/shipments/shp_5819987357ec4077ba8a2e3cdfd0cbae" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1342 + }, + { + "recordedAt": 1723824005, + "request": { + "body": "{\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_de37401a07c44efdb617b48de5aa8318\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.25,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 6.9,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"currency\": \"USD\",\n \"id\": \"rate_5585c037370c4894b1e6e8ddde465a83\",\n \"retailRate\": 9.8,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"currency\": \"USD\",\n \"id\": \"rate_41f792c40c1645378f40aacaeda4eff1\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 1.0,\n \"listRate\": 33.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 33.1,\n \"deliveryDays\": 1.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"currency\": \"USD\",\n \"id\": \"rate_6cf93e57f5084eb09e6d0254942ab22e\",\n \"retailRate\": 37.9,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ],\n \"trackingCode\": \"9400100105807076063461\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_9960ace35be811efbb623cecef1b359e\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_9965e5ed5be811efbb633cecef1b359e\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"currency\": \"USD\",\n \"id\": \"rate_41f792c40c1645378f40aacaeda4eff1\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_9960ace35be811efbb623cecef1b359e\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100105807076063461\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrXzY2MGQ2MzlkM2QyMjQ3MDRhZjZmOWZlZmZlYjUyNDhl\",\n \"trackingDetails\": [],\n \"id\": \"trk_660d639d3d224704af6f9feffeb5248e\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_9965e5ed5be811efbb633cecef1b359e\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"id\": \"shp_5819987357ec4077ba8a2e3cdfd0cbae\",\n \"postageLabel\": {\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_67dadd60e68841cdb5924ec1e10165a1\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8c7d00d26d7714405b03c747a884a57a8.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ]\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/scan_forms" + }, + "response": { + "body": "{\n \"address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T16:00:03+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:00:03+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_9965e5ed5be811efbb633cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"updated_at\": \"2024-08-16T16:00:05Z\",\n \"form_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240816/e870712e8fc7a540f8affdbec43f05e4a3.pdf\",\n \"form_file_type\": null,\n \"batch_id\": \"batch_538fddbca3014777aa9600d86c9713d5\",\n \"created_at\": \"2024-08-16T16:00:05Z\",\n \"id\": \"sf_9a4bea1e7c1c45fbbbb60062700da9cb\",\n \"confirmation\": null,\n \"message\": null,\n \"tracking_codes\": [\n \"9400100105807076063461\"\n ],\n \"object\": \"ScanForm\",\n \"status\": \"created\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "905" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf7785e7872ef800366234" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.380606" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/scan_forms" + }, + "duration": 590 + } +] \ No newline at end of file diff --git a/src/test/cassettes/scan_form/get_next_page.json b/src/test/cassettes/scan_form/get_next_page.json new file mode 100644 index 000000000..a84ca3c2f --- /dev/null +++ b/src/test/cassettes/scan_form/get_next_page.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723824000, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/scan_forms?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": false,\n \"scan_forms\": [\n {\n \"address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:34+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:34+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_883351f35be811ef8262ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"updated_at\": \"2024-08-16T15:59:45Z\",\n \"form_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240816/e85d9894fd73604ad8af0dccd779dd1aa7.pdf\",\n \"form_file_type\": null,\n \"batch_id\": \"batch_5e771df3d7cd47d2a9710fa069146f28\",\n \"created_at\": \"2024-08-16T15:59:45Z\",\n \"id\": \"sf_6eaa7fc503d54c268f98f9bfc867c05d\",\n \"confirmation\": null,\n \"message\": null,\n \"tracking_codes\": [\n \"9400100105807076063331\"\n ],\n \"object\": \"ScanForm\",\n \"status\": \"created\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "939" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf7780e786ca0900365987" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.271186" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/scan_forms?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 469 + } +] \ No newline at end of file diff --git a/src/test/cassettes/scan_form/retrieve.json b/src/test/cassettes/scan_form/retrieve.json new file mode 100644 index 000000000..721181c4d --- /dev/null +++ b/src/test/cassettes/scan_form/retrieve.json @@ -0,0 +1,269 @@ +[ + { + "recordedAt": 1723824002, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T16:00:01Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T16:00:01Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T16:00:01Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:00:01Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f92d2d3d9d704efa9f111eb44d92dc84\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T16:00:02Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"tracking_code\": \"9400100105807076063447\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2UxZTYxOTRiMzk1OTQyNGJhYjc4ODI2NGFiNTk4MGIw\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T16:00:02Z\",\n \"signed_by\": null,\n \"id\": \"trk_e1e6194b3959424bab788264ab5980b0\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T16:00:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:00:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_97e698eb5be811efbac13cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T16:00:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:00:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_97e698eb5be811efbac13cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T16:00:01Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e89d345bb810744e0983e2536d773c7055.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T16:00:01Z\",\n \"id\": \"pl_182a24034ad144238fc220b364b72d08\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T16:00:01Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T16:00:01Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T16:00:01Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_5a17ef3e50fe4a09bb5f9ac954a8050c\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T16:00:01+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T16:00:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_97e37ace5be811ef8be1ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T16:00:01Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:00:01Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_648bcb63e4e145eaa903b2c4e47d7e06\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T16:00:01Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:00:01Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d55a2e62398747ad81e34a006ef01abf\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T16:00:01Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:00:01Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f92d2d3d9d704efa9f111eb44d92dc84\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T16:00:01+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T16:00:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_97e37ace5be811ef8be1ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063447\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf7781e786ca0c00365a9b" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.024436" + ], + "location": [ + "/api/v2/shipments/shp_0026d858518c4c5ebf88744ba83cd211" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1233 + }, + { + "recordedAt": 1723824002, + "request": { + "body": "{\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"isReturn\": false,\n \"parcel\": {\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"id\": \"prcl_5a17ef3e50fe4a09bb5f9ac954a8050c\",\n \"height\": 4.0,\n \"object\": \"Parcel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"fees\": [\n {\n \"amount\": 0.0,\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true\n },\n {\n \"amount\": 5.93,\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true\n },\n {\n \"amount\": 0.5,\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true\n }\n ],\n \"rates\": [\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 1.0,\n \"listRate\": 33.1,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 33.1,\n \"deliveryDays\": 1.0,\n \"billingType\": \"easypost\",\n \"service\": \"Express\",\n \"shipmentId\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"currency\": \"USD\",\n \"id\": \"rate_648bcb63e4e145eaa903b2c4e47d7e06\",\n \"retailRate\": 37.9,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 2.0,\n \"listRate\": 8.25,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 6.9,\n \"deliveryDays\": 2.0,\n \"billingType\": \"easypost\",\n \"service\": \"Priority\",\n \"shipmentId\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"currency\": \"USD\",\n \"id\": \"rate_d55a2e62398747ad81e34a006ef01abf\",\n \"retailRate\": 9.8,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"currency\": \"USD\",\n \"id\": \"rate_f92d2d3d9d704efa9f111eb44d92dc84\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ],\n \"trackingCode\": \"9400100105807076063447\",\n \"toAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_97e37ace5be811ef8be1ac1f6bc539aa\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"returnAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_97e698eb5be811efbac13cecef1b359e\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"selectedRate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"currency\": \"USD\",\n \"id\": \"rate_f92d2d3d9d704efa9f111eb44d92dc84\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"buyerAddress\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"timeZone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"residential\": true,\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"id\": \"adr_97e37ace5be811ef8be1ac1f6bc539aa\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"tracker\": {\n \"weight\": 0.0,\n \"trackingCode\": \"9400100105807076063447\",\n \"statusDetail\": \"unknown\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"shipmentId\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"publicUrl\": \"https://track.easypost.com/djE6dHJrX2UxZTYxOTRiMzk1OTQyNGJhYjc4ODI2NGFiNTk4MGIw\",\n \"trackingDetails\": [],\n \"id\": \"trk_e1e6194b3959424bab788264ab5980b0\",\n \"status\": \"unknown\",\n \"object\": \"Tracker\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"uspsZone\": \"4.0\",\n \"messages\": [],\n \"fromAddress\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"id\": \"adr_97e698eb5be811efbac13cecef1b359e\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"id\": \"shp_0026d858518c4c5ebf88744ba83cd211\",\n \"postageLabel\": {\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"integratedForm\": \"none\",\n \"labelSize\": \"4x6\",\n \"labelFileType\": \"image/png\",\n \"labelResolution\": 300.0,\n \"labelType\": \"default\",\n \"id\": \"pl_182a24034ad144238fc220b364b72d08\",\n \"dateAdvance\": 0.0,\n \"labelUrl\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e89d345bb810744e0983e2536d773c7055.png\",\n \"object\": \"PostageLabel\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n ]\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/scan_forms" + }, + "response": { + "body": "{\n \"address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T16:00:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:00:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_97e698eb5be811efbac13cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"updated_at\": \"2024-08-16T16:00:02Z\",\n \"form_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240816/e8acf5c3d531d34ff28ac55822722b0871.pdf\",\n \"form_file_type\": null,\n \"batch_id\": \"batch_794a403c269e4e0bb577c1d3af9812e0\",\n \"created_at\": \"2024-08-16T16:00:02Z\",\n \"id\": \"sf_a37db1e4995d45d3b667fa884c2bef22\",\n \"confirmation\": null,\n \"message\": null,\n \"tracking_codes\": [\n \"9400100105807076063447\"\n ],\n \"object\": \"ScanForm\",\n \"status\": \"created\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "905" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7782e7872ef300365ce5" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.366122" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/scan_forms" + }, + "duration": 599 + }, + { + "recordedAt": 1723824003, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/scan_forms/sf_a37db1e4995d45d3b667fa884c2bef22" + }, + "response": { + "body": "{\n \"address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T16:00:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:00:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_97e698eb5be811efbac13cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"updated_at\": \"2024-08-16T16:00:02Z\",\n \"form_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/scan_form/20240816/e8acf5c3d531d34ff28ac55822722b0871.pdf\",\n \"form_file_type\": null,\n \"batch_id\": \"batch_794a403c269e4e0bb577c1d3af9812e0\",\n \"created_at\": \"2024-08-16T16:00:02Z\",\n \"id\": \"sf_a37db1e4995d45d3b667fa884c2bef22\",\n \"confirmation\": null,\n \"message\": null,\n \"tracking_codes\": [\n \"9400100105807076063447\"\n ],\n \"object\": \"ScanForm\",\n \"status\": \"created\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "905" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7783e7872ef400365e07" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.100509" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/scan_forms/sf_a37db1e4995d45d3b667fa884c2bef22" + }, + "duration": 340 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/all.json b/src/test/cassettes/shipment/all.json new file mode 100644 index 000000000..6e64d2d5d --- /dev/null +++ b/src/test/cassettes/shipment/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823934, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": true,\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_030b1b61d7e141cfb08324374e6f3636\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"tracking_code\": \"9400100105807076063072\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzFhNDU3Mzg3NjFkZTQ3NzRhZWZhNjBjMDVlY2U1MGI5\",\n \"est_delivery_date\": \"2024-08-16T15:58:46Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"signed_by\": null,\n \"id\": \"trk_1a45738761de4774aefa60c05ece50b9\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6ae2d32f5be811efb4f8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6ae2d32f5be811efb4f8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8ed0c6e5cc4b14c9aa3947af893080c7b.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"id\": \"pl_53b177cdbe5642dbaf14f7160093aace\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:46Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_a111c1d2487b436883419352ed3fda54\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_6ae041595be811efb601ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_70f14f2a74c4482a8500e6aa9e637366\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_abcc372cd93d43a49349583604d6573f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_030b1b61d7e141cfb08324374e6f3636\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_6ae041595be811efb601ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063072\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [\n {\n \"mode\": \"test\",\n \"submitted_electronically\": null,\n \"updated_at\": \"2024-08-16T15:58:47Z\",\n \"form_url\": \"https://easypost-files.s3-us-west-2.amazonaws.com/files/form/20240816/6408d49f334e43e3b356e0550374bc4a.pdf\",\n \"created_at\": \"2024-08-16T15:58:47Z\",\n \"id\": \"form_31463e4d95294c0fb413fe6fbb5ade9c\",\n \"form_type\": \"return_packing_slip\",\n \"object\": \"Form\"\n }\n ],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"249.99\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"1.24995\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:44Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:44Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3ba4fdeceae445a0a276d2825b8b97c4\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:45Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:45Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"tracking_code\": \"9400100105807076063058\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzJkMmVjZTFmY2MzMjQwZmQ5N2Y3ZmJhYjU1NTk1NjYz\",\n \"est_delivery_date\": \"2024-08-16T15:58:45Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"signed_by\": null,\n \"id\": \"trk_2d2ece1fcc3240fd97f7fbab55595663\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_69930adf5be811efb902ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_69930adf5be811efb902ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:44Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8cf18db3e20874e55bf9a20f97aee8dfb.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:44Z\",\n \"id\": \"pl_dffd36f121724d69a36603eafa30b950\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:44Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_ee8d4039129f4a15bdf53915f34a6b19\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_698f52d85be811efb8fdac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3ba4fdeceae445a0a276d2825b8b97c4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_16cdbe21590a433e8caa76725f192345\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a4ca58d3d8704bbc81088e47f7ca9a9d\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_698f52d85be811efb8fdac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063058\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"6.33000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_119edccd62c24583b6e7f59ced7b5d49\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:42Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:42Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"tracking_code\": \"9434600105807076063043\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzUwOTc3YWQ1NTc2ZTQ0ZTg5OGJiMzJlODBhZTk5ZmIx\",\n \"est_delivery_date\": \"2024-08-16T15:58:42Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"signed_by\": null,\n \"id\": \"trk_50977ad5576e44e898bb32e80ae99fb1\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e807e421f9466e4883a480b82b1e71f19e.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"id\": \"pl_a8680e95f49c4f15bc068bdcd9e620f3\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:42Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_0a6f94b2055f4d7888ee1294c5b4fece\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b1784194fdd8469fade7b00b5f5e9a7e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_119edccd62c24583b6e7f59ced7b5d49\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fe13d12f237c4ece984468ced5737017\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9434600105807076063043\",\n \"messages\": [],\n \"order_id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.07000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:41Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:41Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:41Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7e2d2ac36db42ffbbc0aebb8a1e0128\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:42Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:42Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"tracking_code\": \"9400100105807076063027\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2FmMmE3NjU2YjY2NTRjYWFhMTU2N2E0NjNhMzQ3ZmI1\",\n \"est_delivery_date\": \"2024-08-16T15:58:42Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"signed_by\": null,\n \"id\": \"trk_af2a7656b6654caaa1567a463a347fb5\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:41Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8bf48473c72b74f8682106707cb6abc70.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:41Z\",\n \"id\": \"pl_111ca27882714b1fb6e539f4d0e22da1\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:41Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_d081bb2780ec4e08bb5bb8f17e58a7c5\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_38ac5fb715e14cabb3029bde5b09d9f5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4be8395f399b4279b64677dd495f9519\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7e2d2ac36db42ffbbc0aebb8a1e0128\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063027\",\n \"messages\": [],\n \"order_id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"6.33000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:30Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec4cc7aee65e451c841afb8bf730a913\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:31Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"tracking_code\": \"9434600105807076063005\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2Q3ZTNlNjNhYjUwNzRjYmY5NTUxODI2OGExNmNlZjU1\",\n \"est_delivery_date\": \"2024-08-16T15:58:31Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:31Z\",\n \"signed_by\": null,\n \"id\": \"trk_d7e3e63ab5074cbf95518268a16cef55\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:30Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8240f500213e54273b72a7aedaa0c0fcc.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"id\": \"pl_c2de163b7f2a4c848f788b3f7ff881a0\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:30Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:27Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_b7ce992c1a6146af9aa35ef207154021\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec4cc7aee65e451c841afb8bf730a913\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_56c7ac22afd448ee8182c2bc6697d74a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_142c56933c0048cea318dcb67ba08ec2\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9434600105807076063005\",\n \"messages\": [],\n \"order_id\": \"order_e4f72f9fe91a4373b85ee59ebc901c86\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "39973" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf773de786c52600361161" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.608678" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 805 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/all_parameter_hand_off.json b/src/test/cassettes/shipment/all_parameter_hand_off.json new file mode 100644 index 000000000..9c3d94b15 --- /dev/null +++ b/src/test/cassettes/shipment/all_parameter_hand_off.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823944, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments?%70%75%72%63%68%61%73%65%64\u003d%66%61%6C%73%65\u0026%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%69%6E%63%6C%75%64%65%5F%63%68%69%6C%64%72%65%6E\u003d%74%72%75%65" + }, + "response": { + "body": "{\n \"has_more\": true,\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:02+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:02+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7539f7695be811efa8df3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:02+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:02+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7539f7695be811efa8df3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_3103705e29054470b5ef1729f4c32d2f\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:02+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:02+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_753720975be811efb8c7ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:03Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6b6d838a9efb46b0afc87b8d68a7354d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:03Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4678fe663ad84319bf2a048915c9d5b3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:03Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_023b19689d764f9bbda63f754163c3c9\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:02+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:02+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_753720975be811efb8c7ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:01Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_746a08bc5be811efa8913cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_746a08bc5be811efa8913cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:01Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:01Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_5cbeb7a411be42e9935a4a9a63e9ceb1\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_74670c045be811efb994ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fc1dee8518584d8e9f6405a8da326eff\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_781ada61f2d84f8f8cfcde477e72c38f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e97eeea3d50b4df58a2ad9a91146c2ac\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_74670c045be811efb994ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:00+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:00+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_73933b5a5be811efb83eac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:00+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:00+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_73933b5a5be811efb83eac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_19c914584f004892b507902a475029ba\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:00+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:00+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_73907aeb5be811efbca5ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_af297646287d427fa0ddd3192083ed17\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_788bab7d8b5644ffa8de1fb1d2c2620c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1cc346ea52564de59d2576f4eb5a167e\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:00+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:00+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_73907aeb5be811efbca5ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:58Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:58+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:58+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_729d37df5be811efb7ccac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:58+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:58+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_729d37df5be811efb7ccac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:58Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:58Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_7a96490c9c1d4a06a727f60077a2e240\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:58+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:58+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_729ace3c5be811efbc4cac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:59Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f0e69c0ba58d4b57ae08d098771b9b0c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:59Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9b784972a375442da0d159c03b077866\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:59Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_25a6c97d8340468188d1f39005ef7488\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:58+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:58+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_729ace3c5be811efbc4cac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"249.99\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"1.24995\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:58Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:57Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:57Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0cc671f9fc474a94ba7ad618ff1ac0ab\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:58Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:58Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:58Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"tracking_code\": \"9400100105807076063119\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzU5N2YyODBlYTkyMzRmYjM4NDFkYTZhZjNmN2ExNDdi\",\n \"est_delivery_date\": \"2024-08-16T15:58:58Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:58Z\",\n \"signed_by\": null,\n \"id\": \"trk_597f280ea9234fb3841da6af3f7a147b\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_712a6f6d5be811efb865ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_712a6f6d5be811efb865ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:57Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8022596b7abe14b3c954edc6d39895460.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:57Z\",\n \"id\": \"pl_d2a1b88c8fe5441cbfaa0751c58b7aeb\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:57Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_e2e4acab9ad942409cdc77683b5858d6\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:57+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_7127a4095be811efb734ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0cc671f9fc474a94ba7ad618ff1ac0ab\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ae05d2e35fa74c58b576e020c104cce1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d37657099418405f9a1d051ad2395661\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:57+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_7127a4095be811efb734ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063119\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "30277" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7748e786c58200361b77" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.241573" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments?%70%75%72%63%68%61%73%65%64\u003d%66%61%6C%73%65\u0026%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%69%6E%63%6C%75%64%65%5F%63%68%69%6C%64%72%65%6E\u003d%74%72%75%65" + }, + "duration": 441 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/buy_luma.json b/src/test/cassettes/shipment/buy_luma.json new file mode 100644 index 000000000..2941fa382 --- /dev/null +++ b/src/test/cassettes/shipment/buy_luma.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1750095933, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2025-06-16T17:45:32Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2025-06-16T17:45:32Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-06-16T17:45:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-06-16T17:45:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_b390dd994ad911f0abbfac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-06-16T17:45:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-06-16T17:45:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_b390dd994ad911f0abbfac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2025-06-16T17:45:32Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2025-06-16T17:45:32Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_a7f70c36a6514c54906327289d5c9173\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-06-16T17:45:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-06-16T17:45:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_b38dfaae4ad911f0abb8ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"34.15\",\n \"created_at\": \"2025-06-16T17:45:33Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"39.10\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-06-16T17:45:33Z\",\n \"rate\": \"34.15\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_22cbea381a6840479dfd708d12d15c27\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.34\",\n \"created_at\": \"2025-06-16T17:45:33Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-06-16T17:45:33Z\",\n \"rate\": \"7.42\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_28560fbf722f44e69677eb8ec43da58a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.57\",\n \"created_at\": \"2025-06-16T17:45:33Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-06-16T17:45:33Z\",\n \"rate\": \"6.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b84d7ad131c240279e4c9ed023b8440d\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-06-16T17:45:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-06-16T17:45:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_b38dfaae4ad911f0abb8ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "4325" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb56nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "afd263fa6850583ce2baa979006f9a3b" + ], + "x-proxied": [ + "intlb3nuq ec99f2d065", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.268752" + ], + "location": [ + "/api/v2/shipments/shp_5571541b585f4e6c832beebed7396fcc" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202506161725-4166f0359d-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 389 + }, + { + "recordedAt": 1750095934, + "request": { + "body": "{\n \"planned_ship_date\": \"2025-06-16\",\n \"ruleset_name\": \"cheapest_delivery\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_5571541b585f4e6c832beebed7396fcc/luma" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"6.07000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2025-06-16T17:45:32Z\",\n \"tax_identifiers\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"luma_info\": {\n \"matching_rule_idx\": 0.0,\n \"ruleset_description\": \"Buy the cheapest rate that satisfies all of the following:\\nRule 0\\n \\nOtherwise buy the cheapest rate\",\n \"ai_results\": [\n {\n \"meets_ruleset_requirements\": true,\n \"carrier\": \"USPS\",\n \"rate_id\": \"rate_22cbea381a6840479dfd708d12d15c27\",\n \"predicted_deliver_by_date\": \"2025-06-17\",\n \"service\": \"Express\",\n \"rate_usd\": \"34.15\",\n \"predicted_deliver_days\": 1.0\n },\n {\n \"meets_ruleset_requirements\": true,\n \"carrier\": \"USPS\",\n \"rate_id\": \"rate_28560fbf722f44e69677eb8ec43da58a\",\n \"predicted_deliver_by_date\": \"2025-06-18\",\n \"service\": \"Priority\",\n \"rate_usd\": \"7.42\",\n \"predicted_deliver_days\": 2.0\n },\n {\n \"meets_ruleset_requirements\": true,\n \"carrier\": \"USPS\",\n \"rate_id\": \"rate_b84d7ad131c240279e4c9ed023b8440d\",\n \"predicted_deliver_by_date\": \"2025-06-19\",\n \"service\": \"GroundAdvantage\",\n \"rate_usd\": \"6.07\",\n \"predicted_deliver_days\": 3.0\n }\n ]\n },\n \"usps_zone\": 4.0,\n \"is_return\": null,\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.57\",\n \"created_at\": \"2025-06-16T17:45:34Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-06-16T17:45:34Z\",\n \"rate\": \"6.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b84d7ad131c240279e4c9ed023b8440d\",\n \"object\": \"Rate\"\n },\n \"updated_at\": \"2025-06-16T17:45:34Z\",\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-06-16T17:45:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-06-16T17:45:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_b390dd994ad911f0abbfac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2025-06-16T17:45:34Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"tracking_code\": \"9400100208303109991627\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2Q0YWIyZTM2MjI3NjRhNTdiYjM2OGZkZGQ5OThlNWE1\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2025-06-16T17:45:34Z\",\n \"signed_by\": null,\n \"id\": \"trk_d4ab2e3622764a57bb368fddd998e5a5\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2025-06-16T17:45:32+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-06-16T17:45:32+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_b390dd994ad911f0abbfac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2025-06-16T17:45:34Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250616/e81214e9e5fce34674a2a22e8e74f214bd.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2025-06-16T17:45:34Z\",\n \"id\": \"pl_d6da6de57d8d4c5e9dde46d54a24e523\",\n \"label_zpl_url\": null,\n \"label_date\": \"2025-06-16T17:45:34Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2025-06-16T17:45:32Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2025-06-16T17:45:32Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_a7f70c36a6514c54906327289d5c9173\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2025-06-16T17:45:32+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2025-06-16T17:45:33+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_b38dfaae4ad911f0abb8ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"refund_status\": null,\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"34.15\",\n \"created_at\": \"2025-06-16T17:45:33Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"39.10\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-06-16T17:45:33Z\",\n \"rate\": \"34.15\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_22cbea381a6840479dfd708d12d15c27\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.34\",\n \"created_at\": \"2025-06-16T17:45:33Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-06-16T17:45:33Z\",\n \"rate\": \"7.42\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_28560fbf722f44e69677eb8ec43da58a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.57\",\n \"created_at\": \"2025-06-16T17:45:33Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5571541b585f4e6c832beebed7396fcc\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-06-16T17:45:33Z\",\n \"rate\": \"6.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b84d7ad131c240279e4c9ed023b8440d\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2025-06-16T17:45:32+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2025-06-16T17:45:33+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_b38dfaae4ad911f0abb8ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208303109991627\",\n \"messages\": [],\n \"forms\": [],\n \"object\": \"Shipment\",\n \"status\": \"unknown\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7367" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "afd263fe6850583de2baa97b006f9acd" + ], + "x-proxied": [ + "intlb4nuq ec99f2d065", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.367404" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202506161725-4166f0359d-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_5571541b585f4e6c832beebed7396fcc/luma" + }, + "duration": 1472 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/buy_shipment_with_end_shipper_id_with_rate.json b/src/test/cassettes/shipment/buy_shipment_with_end_shipper_id_with_rate.json new file mode 100644 index 000000000..9de84371a --- /dev/null +++ b/src/test/cassettes/shipment/buy_shipment_with_end_shipper_id_with_rate.json @@ -0,0 +1,272 @@ +[ + { + "recordedAt": 1723823944, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "response": { + "body": "{\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:04+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:04+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_677bf8094d984ea6afbba5ecf2288af8\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "365" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7748e786c58400361c6d" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.055447" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "duration": 260 + }, + { + "recordedAt": 1723823945, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:05Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:05+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:05+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_769ed5d15be811efb9b1ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:05+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:05+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_769ed5d15be811efb9b1ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:05Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_7772024bbc5b47a98e999805ea24364f\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:05+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:05+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_769c5e8e5be811efbe1bac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:05Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0138c237d6924fbc8dc90d0b13d8a9ad\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:05Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_70414191b8de43e9a9c33e8ad2ba76d0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:05Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_342aeb8f2e214fa8a035068ff6326e57\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:05+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:05+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_769c5e8e5be811efbe1bac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5340" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf7749e786c58600361d57" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.606193" + ], + "location": [ + "/api/v2/shipments/shp_9a38d595aecb46acb4680994b4fac580" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 811 + }, + { + "recordedAt": 1723823947, + "request": { + "body": "{\n \"rate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"currency\": \"USD\",\n \"id\": \"rate_342aeb8f2e214fa8a035068ff6326e57\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"end_shipper_id\": \"es_677bf8094d984ea6afbba5ecf2288af8\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_9a38d595aecb46acb4680994b4fac580/buy" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:07Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:06Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:06Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_342aeb8f2e214fa8a035068ff6326e57\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:59:07Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"tracking_code\": \"9400100105807076063195\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzdiNzNhNjljMjk1ZTQ2ZjlhM2JmMWYxNTVhODJjNGIy\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:07Z\",\n \"signed_by\": null,\n \"id\": \"trk_7b73a69c295e46f9a3bf1f155a82c4b2\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:05+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:05+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_769ed5d15be811efb9b1ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:05+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:05+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_769ed5d15be811efb9b1ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:06Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8544635b053be4f1e9abbe6411ed7dd17.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:06Z\",\n \"id\": \"pl_196de9e614734d74a3ceb35c0874b7d1\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:06Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:05Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_7772024bbc5b47a98e999805ea24364f\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:59:05+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:59:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_769c5e8e5be811efbe1bac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:05Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0138c237d6924fbc8dc90d0b13d8a9ad\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:05Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_70414191b8de43e9a9c33e8ad2ba76d0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:05Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_9a38d595aecb46acb4680994b4fac580\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:05Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_342aeb8f2e214fa8a035068ff6326e57\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:59:05+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:59:06+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_769c5e8e5be811efbe1bac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063195\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7558" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf774ae786c58800361e91" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.981532" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_9a38d595aecb46acb4680994b4fac580/buy" + }, + "duration": 1195 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/buy_shipment_with_end_shipper_id_with_rate_with_params.json b/src/test/cassettes/shipment/buy_shipment_with_end_shipper_id_with_rate_with_params.json new file mode 100644 index 000000000..d40bd936d --- /dev/null +++ b/src/test/cassettes/shipment/buy_shipment_with_end_shipper_id_with_rate_with_params.json @@ -0,0 +1,272 @@ +[ + { + "recordedAt": 1723823935, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "response": { + "body": "{\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:58:55+00:00\",\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:55+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"es_cc913d68bcde470b91572f94749d475d\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"EndShipper\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "365" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf773fe786c54200361374" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.050292" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/end_shippers" + }, + "duration": 256 + }, + { + "recordedAt": 1723823936, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_712a6f6d5be811efb865ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_712a6f6d5be811efb865ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_e2e4acab9ad942409cdc77683b5858d6\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7127a4095be811efb734ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0cc671f9fc474a94ba7ad618ff1ac0ab\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ae05d2e35fa74c58b576e020c104cce1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d37657099418405f9a1d051ad2395661\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7127a4095be811efb734ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5436" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7740e786c544003613e4" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.830306" + ], + "location": [ + "/api/v2/shipments/shp_759ed62c45e34096aadebd7277e5e896" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1042 + }, + { + "recordedAt": 1723823938, + "request": { + "body": "{\n \"insurance\": 249.99,\n \"rate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"currency\": \"USD\",\n \"id\": \"rate_0cc671f9fc474a94ba7ad618ff1ac0ab\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n },\n \"end_shipper_id\": \"es_cc913d68bcde470b91572f94749d475d\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_759ed62c45e34096aadebd7277e5e896/buy" + }, + "response": { + "body": "{\n \"insurance\": \"249.99\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"1.24995\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:58Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:57Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:57Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0cc671f9fc474a94ba7ad618ff1ac0ab\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:58:58Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"tracking_code\": \"9400100105807076063119\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzU5N2YyODBlYTkyMzRmYjM4NDFkYTZhZjNmN2ExNDdi\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:58Z\",\n \"signed_by\": null,\n \"id\": \"trk_597f280ea9234fb3841da6af3f7a147b\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_712a6f6d5be811efb865ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:56+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_712a6f6d5be811efb865ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:57Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8022596b7abe14b3c954edc6d39895460.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:57Z\",\n \"id\": \"pl_d2a1b88c8fe5441cbfaa0751c58b7aeb\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:57Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_e2e4acab9ad942409cdc77683b5858d6\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:57+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_7127a4095be811efb734ac1f6bc53342\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0cc671f9fc474a94ba7ad618ff1ac0ab\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ae05d2e35fa74c58b576e020c104cce1\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:56Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_759ed62c45e34096aadebd7277e5e896\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:56Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d37657099418405f9a1d051ad2395661\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:56+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:57+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_7127a4095be811efb734ac1f6bc53342\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063119\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7655" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7741e786c546003614f3" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.889521" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_759ed62c45e34096aadebd7277e5e896/buy" + }, + "duration": 1103 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/buy_with_params.json b/src/test/cassettes/shipment/buy_with_params.json new file mode 100644 index 000000000..d93cb0fd3 --- /dev/null +++ b/src/test/cassettes/shipment/buy_with_params.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1723823923, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_69930adf5be811efb902ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_69930adf5be811efb902ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_ee8d4039129f4a15bdf53915f34a6b19\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_698f52d85be811efb8fdac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3ba4fdeceae445a0a276d2825b8b97c4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_16cdbe21590a433e8caa76725f192345\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a4ca58d3d8704bbc81088e47f7ca9a9d\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_698f52d85be811efb8fdac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5436" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7733e786c4fe0036081b" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.629884" + ], + "location": [ + "/api/v2/shipments/shp_84ff320daac94718b511207c1538cdf0" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 839 + }, + { + "recordedAt": 1723823925, + "request": { + "body": "{\n \"insurance\": 249.99,\n \"rate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"currency\": \"USD\",\n \"id\": \"rate_3ba4fdeceae445a0a276d2825b8b97c4\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_84ff320daac94718b511207c1538cdf0/buy" + }, + "response": { + "body": "{\n \"insurance\": \"249.99\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"1.24995\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:44Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:44Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3ba4fdeceae445a0a276d2825b8b97c4\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"tracking_code\": \"9400100105807076063058\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzJkMmVjZTFmY2MzMjQwZmQ5N2Y3ZmJhYjU1NTk1NjYz\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"signed_by\": null,\n \"id\": \"trk_2d2ece1fcc3240fd97f7fbab55595663\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_69930adf5be811efb902ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_69930adf5be811efb902ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:44Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8cf18db3e20874e55bf9a20f97aee8dfb.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:44Z\",\n \"id\": \"pl_dffd36f121724d69a36603eafa30b950\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:44Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_ee8d4039129f4a15bdf53915f34a6b19\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_698f52d85be811efb8fdac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3ba4fdeceae445a0a276d2825b8b97c4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_16cdbe21590a433e8caa76725f192345\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a4ca58d3d8704bbc81088e47f7ca9a9d\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_698f52d85be811efb8fdac1f6bc539ae\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063058\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7655" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf7734e786c50000360923" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.847552" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_84ff320daac94718b511207c1538cdf0/buy" + }, + "duration": 1052 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/buy_with_rate.json b/src/test/cassettes/shipment/buy_with_rate.json new file mode 100644 index 000000000..29b1c688c --- /dev/null +++ b/src/test/cassettes/shipment/buy_with_rate.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1723823957, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:16Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:17Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7d8fe25a5be811efadcc3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7d8fe25a5be811efadcc3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:16Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:16Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_2555e3065f2b4691a7973a71b9990fdc\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7d8d1df25be811efbf09ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:17Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:17Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_21e114aa3bce4d29824b9359abcc51b6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:17Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:17Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec3081571e5b4d778a5743585f8c142f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:17Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:17Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3be47e4c7e5b4aa6aca52b7173c48fe7\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7d8d1df25be811efbf09ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5436" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7754e786c8de0036296e" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.752256" + ], + "location": [ + "/api/v2/shipments/shp_a99b3696d5544ac1a5063a7d0f5d7038" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 949 + }, + { + "recordedAt": 1723823959, + "request": { + "body": "{\n \"rate\": {\n \"deliveryDateGuaranteed\": false,\n \"listCurrency\": \"USD\",\n \"estDeliveryDays\": 3.0,\n \"listRate\": 6.4,\n \"carrierAccountId\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"mode\": \"test\",\n \"createdAt\": \"Aug 15, 2024, 6:00:00 PM\",\n \"carrier\": \"USPS\",\n \"retailCurrency\": \"USD\",\n \"rate\": 5.93,\n \"deliveryDays\": 3.0,\n \"billingType\": \"easypost\",\n \"service\": \"GroundAdvantage\",\n \"shipmentId\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"currency\": \"USD\",\n \"id\": \"rate_21e114aa3bce4d29824b9359abcc51b6\",\n \"retailRate\": 8.45,\n \"object\": \"Rate\",\n \"updatedAt\": \"Aug 15, 2024, 6:00:00 PM\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_a99b3696d5544ac1a5063a7d0f5d7038/buy" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:16Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:18Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:18Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:18Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_21e114aa3bce4d29824b9359abcc51b6\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:59:19Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"tracking_code\": \"9400100105807076063249\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzFjMzQ2NzEyNjQ2YjQyNjJhOTM1MjJkYzQ2ZWUwYjFj\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:19Z\",\n \"signed_by\": null,\n \"id\": \"trk_1c346712646b4262a93522dc46ee0b1c\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7d8fe25a5be811efadcc3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7d8fe25a5be811efadcc3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:18Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8ab8a8a8cd6054124957f5de436968ff0.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:18Z\",\n \"id\": \"pl_4656020f43654ce1a2905a8ab5070401\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:18Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:16Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:16Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_2555e3065f2b4691a7973a71b9990fdc\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:59:16+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:59:18+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_7d8d1df25be811efbf09ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:17Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:17Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_21e114aa3bce4d29824b9359abcc51b6\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:17Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:17Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec3081571e5b4d778a5743585f8c142f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:17Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a99b3696d5544ac1a5063a7d0f5d7038\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:17Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3be47e4c7e5b4aa6aca52b7173c48fe7\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:59:16+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:59:18+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_7d8d1df25be811efbf09ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063249\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7654" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7755e786c8e000362a43" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.155041" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_a99b3696d5544ac1a5063a7d0f5d7038/buy" + }, + "duration": 1377 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/convert_label.json b/src/test/cassettes/shipment/convert_label.json new file mode 100644 index 000000000..f2339949f --- /dev/null +++ b/src/test/cassettes/shipment/convert_label.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823963, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:23Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d43143b1ff274c86aaa1b309a295eb17\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:59:23Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"tracking_code\": \"9400100105807076063263\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzA5ZDQxMDgwOTg2MTRmYWRiM2Q3OGYwYjc2NmE4ODA5\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:23Z\",\n \"signed_by\": null,\n \"id\": \"trk_09d4108098614fadb3d78f0b766a8809\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_80d66f705be811ef838aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_80d66f705be811ef838aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e84dc499ee756147d68df4b34eac679492.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:23Z\",\n \"id\": \"pl_c17618284675441cb2570e0c10395b70\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:22Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_5b0b226e670c4b4e9314d71750d65470\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_80d3cb275be811efaed93cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6228387051f2418bada036d885f95c75\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d43143b1ff274c86aaa1b309a295eb17\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6fb2039692b84311a5925407b9971c34\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_80d3cb275be811efaed93cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063263\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf775ae786c8fe00362dba" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.122006" + ], + "location": [ + "/api/v2/shipments/shp_070e965fd1cb43d8940afb3f8b40113d" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1323 + }, + { + "recordedAt": 1723823965, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_070e965fd1cb43d8940afb3f8b40113d/label?%66%69%6C%65%5F%66%6F%72%6D%61%74\u003d%5A%50%4C" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:23Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d43143b1ff274c86aaa1b309a295eb17\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:59:23Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:59:23Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:36:23Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"tracking_code\": \"9400100105807076063263\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzA5ZDQxMDgwOTg2MTRmYWRiM2Q3OGYwYjc2NmE4ODA5\",\n \"est_delivery_date\": \"2024-08-16T15:59:23Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:23Z\",\n \"signed_by\": null,\n \"id\": \"trk_09d4108098614fadb3d78f0b766a8809\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_80d66f705be811ef838aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_80d66f705be811ef838aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e84dc499ee756147d68df4b34eac679492.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:24Z\",\n \"id\": \"pl_c17618284675441cb2570e0c10395b70\",\n \"label_zpl_url\": \"https://easypost-files.s3-us-west-2.amazonaws.com/files/postage_label/20240816/d76049cad6b940dbb15b73e954242321.zpl\",\n \"label_date\": \"2024-08-16T15:59:22Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_5b0b226e670c4b4e9314d71750d65470\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_80d3cb275be811efaed93cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6228387051f2418bada036d885f95c75\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d43143b1ff274c86aaa1b309a295eb17\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6fb2039692b84311a5925407b9971c34\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_80d3cb275be811efaed93cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063263\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7792" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf775be786c8ff00362ebe" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.473895" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_070e965fd1cb43d8940afb3f8b40113d/label?%66%69%6C%65%5F%66%6F%72%6D%61%74\u003d%5A%50%4C" + }, + "duration": 1673 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/create.json b/src/test/cassettes/shipment/create.json new file mode 100644 index 000000000..c3e15d9b6 --- /dev/null +++ b/src/test/cassettes/shipment/create.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823954, + "request": { + "body": "{\n \"shipment\": {\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n ],\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"contents_type\": \"merchandise\"\n },\n \"reference\": \"123\",\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"options\": {\n \"label_format\": \"PNG\",\n \"invoice_number\": \"123\"\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:14Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:14Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:13+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:13+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7bd0dfa15be811efbd55ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_b03d8d40ace34f95ad754d9932d96e2a\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:13+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:13+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7bd0dfa15be811efbd55ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:59:13Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:59:13Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:13Z\",\n \"currency\": null,\n \"id\": \"cstitem_59a29e3b94a141e4805fcf7d775d4f91\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:59:13Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_e9757079588c44658eae3600c42f95b8\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:13Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:13Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_ebf9c3b2fc1848549534c9ac7c349224\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:13+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:13+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7bce5e305be811efbd54ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:14Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b03d8d40ace34f95ad754d9932d96e2a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:14Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_048e2939fd574037ab55aa2e977b9cc4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:14Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b03d8d40ace34f95ad754d9932d96e2a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:14Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3caa1977060341a69089f3de610708d2\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:14Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b03d8d40ace34f95ad754d9932d96e2a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:14Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3af0c888fe8d4e59824ef9b17c19290b\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:13+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:13+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7bce5e305be811efbd54ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6271" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7751e786c5c9003626b2" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.675065" + ], + "location": [ + "/api/v2/shipments/shp_b03d8d40ace34f95ad754d9932d96e2a" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 879 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/create_and_buy_luma.json b/src/test/cassettes/shipment/create_and_buy_luma.json new file mode 100644 index 000000000..b81335d2d --- /dev/null +++ b/src/test/cassettes/shipment/create_and_buy_luma.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1750095937, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"planned_ship_date\": \"2025-06-16\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"ruleset_name\": \"cheapest_delivery\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/luma" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"insurance\": \"50.00\",\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2025-06-16T17:45:37Z\",\n \"label_type\": \"default\",\n \"label_url\": null,\n \"label_file\": \"iVBORw0KGgoAAAANSUhEUgAABLAAAAcICAAAAAAJO2eWAAAI+GlDQ1BkZWZhdWx0X2dyYXkuaWNjAABIiZ2VeTTU/R7Hv7/fb/bFMjPGzljHkjXLIMsY21iyr6lo7FuMXUpJKpSSZCuRCEWbJW2SUhFRaH9GHqE8pUUqlUfde869597Tuefc1zmf83798f2c8znvf74A4CvBMrAIALFxSXx7D7a/n38AA/wbwbzEeLabmzP4LZ9GAfQz72v9/s1vQYeEJvKWs2t5NvPi+UkAQFbLrpaaFP/TI5adtiH6l2f+9GgvD86y7wMAR/rn7k+U2PykyLDQNIbnxrCk1GB+KCPRnh+czuByOAw3/sawyJjQ/+O6/0FSaFrSz+RsjE/nR4ZHJDH+6wp9XT0W+FenH7x+dQXRB/+z55/wkvkp/zDUr24AAQgDGpAEckAJqAEtoA+MgRmwArbAEbgCL+AP1gEeiACxgA9SQSbYBnJBPtgHDoJyUAVqQQNoBmdBO7gEroGboA/cAyPgCRCASfAazIFPYBGCICxEhqiQJCQPqUCakD7EgiwgW8gZ8oD8oSAoHIqDkqFMaDuUDxVB5VA11ACdgS5A16Db0BD0CBqHZqD30FcYgUkwDZaFVWEdmAWzYSfYC14Lh8MJcAacA++FS+Ea+CTcBl+D++ARWAC/hucRgBAROqKAaCEshIO4IgFIGMJHtiB5SAlSgzQjnUgvch8RILPIFxQGRUUxUFooM5QDyhvFQyWgtqAKUOWoE6g2VA/qPmocNYf6gSajZdCaaFM0F+2HDkenonPRJeg6dCv6BnoEPYn+hMFg6BgmxhjjgPHHRGE2YQowhzEtmC7MEGYCM4/FYiWxmlhzrCs2GJuEzcWWYU9ir2KHsZPYzzgiTh6nj7PDBeDicNm4Elwj7gpuGDeFW8SL4FXwpnhXfAg+HV+Ir8V34gfxk/hFgiiBSTAneBGiCNsIpYRmwg3CU8IHIpGoSDQhuhMjiVuJpcTTxFvEceIXEoWkQeKQAknJpL2kelIX6RHpA5lMViVbkQPISeS95AbydfJz8mchqpC2EFcoRChLqEKoTWhY6I0wXlhFmC28TjhDuET4nPCg8KwIXkRVhCMSLLJFpELkgsiYyLwoVVRP1FU0VrRAtFH0tug0BUtRpdhSQig5lGOU65QJKkJVonKoPOp2ai31BnWShqExaVxaFC2fdoo2QJsTo4gZiPmIpYlViF0WE9ARuiqdS4+hF9LP0kfpX8VlxdnioeK7xZvFh8UXJKQlrCRCJfIkWiRGJL5KMiRtJaMl90u2Sz6TQklpSLlLpUodkbohNStNkzaT5knnSZ+VfiwDy2jIeMhskjkm0y8zLysnay8bL1sme112Vo4uZyUXJVcsd0VuRp4qbyEfKV8sf1X+FUOMwWbEMEoZPYw5BRkFB4VkhWqFAYVFRaait2K2YoviMyWCEkspTKlYqVtpTlle2UU5U7lJ+bEKXoWlEqFySKVXZUGVqeqrulO1XXWaKcHkMjOYTcynamQ1S7UEtRq1B+oYdZZ6tPph9XsasIahRoRGhcagJqxppBmpeVhzaAV6hcmKuBU1K8a0SFpsrRStJq1xbbq2s3a2drv2Gx1lnQCd/Tq9Oj90DXVjdGt1n+hR9Bz1svU69d7ra+jz9Cv0H6wkr7RbmbWyY+U7A02DUIMjBg8NqYYuhjsNuw2/Gxkb8Y2ajWaMlY2DjCuNx1g0lhurgHXLBG1ibZJlcsnki6mRaZLpWdO3Zlpm0WaNZtOrmKtCV9WumjBXNA82rzYXWDAsgiyOWggsFSyDLWssX1gpWYVY1VlNsdXZUeyT7DfWutZ861brBY4pZzOnywaxsbfJsxmwpdh625bbPrdTtAu3a7Kbsze032Tf5YB2cHLY7zDGleXyuA3cOUdjx82OPU4kJ0+ncqcXzhrOfOdOF9jF0eWAy9PVKqvjVre7Aleu6wHXZ25MtwS3i+4Ydzf3CveXHnoemR69nlTP9Z6Nnp+8rL0KvZ54q3kne3f7CPsE+jT4LPja+Bb5Cvx0/Db79flL+Uf6dwRgA3wC6gLm19iuObhmMtAwMDdwdC1zbdra2+uk1sWsu7xeeH3w+nNB6CDfoMagb8GuwTXB8xu4Gyo3zPE4vEO81yFWIcUhM6HmoUWhU2HmYUVh0+Hm4QfCZyIsI0oiZiM5keWR76IcoqqiFqJdo+ujl2J8Y1picbFBsRfiKHHRcT0b5TambRyK14zPjRckmCYcTJjjO/HrEqHEtYkdSbTlD6o/WS15R/J4ikVKRcrnVJ/Uc2miaXFp/eka6bvTpzLsMo5vQm3iberOVMjcljm+mb25egu0ZcOW7iylrJysya32W09sI2yL3nY3Wze7KPvjdt/tnTmyOVtzJnbY72jKFcrl547tNNtZtQu1K3LXwO6Vu8t2/8gLybuTr5tfkv+tgFdwZ4/entI9S3vD9g4UGhUe2YfZF7dvdL/l/hNFokUZRRMHXA60FTOK84o/Hlx/8HaJQUnVIcKh5EOCUufSjjLlsn1l38ojykcqrCtaKmUqd1cuHA45PHzE6khzlWxVftXXo5FHH1bbV7fVqNaUHMMcSzn2stantvc463hDnVRdft33+rh6wQmPEz0Nxg0NjTKNhU1wU3LTzMnAk/dO2ZzqaNZqrm6ht+SfBqeTT786E3Rm9KzT2e5zrHPN51XOV7ZSW/PaoLb0trn2iHZBh3/H0AXHC92dZp2tF7Uv1l9SuFRxWexy4RXClZwrS1czrs53xXfNXgu/NtG9vvvJdb/rD3rcewZuON24ddPu5vVedu/VW+a3Lt02vX3hDutOe59RX1u/YX/rXcO7rQNGA22DxoMd90zudQ6tGroybDl87b7N/ZsPuA/6RlaPDI16jz4cCxwTPAx5OP0o5tG7xymPF59sfYp+mvdM5FnJc5nnNX+o/9EiMBJcHrcZ73/h+eLJBG/i9Z+Jf36bzHlJflkyJT/VMK0/fWnGbubeqzWvJl/Hv16czf1L9K/KN2pvzr+1ets/5zc3+Y7/bul9wQfJD/UfDT52z7vNP/8U+2lxIe+z5OcTX1hfer/6fp1aTP2G/Vb6Xf175w+nH0+XYpeW/gYv3m/g6otvwAAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAB10RVh0U29mdHdhcmUAR1BMIEdob3N0c2NyaXB0IDkuMjcvl14hAAAgAElEQVR4nOy9vZLbOrr3++9T+wIacwU99AUc76Lz01NFxe9K2On0JFQ4nojK7JVJ0awJpcTeqRjM3rFYZb+5WGudCxDb5wZEv1eAE4AfAAiSIEV9sPv5BXaLAB6AEPkXPh4AAEEQBEEQBDEudwC/dhkmwh2orgjimtzh/7p2EQiCIGwhwSIIYjKQYBEEMRlIsAiCmAwkWARBTAYSLIIgJgMJFkEQk4EEiyCIyUCCRRDEZCDBIghiMpBgEQQxGUiwCIKYDCRYBEFMBhIsgiAmAwkWQRCTgQSLIIjJQIJFEMRkIMEiCGIykGARBDEZSLAIgpgMJFgEcdt8/wu7+8v3a5fiRqBTc6yhU3OIK/Djb98BAM+fHq5ajpvgjgTLHhIs4uL8/NdvP4u/SbJIsPpAgkVcmn99/il9evj496uV5DYgweoBCRZxWb7/7Yd25eHzX69RkJuBBKsHJFjEJfn+63fD1ff/frhwOW4JOvmZIG6Sn38zTwz+8edas+tNcUMtrBhZAiCRrzkMgAd41ymSArWwiEshj7XX+fzXh4uV5La4iS5hksVIsqQjluM4zHGuKVwkWMSF+PqPFrnCGx7KurZgxUmadCmVCnNdx3XPVJx2SLCIi2AevFJ5o5J1RcFK4zTup1USnuu6zpilsYEEi7gAhaNoF7/88+Gs5bhJriRYWRzH6alGHM/12RilsYUEizg7P3/9zTruG3QkvYZgpVEcj2XL9fzLdQ9JsIgz0z7WXuP+46ezFeU2ubhgpZvh/UAzzPf8cS02QYJFnJf//sePnine2lDWZQUr20Qjq5WA+cEl2lkkWMQ5+eMf3wekevj2MHI5rsvX/w0A9/80h15SsKIoOp9xJ/DPPgh/gmBlCQBWqWqaAnCcKjgG4LnSkFwMCO+ztBzsY92q3BHZkE+dJANQRSkL0mQjrY9GKpknGQDpbvPPchxhQsqkzDRL5KSNXKp+z8mP/+zTG6y4//Z+5JJclb99BYCHF3PoHQDwC3AMz64nwe7M93BKXTEArProAcA+/7Ar31S/ugUUuYXyPXrLQ2s2rZGN+dTxAMCrF6TJhpJnnnPNnnSN1eMIpZBKW2a6A4Cw9Z5Loxeo33Py3PRgd/F4tSKfA1ENDw2h6tN4Ng7BRabz3PVZ7+KUugoAYFt8OgKAk/+t+ML6Rymz+gsFsGVbNi2RG/KpI+KVr3ZZkCYbloJV2DjU4+SXJF0qE9gK1oXq95zc1+vRkmuV+Cw8A2gTrAusJYzn7zbZ+bMBkvmfFhfJqD8eIC06igBATBVkM2XKNJp13EC2WNjnKkXum8/cZK6nDZX87g0zxJvcXh9rGtep31EZ1iF8c5xdsOLZbHPuPEqy1bvblCyfQXojEyB/obKZeMsczxN95mTWZWrVxymkiNw7n7T+3g4oq0xeEoP/XV4v6QkzMteqX+IKnLOBd7j84j9m0YMYxEl1FQDVqAoD4HLOiw6Jv+e8HGsJy8yqLou4thexneZcGiM35lMn/8ZY3nkqC9JhYwdofUHVHnzxsRjZrqLui2+uslZmatslvFD9npOej7mEydq3z788PDw8PD5/fTGEZl+e3z88PDx+/MY559++ffv27VsRL/vt+eHh4eHx4795FfhNTf8iLmZlbh9Fbr/8ZsqNZ18+vs9tZlrQ758fHx4e3v/y2+/5hWcAwP03Y77nHsM6BMO/hRNwzjOWdVJdbQEgHx/Zl3+L0ZugiBQAhVKgyE16oYp3u/n2miI351OnEJg8dlmQDhudguWU9pgaNUR+rVKKMlNrwbpM/Z6TQY96eRsqX+SJw+cXLfTluRove/jK8wm5ryLwNyns+aUYWrtXhSY3Lwxnn+Xht8evemFePkrh90ppsl+qkAeR8Fm5NX0sq+F+x+EYXnTljIx7jhnD0+qKoXxJQyCfEwsA5S13gPztQZGb8kKJT35jJk2Rm/OpU7aJRR2WBemw0S5YbnHHO+SdtSoqA+AqLaQBgnWZ+j0nQ5/1+0+6pZpn1mcl+Dd1eP+zIljPqu2v/LP46zfZQp7i2Zzbw4uS3Wd9NqEqzYua9CGrFeCSgrW9+OpkmaB5Gmwop9VVAACiUC6KHgsDpAm5vJ3gFJkZXqgjWkvRFLk5nzoeADgoXnRbG+2CFSKfxAsBLJWoom20VUpeZmovWBep33My8EGvtZ+4YTHixyo0e9YDc0H5yjkv5KnkWyFOiu/ExyLQnNv9v6XsHuvhv+TNtexBvf7A+fUE6wqDVyps213IfpxWV1sg72wcgbzHsgOKVyuHAaJxgCI39YUSr39j+7Ehcks+dTwAWLOitEVBumy0C9a2KJcPQI0aCDOKJ1V59/aCdZH6PSeDnvLHbzU7n03xnsvgX0zBgBAs3V3zkXP+KP58kbJ4AJCLiXmpdtktzIxOre8zY0m/cN4tWGeaJVx9uPZcS/b0dFPzhT5DPn1VTbrrXuT69LwBtyuCKXL/fJwAgDLhOqCsEszJLcS13WMjAK4DH0B2gmfDNer32jx8+/aoX/v6uQx9fCx7Y1//lf/x63+3GSxiPTwKofkEID+o57+qWN9/AAB+AfDjo9HOxz/yP/7xhyn4j19FocSn+/einA/PbUUrOItgpbNbcC6I3p1xLVB/fOTvUgJA2s1LGehzigit9KrcInK/fEIHyFb61QFlzfFE1DTLNaFkkwHwcyk55VfuWvV7Ne4/vTzWLv74tQx8+fYte3nOr3/+AQD443P++fFLxnn27VlJjO8AgIdvL99+f/nygMdHALnqSU2pXLv+DuBvVVk4579/eRAff+bXv34tsvuWcZ79u8jut+8ode+vL79/y35/foCy88THz58/f/78ua6H5xCszdWbV4LsaX5Dj165NC5C4dWYAPr7exYG5MNCACvJaerEsroAYqFIqpEYAHzdk2oAV6zfq/D3l8+Gq7/+AAA8/P75AQAevuQD2z+FkP1DxLr/8u35Hrh//KKOe4vEz48AHp5fvvwTAO6fhYHvZSzx1+MD8D2/+NeXzw8A3j//nivMH0LUcvV8+Pbt8R64/+VLMUL/NwD/R/z5+R7A+y/f/vksFeThn58+ffr06VP9HMbxBeuWZGIzu53WffFGxnmT4iSyuGCEkhkJPJj93YeRC1YKrY+W5T1C9O8TanUwav3ePI8v5WSf7CL/4ysAZQuH4s+vP1EJTNWyUjd7+KkYfBb9wv8lPv1PEaloGaFqa30tynL/z1yxfgOAryLmfdVxffwmYv74rrdjH8ydyxqjC1by4ZY6YsmHy7nZd+GjbGTkW0u4gNH1u5tkllPrtZkYlM8SgKSHw8sqkjMgBWJ5IwhAHnDq3SfU62DM+r1xHr9VOvPrn6WAfBBKVqGHL+L//0IpMJ/e14PFBwDAV3Xg6fFRXC10TBi5/wX4+VWk+izFzndB/eN7lZ28l/ND3vH7teyr9zy1bGzBWn24sQdkfq21YTU8AEmKGGojo15fnf4gvRxGish983ED1JpYA8pa4AExkNSGsIBcsEQL6YTG+ZXq9zw8PjSH3X+pmizf/6wcZv/dkDgXnO9lcN7JU4MBAELIfv6nKiJiYvFn0cQSRn65B3Jh+yR7Wt3nLaX/KXuR6mB67kX6x0/8P7m5v/wXejCuYGW3Iw8lq35rdM+HzwDEaYKyx1Kfs4qB9lGXGLB/oYrIA/IBsGTyksJhNiqcYlsqJYVYP/ju7u7u7i7DCPOEF63fM/L40nTGxP2nciQd3//ylx9y2E8hIY9aChEX+Cki/6JalhwdiiGjr8pprX8VBr6KT/8jQv4K4H/XDFSx/yj1THOkEIX/+QP3eTF/PP+5h2SNKljZBdc52xPPbqTR5yPvZBWHZ7gAIB/HkWgb0dVIEwDM0setjNw/HyAfdy+/0GE2KjwAdcGq6dOp84SXrN/z8lGfwhM8/166jv/8h344dC4Rn+8UhCfDz59FsOYb9b+qP6vW1tc/V9s15y2y76IpJ6w9PKIYo3+UG1jAvTD/owiW7QOlmv6/qKYF+0jWmIKVvLudIW6Z5MNtlMsDEMk9FuYDgDQMtQDaB4yLHpS7yzHsRlWLPCAfALlrQ/FhoI2SvMOmyUXtB65Hn7BWByPW7y3w8KVqShU8fis8B/Dz1z/XvDb/T5u9n4WC/N9aPtLfX6oPv1VdtVxy/gWU41YfgUKR9KU3wsQP4P+r269y/wE8Vvsg/3j+zx+NBdc53UlXsL7a0sFO2L67+J0Ap9ZVUUHlsqEdAGmx7RJA7jyOIjfFE3sNoM0Ruylycz51JF/vXVF/FjbaPd13nHtivN2Xo5YbNVQo7vU9PN05v0D9nhO1GvIFd5KAAHj4VkWXQqSL9fqseCmCv3EVcVV4pytuDsUamtzb/b2UxUt1+Vkz97Eo1Wfxh7ZBw4t0g8rO7WK54rO408ZKGq+Ftbkdb4Ya2W24N+SbV1THKXoeUM4L5HvHmTaTFjP40XxeJWrGENk2Hw3lPKKBNkpcsZ27kiICyj0W8tU1hj5h5b8Qx63P2GXq95I8v1TCJDuKfv9LNcg06lFfDy+Suf8utpkXw1DSzF/bnIC+E2HLzoQfZX38+KtlGRs1vxdtfZMbYIQ2FnBqXeUNCmn7koN4t1gQhvlr5hzLzExb+ELa06BOY+TGfOrIq+mK/YwtbHS2sLbC1E6O6gByK40BonlUZlq28QpaWz9nr99zohZC2tIgV5C/Vy2VF2kc+/FFstG67iYrWkfS2mTOOc9/A8r1f3JHNF/znIlu38eyffSFc160sH7RbiQvXLnO8Hc1+Ju4Wmz/ILch/80vt6f7dXa+6sHpigWcXFcOoG1EtWfmYqLIrfZCte3W1By5KZ86yvLf3KCFjU7BOpamyqj64uSgKHKZaT/BOnv9nhOtGB9fypCXZ0WX5P2ntMXPv4ur/34xUQaru80UCiLtYyVJVm5fiNB90SO8F1cf5Q8lDwCA92XvUdsgq6aalWQ98IsJ1s3r1QiKBZxcVyEg7SfHOdffKLcoJIrctBfKaX1jWyI35FNHEawjKwvSYaNTsISauHLUAJB6hHkjzOXDBevc9XtO9Dt9kF70TBoHknfY+6LZyFtCv3EzebB2zM6zMKboSilZefMpF7Vv6rDVY3FVSVomNO1MUzbAXqRLpWR9u5RgTUCvTlcs4OS62gPS4S4CaZ9DFpaNAxS5yS+UF3T8/LdFNudTR91gZV0WpMNGt2AFgBjeLqPWNrkpLpSZ9hSsc9fvOak/sA9f67GkQwjvP+n7DRcSor3uL+9flGBVYYphJC2zfDy8MCWyfXxRDOTm1FH3Z3HxCy/aWoo2FSqmFjHLz6/+rdwiuX7nnPPRBGsSetUybGMHcKa9w47b0PM8Lxx9B68z5HOpso7JNMpsemJ/eVHjyNszPNflqhw2+qgkeiinF/Pg93LSYg2fro7lUBTnXNu7qlCbojTfpGR5txMvVSKlifVoKGE5jvaxTKPdeIFcpOFMRK8A9yTFAl7ZEXDELWF+ZOUNRTNpfbA0eCWrT97pk4epRAvqsxIstYk+Fxa/cs55eRRF2VIqDMuF+pJffMw/S5siF+21Z86r/QCl0hTZvXDOeXUPvIz4pZakVknmIHuW3UpxKwTdd9MMQIJFnI2GR/ahfHWlsXbZIevfSu/qcx7jMZ+bK0foPyvBhQFpvvEr55w/lIdE5MrzvjD8KJXpRb92/5uWWx7luShNnqJcA/nMOeffqk5vXq7fqhba5yITrZLugBPO6wCAzXh7kJyf5QneF3c4ua4Iook75dPjjx/Fnw+f/wrge+V4df+pamp9//W78lD+LD3GH365B77/UXhBfXmuB//843uV8utfga9/A/D+8b7aiOa58EX9/peqbPkQPKSVQfeP74Ef/13k9umzKM2fiwuP7+XsxKY2f/uqB/z+HmBFkvt74KHIKucOOLXVsMWkOGESCKAWFnE21Of084vU/3v/25fH6pM01i4m8xQzv5uPvP/UHgzRwnqoXf1WGq4SfikuPdaiFwUuYnwzh3/jvL6BfD429rl2Ra+kk6pZ93O5dZpO47MAIMEizob6nH5WHTgrDA5Zqh2jJH0qgxtX73w1yYtpsKsSkccGU9KYljG7L5xz/biJ8rpyls7ognWcmF6ZZ97tAEiwiLOhnRbIOee/P+hPr+woWjpkaYZeaqnuv0jButH73JP+q+FEHfmIwXLYvRKxRxFJ38f4UZ4GqB1bWIyf1RdZfaqXf3TBmuCG2YNPsgdIsIiz8ag8pebFz1+q6JVD1qNuSZ5NBLTVO3rL7fGlOkj15ZOSXbX4WSng79qVR7WU9//kLdlJS4y0IzSqdFKKsQVrMg4NMkP9RwESLOJsqA2jcm6w0hDZUVR62e9fDLaqs+ofPn6rBz8XRh//zfnL4+Pj46Nou2Vfyt2t7vUzD/OFipI+PhYXqt0GH/9Zdw97+ViVRnF2bQ748svjw8PDw4MuxifOEq7Otr+oh9P2cmvDNWxqYgPNEhLn5MevX6sPnz/pl/9euTX8/LXaCetRbYSV/PzjB4D79+ZQ/PjxA7h/NI13/fHjJ4D3tSNQ//wDQDHdCKCYJRSThn/8+Am8f2gY089LU8/v5x8/f7YUU+fuJMFKPgxNacZ1HOaqhxRkCdI0zcbVrnCY5xgJFnFevuaHdAHA57+XL/ePX7/i8dNj8fHnv34rd2x5kKcPz8s/hEg+SJN7smBdhpMEKxvxvAnXc9y28bAkTZLxVOswaNNuEizi3EiSJdyvBD+kbTv/W9q7+JM2WnVGcr2SG1hTE6ynkc7zcjzPs5psjJJoHIn0BzmPkWARZ+fH12obO1Pz6fuv38u/P31sdKoamx9/y7N9lv0UriFYGDyQvB6lBE7Yawz8sBxlXnKQ+yhAg+7E2ZFn1eSVhHqYNvd3VkoPCtnPQRp0vxgnDLqnH0bYEdn3+2/4n0Sbk3N2Dt1xalALi7gIP6Szuz7+/aH8Wx68ksa0zo7UqvtdGYq/Rgtr8J7up+/gzsLDdsABJe7ysD714Lj0Fo8jIwgAwIO0kbt0ds2/qjNT5aNUz82Pv1VLBr/Upg4vzlDBWp06BM7Cw3Kg7rDgsD6xZ7i63QMzCOK5cuEszuz7/p8fS7n6ZF61cx5+fC3+ujeflHhZBnYJT+0QsiA8cVHPZnXSAPwA1wbqEhKXQ/bK+uWvP//re/np+Z8XG2sHUO3J8P7fD8aQScwSzk5rYAV9zodqYnHKWBY79BZMEizikvz4h+kQnEsOXgnExjL3f/9cC5nOGNbmJL1ydicPQgHAcn/CEb3ZqjsOQVyRh3/Xndgfvl1u8Krg8RHA4++fL52vmUGClZ20JCfcj3RSpbPdDu9XjuRE1otEOwc0SdrDWyzVDoaNG3vIqWa1OSZxW8jHqALqUaoX5BMev9U3Xbge/b0hTjk0lY16jtJh+OB77wNShtVVyc4HAKc8uOUQMAD+oSE89Ep0S3pKztcuAKdhHwpfdjtrjUncHPJBzIZTci7D7w3Xf3t+fn5+bth+/Sxg0Es4cPEwAMA77eSaOoPF0+mb06C6qpfTEZ6yxc6HbGsOl0qqWdJTVptmGA/ZOMh+sq0xiVukmBG8pKPozWJ6H7o5oUd30ikQZtZDu4V9m3qD6qpgC7DwcNx6+WljRwaE+/2SgR2M4YBrbmHpKTkPAH932Hnm6vWlO22PSdwmvz/W93p5owwSrNrhlvac5ZzKobs0931nTxIspzjHNRBnHYf5kce7vBx6+K5RUPWU1R+eeiop55zvlq4kzW0xCeL2GSRYg2f42JnO1d0PHMjq2S06RbB25U6nRwaPc+4UXVIP7GgIXzfmpaXk3C82qt8p574XRZYEqyUmQUyAIbOEm6GTTGx3pg1K3d0wxbrg+pxE7EkIgLmIgSRFXhk+srgejhQN7UY9JbIIgYjr7Xatjh72MQniRukvWEMdmNhAWTmf6Qt6NmSAUsSk/OwBST0cGRpuSU+JuNQ6eJ7W+uVcnpVoi0kQk+A/+iYY2sA6o14BbDerOSZ1k6QXe2sDr2wxJfCAtJQdB0jr4UjhZJs0dR1fa2npKSUF68I+JkHcKL1bWEMbWNuzvits0Fzh5ZpYjle0bVZZLlhFgV1k9XAkSN4tNvFq/k4rpJ4SAFj8dHd398Hiq7GPSRC3SF/BGtrAWo/k3d6EO2QT0StsMrNZwA0ByfecmcKRIcncwHeQPamlrKVMgM0sApAsOlak28ckiBulr2AN/G0Oz34gmDfgZIn00otU0tkcrGWr1jI8Bthuv94elsC8s5RzBNvd2kMyGy8mQdwiPcewBjaw/GHn1PQijPuvyI5OWWTUm2y1Atxt48CZFO6E8F0ACLHAZgkkoknkmnu+Ow9A8BQlm6BHTIKYIn38IIZ17JyLLATpv2EM/D72+9aVztYBWO7+5FWmPHj1cAkGh5cVv6un9CoXLsCTYuaE5d96TIKYGH27hAMaMQBwwqYKPXD6N5eiCw7lzJ9ShIe8jNIMRGIKl3CRqh9rKZH7VDGv8/BZ+5gEcYv0E6xh02rhhSbTB+wKeLnXdraBd1hKyl3IUO5xVQsvEJVXNZL0lG4lYo4es2ZJiUkQk6OXYA07u2HIcPgw+p88NsB7axiLGMGukgmvzDoWs31auIRWxFpKR1awVuxjEsSN0kuwBulV26zYyHi9h9guJVjpCr5cD27ZuBOLcvTwD3cfyqRQ7kpPCa9qJybtjqH2MQniRuklWIN6hMEFux+9R7Eu1SWMAKWdyfxi/GwD162He0jyoq1S+G0p4bjFGUAbTdt07GMSxI3Sx61h0EHxzsU6hAA8t2+TKb7MixvLzVMnAIIom28BzMVaZj08WOFp6wFYreCoDghaSiB8SudrBsQLsHbFto9JEDeL9ZzioAX+o+6I3Env7mePXVZ61ZWG0sr0OOc8BJwwdMvtsLTwNQA38B0U+2RVqCk55wHAvMAFsOV1QnUDv5aYBHHj9BKs4xC96uXpNAJ9+589dvE7RbCUPIULVCgXoB5euIJ4ul5pKaULjvHHQRas9pgEceP0Okh1NeSsnMOFJ9AXPdcOufYb1I99LmG6SeH4zYPfUZIwc3gtZRqlqevatIDtYxLEzdHrINUPA6bUgstNEQrSdz0T2EsQHaRKENelz0Gq6RAXgIsP7Tp9Gw/k8U0Q08F+lnCIT8MlXRpyvJ7lJBfKQdw1hlTjDHfyBzmZHkUxaWjElpnxejtX+VyVyjDaUeZt+Hwn/2VOpRdPz1gvt8EQ1z4YinsHNaStNkxV3ZhKr0RDqubMBn9hCoaHgatVb9GBsW9hDRGsK8ydBz3XLV7M150giJOxFqwhPcIrNLCAnn1CamERxHSw7hIOaWBdZTLK7+feepGNJAiCGAVrwRrQwHKvsvyj/4JCgiAmgm2XMBvQwqI9LQmCGBVbwRow+8/IPZEgiFGx7RIO6BHqJ+oRhECf9VZcB9pcme/kv5S5dpHe4FpQUc7gGzyADZ4Meirlg0VeekGb89MTy3m1Ona3pbKpRC1Vc2ZKvbV5q5wf2xbWgB4hNbAIghgXS8EacCCWQ4PfBEGMi6VgDRjCogYWQRAjYylYQ4aw+ichCIJo42wtLEabhhMEMTJ2s4QDhrCogUU0oU+bVQuQIf2lTzqZF+02r8I2GIY8u1VNqMmRoc1+3RlToT4Tx+WyK/Gh3bF+e2UpzYuhG9YYm9dLt1aHdgcVvarekOqC2LWwBvQIacidIIixIcEiCGIynEuwXPIaJQhibOwEq/+YOzWwCIIYHSvBoh7hOMRaRSb655h25yKINqxmCQccoEpODTrRJgbgh0XNpKsoA/xlsclhvIkAOH7IACwUKVu69QsE8UbpPg2s/07H7vmPKLs4dnXVRLnXzlp83ueDfCw/0rSsY2fPOVcbqDvDhSvT+jjlFaV8qCfjcmAZVw3XUvF6ZJNVORY3f3FyWQ2pdHvmm6zdsaFsWnYNlaibaKuO1s/mXPQitCYxVz2MX1hz1Rsw2Obyt2Pxelm2sPp3CalHqLHYwA29bLPJ5q4LIJtlCH3Eq2zuOgCiFVgQsHgTp097JjdQ0xQO6hcI4o3SKWu9j1PudQL8ZLCrKzMHwD1yzvmelSfVLznnfFeeVZ8fSR9olXd0tMqsXbgKrY8TqIVlvIPmStRNtFVH62dzLnoRWpOYqx7GL+zyLSzDDTZE68X1+yzjY1dXZqrz4tfAgXPuwBGfPbAj5zsgFJ+PuaJVKZWPhgtXofmr5yRYJFhGDLZ5b8GymSWkScKTScrddnwgApK02EDaRxYDSVllzFWcSOIVUw/Prl0giDeEjWD1nySkSSyNatiJAQmQlHXkAQmQNdRZNkfotF4giLeEzaB7/xYWvVIait9/BqSlQDlACgReGSWRm6er1FWnaGsXXgPKul1e/yz/0XDys3l3X/OWylWSrlRa2tbTlQ15VR8a4XLK5o2U2zZL5lpGzQcy68Wz3tmYa7dXpSqzHDBuNAj7o+r7QIKlwRBnQpGSQrAKgXKTDHDKGltlkmClKywVO7ULBPGmOM8YFgmWhgesxF+rQrMK1EWXmwWkJtRcP2WxdoEg3hQ2gtV/vQgJlkbAsFoByJ5aT/NIZ3NIY+pxDLX/V7tAEG+L87SwaNBdg22BxZ9mH/4UMbdRzrPFuxjuvqq8ld6eql0giLeF7TFf/aC9ZXS8vYMsTuAdWJNgRR9WYMt9FRrH2uHZtQsE8cawGHTvv7cMNbDquIckAnxXOIm4VaUW7df5BghDWeojOOpG07ULr5Ryxqlhc+OuvXnLmPrslnnyzrBLsvKhmoTU5/MM05PyTJ2S152c0nyH+gwmtEDDfeqJeT2cy1FaDckTtF2zfg2VdnbOMktIDSwTrtDxNNfzNG9KZeLzLIa3Vl2uNtrG+LULBPHWsOgSDjhDdUBB3goR4BTuogAQC31fxAh2jh4zaL9AEG+NswgWtbB04tmsEigfcMuetliUkyWgCHkAACAASURBVK7g6ytuYsk7y3yBIN4a5xl0JzScON4AANINAgYwH5HwFtnAdYEINYfQLNJ7hPoFgnhznGUMi9oBOo4Xb9wASJ8gPKmCKJtvAczFKugY2FSRA4hL6uRF7QJBvDksBOuqju5x/znKfjiXGRZazrL5xktiQIyse+EqeucjThAEANLSEx6AVwiW6nNVu0AQb5GuPWj6vyUj7oZ1dsdu+82lgOH7YXGe+1cVOyKXdxaUtrUiucWOWQW1C9ekuUJ5935YvL77kyFWzZ6Wv+GD+aqSsWJe+axHLPM2l81UHcbsmjecqjJSrOqfNRNVpeiVZL7UWkkdJRz+hRnQM6riFp/1ctU41+JnooZ72KSJK7XnlsEmheOLXp7hK953XiCINwf5YV0Mve/p0L4LBNETi1lCWkpIEMRtYNHCosM9iYlgXlqjf9D7341La8R/vDlyH5OGz5dd1PI6oDEs4hUhra5rVoOOSIYNRxuNGU01LnUkgTodEizi4lRLg+XluNWKW15ft6uv84WWZLRNes1qczeKdUODTdc8ZcfnamPklkTFqmw5lRRiTHXXmMq8PlpfQV5dEp8vqMTk6U68Trq2dDAnakzVHDJaFoQFJFjEK8Lmp765R9iuJSRZtwAJFkEIOnVkNKEhyRoMCRbxmpDaTN2ioDawLERkPJ0hxRoICRbxtmiSCisJGVGxSLIGQbOExGVRtvK9qwXYJJTntUYbWLKMdoYJMXmmrtqIuatAyvyedXUMS4UyVpm++rb03abPO2VIgkW8Kri9gslv1p1tUD/FanPOOof2vX5IsIjXilERmvysZHTfdvUsjGE6w+vZkGINgMawCEKlvlPLaJZ7D/MTGmcRrHNvukcQjVirS9OEosGAcukkmaFG1YlYCBbtvUBME4O09PV1aLs4iPG0721iIVi0uxXxutFX5hloGaDvCbWxToIG3YkrUq7wRbmI9k4KU9Cn45vW+VrOE9rtE3MG5PLdmdYg85ZKkJI2OXoMTtVcJa1HSutf4HmhMSzi9VKTruGNoxFfRWpjnQB1CYnXhpUg9FrDozHi0BONYvXEoktIpwyORRqnCRzm69MYSeZWvwqJPsuRpq7ymxEzLUKsHghdMxDTgdG2tGhdD4/UzlxIpk6h62id/idt2R+d1cmrOeaL80N5CoW3VwJ21cFoh4AB8A9ysC8fmxY6AOCWh4XxtQvACXmTAS18LJorlHcc82W4VCY0fdYuKVnAEFktXGOpbaJ3JzYm7bYnx1ArTbrLJgOtVd2cbXeqhsz4CV+YgsFQdcfc8pivji+J8yGa4XZmbM3rEaw9A+B6ngOAyYp1dErB2udNqer0Qs4P0jmPx7LtFORXChF0j2YDWvhoNFcov75g9byOpuiNt9yetNueHEOtNOkumwy0VnVztt2pXotg7czZt9GZsTWvRrAOrGj4HHyASfrho5CkIwPC/X7JwA5ycClYIeBtj4e1A6w555wHgL877LxcwWoGtPDxaP3u0SZY+lUtbRWlOTPddi2JarHjOppiN99ye9pug3KM2n3petySWK40LVVXsl6puPELU2K1FtFgRcm4+NxQXZrhrkgDBGu8n/NXI1heoTHipqo+2hYoJCkElpxzviv1Zbd0IXUYi+IemTgFuozoAQeDAT18PJorlN+UYDUZsojcds+taS0MtlUdCVYzrZVacDBn38Z4Z9W/FsHaAX71yQEr/jwwuEWFOcVh9F7eBNOqcw3sy2o5cM79oqm2E0qlG9DDx6O5QvkNCFZn36/BuvU9t6a1MNhWdSRYzVi5NQyYYkr7J3nlbADpoGcfWeGrNs98L/8zSYvToaVwmVReJ5UCWYRADFp5u51fN6CH3wSc87u7O/2pFp/v7op97e7qG9xVz7tIL6LcGWJOjPLGxH1VN2ad6u7MqfSqrmTp7k75As7/bdg4jvZ3xCLB0sgi+JLwB7tdrjyLmK2Lq0mpR15+3jbnShvT8TzpAxADxQXPc+oG9PC3yNTVjFCxWZrj9vZc73+6/SsnUdeQl45RyQrr8vegakA5Zs0PSseIGI5Ts1ozoIe/HYyeTl1rUIgJcJ4WFgmWRmyWjuwJYdVVS6uqdpG1WXtKig4mi5/u7u4+rJoMKOEEMXVsWlj9OxNZRut5bFiljtTjkzSqpfoWKwBs7QNIgM0cAJIk2rG6AT38DVE1sQz7elIDa7rYtLAGjH7Q8mcbohW2w3SEFdo0R7DdrT0kM3PErvA3BI1mvQbO08JCcitzUrdMNkfYf4wp8JBs0nmSj9XvPADBU5RsAmP0rnCCmBI2LawBA7c0iGXBU+Yuu2PpOJ4XHnxsNgCAUEwDroHIGLsr/PLIngt3kKbIueyFhPpcezkPf2fwjKg5/7R5ip14B6cj3RiXbqy6vSq40eVNTqVXR7MvVFuqlsw0Vy1DiPBvaM54LGxaWIy1jQAbIcFScYFEcknADO4yjuEsACABohiBI83GdtXfOkIcAEDekmVeHCvTuYUBJfxtkg9i2fQIW8+xUVWGuA5WO47292vIkjc6n96Ap2pQHIt+dtnq2QCeAyDNu9+ZsVkbl/4QzE0ywI3LaEW3XTFgCCdq0GYvU8Jqx9EB4vNmf8/NMA+R5FkVAy6Yl+MArucxSdVi8zzhbLYpDQKKu1YGoGZAD39TNLaCqHk0ZawEa8ioe/8krxofmJcfsg3gw93l+MByt3PhljqfVC7qMk71OxCDAV71w5DARc2AHv5GuSv/uRFuqSxTg1pYlyFwEZeKtciKNX4KzEckWkIbuKY695DkPwQrwAUcF6s8QQqvbkAPf1sMaUm1SMl5hrCoudefziXSgwb+t91Wz4j9ljiX2l5mzwBvxznnBw/yflech8V+DMWWDoG0FU0VyvkOcPecc75lYhuGLeAfOee7/LNuQA8fj9bHCR27NQDqMv0yoPrQmpluW0lszsy0x4DJvtUdD7nYcDt6bP32DDYMtXHu3Rr0JFWY/KG5iPLtcS1JZWWs7WU45wN+nUfflLcXtydYYjNQZthxVJKkEHDC0FW22wvVDfzgBb6D4gchAJgXuOVn3YAePhrNFcpvT7CUmfiOm7G5YePVjouNpmr3RYLVTHOlqgzYlcqxMHs+7At8lT3d1c30JEnKyx2YQ6v7cvbqBafJgB4+Fs0Vym9GsOTc5LStN2Nxw11XO6zV76ReKXJQW/oivJ7qtQqWfkSimc28O47O/pqjvAvr1b6edWMsP+PyBNI4TeAyv2USI92kcGrH6lRkUZowx5VWTEdp6sqfNQN6+Eg0D/ZUD5VyaKeWjGv1qR/NqVS0nhnXbCuJTel4xxmj3Uc/N8QwDmy1j3YpN8NrTqRQb89gw1AbtbNYu5MNSFUlqcLkD8YaUNPrsZTH4K779bqzFKz0XXccnXCAF/dozKwH/S8pWK+I1ytYxhhNEfoLVs0SCVYvwbI7+XnIwXZXXQry9tyOiDqaHCqXzBHVyOZLJ/1okUfDiVgeVT9g1D29pisWuYHdLMrYjCG82o5X2363GgLpv0VyL52oRR5Nr7SiVhUh/u27RbLgTo6fmyit6IZOSaXsqlzekf41nRlLwRqysmPTHeVckF4RvVBVSH8lx8jB8FbT+MIALAVryKBtdL1+GQkWARgkoVEjamM3TU2HfirTaKa3JUJg28Ia0MTKrjeKRYdgED2xlI/xVIb0ahCWgjVoYcf1BIsWBhEAeqmCVVTSq2tzTsGKr9Uzy6hLSJhoVQkLCSG9ujrnFKyrDbtTA4sYQJeItPn398yJ9GootoLFhijW5kpjSSRYN4xhCq7cK1l3Y6g8H7i2hKSaiG9cCSLSNX4wRT61BWaHIRv99uTlKJUDQmPVVUl0k/ouyI2p7pQvwZhK8Si5yH7IBmwFa1JNrFvZvpyYGs1v4GjvJrWuTsJasAatRttcxbPhiv4UxNQx6slYTYmrtEleF9aC5QxZy5xd5cRh6hESJepaf9sUzR8brZuzVBl2C4SEtWBNp4l1Rf8v4upUAz2GY8IMq0rMqSSNaUmlHlmm+YgaPusmLrqm5ZVwZsHKFkNSnQb1CAnitWK3vQwA4MMg76bLb4v1rtfcJG0vM4hTt5epRZaj6Dur6HvD3ElpFVtVXK7FUgK17A3p9YwMxVe2wtE3Z6kSGpJAqxp9yxZDfENeerjBCpcDtJ19Gu5Qt9X1HWopq91xDFxwexkAA5tYuHgT61q+FARBnJ0eghV0RzEQX3pE6Srj/ARBXIIegsUGNrEuO6REDSyCeL30EKyBfcL0ok2ea4zyEwRxIf6jR1zfGdR6WXkXPMNzdctThGmcJnBYyxkTZyI27w/UcJkgbplmPzedAad9AYAz7hmebdifR1hwlWO+9t2xR6XhmMgTTo9srlBudcxXLbIcpYyop1I+6+aUuHqstuwN6fWMDMU3FNd0apkhiV419YS1+Ia8zPWmV4KSi3zTDXeo29LjdxSxVqn12jbdTvFZL0eNfl3CgcPuF+wUZgOOI7sUyYcN4HqeA8Qz2v+mhMu7s8tbjEP256w+G3wt9RdJ/nAn75OuhUG+qrzRekZ31XLfIq9qtbBuz+CO2vgS38mriVHXBcUjlWtSpPimGqRELotyb5Cr0lwjyiX921DLry5gP7PnTy/BcgYeb7e61Ezh4nZH3NNZBv+w3+0OBx/Z7LI9V3HeNEFMnl6CNbSJhfllWhSbK5570cU8w3rrAICzDS+9yHK3G/rNEcRN0U+whv5QZ/NLtCiSG54hjGP4pWgsnWseKUQQ06XPLCGAcOAgUbJYD0vYg+zphmcIN4B0Era/ymIPALIozsA8nwEAYrgsjlI4vgds4gxu4LRdB4A4SsHcoDKQbFI/AJBtkgyumKEtpwPTKMkA9/LzlAQxFp1D8zKDx0IGz0fZchz2El5mlvAI+NLHw2535JzzndAZsF2ewy6fiF0fc1eQddt1zouPbF0Y2OZ1vc1N+0deTQeW07xhHv0GZgnliLoVxZ45I/1bUaxWwW2G9BK2lkWxbbivRvvNuZR/6TVsKIj5Dhsm6xTDjcUz58r19G1TgIbb61UJxWfehelm2xneUFr3yqc/A0dpLiNYO2BZv7pngBuGHoC9yMGHt1wHAFx4y7UPsLbr/OgCbhj6KJVtzQBvLfw7gjB0xA3myrQEWBCGASujX02wqr/1KFx9S7gWDjkQekztXTWYVApqzqu5OHpBjCVsNmkqq7lghiJ03aEhblup9FzV8miCNeALM2AokXY7hrup3VvPl/DIzIWx4LyKNXRU+TKCFQK7+lUnr5Q14OQ5BHls8YcvkjVd50Gug3sGJlpSjC1z02yfx9iWyuSAHTjn/MDEbZNgkWDJtaF9jZyf8IUZMJRIux3D3dTure9LONB5FMhbEWdi8CzYFQVrWwpGCGw550XD6ZALGN8VgmW+fsj1q2zBQdjhfF38PhwZglKZyvwCEiwSrGkKVr9ZQgDh8CbWGd0l51OcdYuBXP7DYl9n4ejm1NZtmq9HpQHPyQ3krnIxHCHhLPCqL2y3O+HnhiBugN6CxYZ79GSzczmQTlKvkMItBt1dCJfXpl8D8/WkWgvoQvwa5IPwMYopiOWump30cvGKaBNpYqL0dGsAsIwGu5NnT+uzODBOU68QVzrEMKT1mSGb5X+myHJDeYh5OjeJsyS93eUABNFBf8Ea7IsFAPPBzvLNZE+3f0yOCyTynhUzuEtxOQ+Ph/mQZb1uPZ2L6N71DxZS9u3lWoi4pO/zK/6uUlUJZSsc0ka8ym7C5i2TzeMtSt6VLW7cM1hJImfH5Q/m4jYn0QvStZm5YVtiw03q9ajUkzkXvfiG7ESUHtutD2eAYAWbE8ai5snYHqTJhdb9nIQHpQkVx3AAlpXXksbOYDvusjtOSfYhg+e5joPF1QWLIAYxQLCwnHXHaWSTbocP2xuILrLq51SYF0dp1UuLAVdpVmUY4vbKWg7kLkynaRlnk+E8XXKCuBS9B90BeAM3bRDE70ZsEWWLW16PI+EDVU862wA+4CLJh5PSZJBguUiKu5/PlIWUVadvNSvzjeHmenV6nbXNPEuT1dWHejLogXKUKq6cqopiTqKEN5RKnsFvzJ7rJuuOGq3VYbjv5ju0KI5F8ZvK3eJPYTBkTmx3u4oVA+ZKkW9Hv3sDQwQLy5PaSNmH0RYpJ7OpHDkRuIhL5VhkCETrKJ8t2LQ0lVrwyyM34k3sqCGpMJ1FBst01CwxVQYJlnNix2I17IjDGouR7FyCNcNmFgNAOtuAhQA8F6sVAKxWGLSNtBNgtQCA+ElzN/HzcarsKatct1wkMQAks2yENhZBXIEhY1gnuTYAAJJZ0Ge02Ey8mI5cAe5ulsUxc5GmANs5ALCeZYuNhzgFG1YdyyRZRR6LE2CrBLD1LJu5XhZlCEopDFaYBQxpBDdJFqf+6hDEdTB3ONvpv3e6jmNYW9eHw0kDaRVX2dP9kF8qjsV293kOIVf+KJfmmK9XuzU4O9UA5/u8iyivyVmzPPJe3PgF9tAgiBEZ7juxOH3wyFsO35UpW401eHXJo+rTOE3gMl8aboqShDnuCeKbRGnmGg1ESeI4vjK0lW3S1HV9IIrgUQuLmBp3gwUr+zCCv3QQDtteK1ttRhuDuaRgEQRxCnfDBt0BsDH8PzfvZgM8GJP5n2769EGCIM7FUMGCN8rC/3j2oV9jKdvMPkxz5SBBECczfP3PKJ1CAEBg7YkaxdHYbSvqEhLEVBg+hgUg+TBaOZjXfXJeGscDVwi3QoJFEFPhJMHKnRbHwvEct8l7MkmS+EybopBgEcRUOE2w8DT6Eg+XucwFK/wd0hRJlmTndBAlwSKIqXCiYI03jHU9SLAIYioMd2sAALBxd4ohCIJo5STB6rd/HEEQxGmcJlgI6BgWgiAuxomCheUtr0g7fYk2QRC3xKmChRNWMJ+b0LvdshEEMYCTBYvtblUV3OWgfYcJgrhZThYssPVtThWydfO5pARBTJLTBQvu7iZ1YekO2yidIIibZQTBuk3FCgKAuoQE8boYQ7BuUbGEhxgbtkEgQRC3ySiCdXuKVfjgk2ARxGtiHMG6OcXa5kpFfUKCeE0MO+arjrub3dC2xetitP3GBCtNXRthj1lDubM4SSAdWqHvY1FNMjSF6BaAJINUqCSDV0/uGFqqSWZ1L8QlqJ0crj9CtQjao6iH1+J3Reg8u1x/Xhof8k5GOoFnfzuPb1AW6tAZ93LHfHHOfZSHm4VeiRpn6wGAv6+nPoZFFbP8eC7dlb+Kaw6pW+DcU+rAE1G15IbTwMqTxohrcwgYAP9QXtAfoVoErjyKtfBa/K4IymfpyfY8TxRi5wOAEx7zBOL0GXfbmKAB7Sk/jcOtNGcCqVCdkS8pWAfpJZeKoMQplzqt9dR7B2JvVgBwD5z3FiyDBc49JS9bwTo6JFg3QtFSYNv8gv4I1SJw9VHUw2vxuyKon1Vfoh3nnJcrjp0955wfS6UIGhI0UX9fTuF4G4rlymXq9MS6pGD51ddxBFxTCysE3O3xEDJA+6nZM8ATydcOwI5qMPcBvzFbv9mCB9lYJVjtcuSDBOs2ODIg3O+XDCxv4WiPUC0C5+qjqIXX4ndF0D5LDSYHOHDOtwALD8etBzhHUUJvezysHaGp9QSN4PSXUOEWVkK7ypvcuZvExQRrt3RRPSUNinAoyr9nWsmOjtx0DGoFX+YPQ50ipMGCByZJnaVgbQESrNsgBJacc77Lv93aI6RH0B9FPbwWvytCPYOcoyMCHDDx6xsAS84PxaN3ZHCMCRrBiS9hjevvj6XqFe88PvFSgpVnVzwla7OtsIyx1n5rQvVp8LQ+4w61Jpke0mDBgyf93NoJ1oHBJcG6DZzipfdEQ7n2COkR9EdRD6/F74pQS1AQirdrV44pHBk8ztfloxrWHvKO13E0t4aC8NruDbp/xa06YqXmdY4JnLwT6wPyjvnZBkz+NVgD8vGM2ROwNvbIy5AWC0uGea853nnm06qn2yBJkfdrfGQx6o9QLUKHgbrBjgiNGcQrcdxyUk5SMxcxkMqz96khQRsjCxa8/VUHsmr+YDfzXuU/KAWZeRY4LRWWAbJrQZwhkG/N8ZFI3/UsE2uR6pQhLRacEOnK8j4AYBGPcvA3MQJJ+fZ74onRH6FaBO1R1MNr8bsi1DMQZHOIycBMcy9yPOmtdAwJ2hhbsODsr7gJqcF/9TYmAmqkcLLVfLbQzr1Wii8HJYB62qwnt8AWSdNu1VVIm4XQw8rw49tAssKN7tDxBqmaK45oruiPUC1Ch4Fa/K4ITRmsUldIQbArX8sEHhDsiknoWPHwKxO0MZbjqMTS7de/GA+Tv717zjPChpMgeZcBMRZrWUYY4ozlEXTBUqXXlcI3q6bzQKSQVgvrd1js9RJWKO3U7Amh7VHdxLlJK4lykwz1R6gWocNALX5XhIYM0hXy39BKlFaZ/CjFmwTSz2yVoI3RW1gA/MN1OmKByXf1RpsCGZLMDXwH2ZM8FuUBed9spUpGbTTOrcKTBbA2tqXVkGYLcEIk2rG4i1mFErBKHdrJ/2aQJEg86vojVIvQYaAWvytCQwZzeLoMbBYo21CLu7tZxLZ+awID5xAssN3yCjoRGsdVbmYQSyEG2G6/3h6WwFxqRgcMqxWATD+jNm6ePsjmWUOTRwlpsQBg6WJld8hktAKd7nbDND5ClyWOof2spbM5tLFPlrUlMHKGLiEAhP7cfkxkFFjDcRi3OYblhPBdAAixwKZqCbPtDIuVmyVgTiILjBc3ysk8gWduSyshLRYAYDnDXPFvb9isP5sjvM06JQC0PEKXZaW1l7LVCnC3ZYECD8kmnSfrpgQNnKWFBcDZXXZc1tk1OK3e5pZYzrLQg5Ap7gve3kEWJ/AOTGsRaXJTDnWuIjhbYyZ6SJMFkXGIWJkpdCv/Y/lBesroMMrbpvkRuiBxDOWFjD6swJb7qjyO54UHH5tNQ4ImziVYQHC44EiH3+xNcZOCJeGqQuIe9mEY7ncs1WJBbbLG+YhBvEBDF00LabSQEzpYdU+WxDGcxWKxWCRAtFjY9SKJ8yE998WIpPoIGSK0GqjF74pgzCCCI49SzJ9ShHVBWFfPpJagkTN1CQGALf3FZfqFLGzRRvfCfdO+1MrniicgVXqzLhArLeZYeClkT02dNz2kyUIBWz5lc3NTTaVsEG4A79Z/Dt4Caf4lVL592iNUj9BuoBa/K0ItQbZRnq1ZDK+a/KmcGVg5raglaOZ8LSwA7m57iQfa27W15W59wKXB7SJS24Y+g+KylUZwHQi/UPPd6yFNFqoIPqLOcVomLVN1PY9G369N5awZ69OA4hFqiWA0UIvfFcGUQQS5g7eIEeyqZ202KyfGy/KoCdppX71zKub59hFh7cslu7bEuuRuDdUyL7faU8KRi7Ar9wMKAH0Vt7wZgwtsxVXXvOS5HmK2wL0y/yOD41ru1iDdC3FNjuUK0aVYoqc/QrUInHP569PDa/G7Ipgy8OVVzQdtHxGnevjLEF9bBt3ABQTr3JLlt25HUd7kjQlW9ddSWcV8KL78g2Hle3Xl6IuCr1Gsg9cxhBgtyIKVL13nnARrQvjFiuNcB2qPkB6Bc658fXp4LX5XhHoGR2ULtaW2xDkodW2Z7/OgJWjmrGNYBUGwsXTx6Y+77J4K9W5wECtY4WnrAVit4AQAFiuES8Dx4o0bAOkTNK8Utp1lm0R4VW1WKdwtkC4AV+7GlfN3phCTBZUwlqoqkquNJgZvliASQ4/zfA1y7RHSI3QZqMXvilDPIFZGYmJ5ob4TwN9gvnYBRCuwwJCgAxtlO5XdWfw3ndqunCbaJyuv08LiawBu4DtFQyjMf2L2DHBDdRfQHDEnXOwXeuT1bUWr4plD6ha40sLiBwbjjqOG+6YW1q0QAk4YumXzufYI6RHya7smA7X4XRFqCdTxDKWH5Yn48ALfQT4qUR8AaaLhYTwHh3DsAVo7ueraEutKgsULh4N8wKEQrFxUlO1sC2o7svcVrIY93aUqCEGCNTnyX+RSjmqPkB6Ba1+fHl6L3xVB/+wqI1L1961oQzh7Y4JmgDuge9/zkdjEIy4WcBu2U6mjL5LT7Fj3du4wbl1FScIcv94S3qSJ6zTcXJRkqcOsXIIbcz3VAnFrpJsUypOkP0K1CB0GavG7InRloJNFaaKc3WTJ3UUFC0ijaJzNE4IrbCA3tmARBNGPSwsWRtEsN/Cv4f9DgkUQ1+UKggUgi5Jo8I5ZnudfybuaBIsgrst1BAsAkjiJe4uW413Tt5oEiyCuy/UECwDSJElMeyCaYK7rXnkhCAkWQVyX6woWACBLkixBi2+ny1x4zg0ssiXBIojrcgOCVZCmSFNA2bLCu6kNQ0mwCOK63JBg3T4kWARxXe7Ou70MQRDEmJBgEQQxGUiwCIKYDCRYBEFMBhIsgiAmAwkWQRCTgQSLIIjJQIJFEMRkIMEiCGIykGARBDEZSLAIgpgMJFgEQUwGEiyCICYDCRZBEJOBBIsgiMlAgkUQxGQgwSIIYjKQYBEEMRlIsAiCmAwkWARBTAYSLIIgJgMJFkEQk4EEiyCIyUCCRRDEZCDBIghiMpBgEQRBEARBEARBEARBELfOHcCvXQaCIAgL7mjQnSCI6UCCRRDEZCDBIghiMpBgEQQxGUiwCIKYDCRYBEFMBhIsgiAmAwkWQRCTgQSLIIjJQIJFEMRkIMEiCGIykGARBDEZSLAIgpgMJFgEQUwGEiyCICYDCRZBEJOBBIsgiMlAgkUQxGQgwSIIYjKQYBEEMRlIsAiCmAwkWARBTAYSLIIgJsN/XLsAoxHHAJzAELIAgKV6LY2SJAUAuK7rOaYUCh5zjbm222kii5I0BgAw1/W8hiJbFkGz6DquXy+HZe0s0BRtk0rR0o0WylzH9t6rfGC4cxvLIk7ITIbjGAALbbOzuuFNasqpRHuyWjIr6fr+a7UgEYjqYUMBIAAAIABJREFUiON6kBOYvud0U7s0bfjrIAQAzxRSv8ud9oz4e0MKDRbsapa77JjZ+Zrl8Ggsch1/bWfRrcWzrB2R3HQXnhxtZyibE1jdPOec83VeTMOdWFg+AgDMVeECQGidndUNt0kPau9PS2bFPXZ+/6ZaKMifQl2TAcDLLzPFWPNXPz1MFT5V7AXr6Ne/67CewvBAHJRY3XZMHAyp2NJUZBNOXTX5wfBG6fF6CZbpZesULACerWQVVVCPb2XZBwDfZPhgNNucndUN9xOslsxEES2+/xMFC1vZmJMHvQZeU5fQmmSe1C+u4p2xi6EQf9hJvbJhdqJ5Vr+YLeJtd/YAkM7WeuN+szBYTGeh3lWxJ1kMSxt/WJreoxpZlP8RtXRyWyz7EYAoM9RYBACOZrU7u6E3bKArsxO//5JCRbMN4OVZlX3nSBLFpL1DOzXenmBluc64ngcvybIkSgEgeWr7WSvSzvblQzHMzmae/+F6cFmaprF4fuOZhWACAOZM/YmeF+MdngsPSZbkgxtWEtxUyqDXiFTFIl1bxIrKP+x1QrbsswxAZBiWSQBAb8JYZDf4hmt0ZHb6959TjHzFG8DVs5LFvGU4bKJcu5k3ErZdQvGYy32MvNkUNqXgnO/X+fNRZWBjp0b+0rGw6lwW42BKt8TwxRy2+QvqKCMexcVldXWd/+C6UsReXUJTzHqXUI6zL9t93X3ifKAJgKHfZGc5aLibo9FoS3a2N6wlMPTLbTKz/v539i/mTq2ZvB0qDfAxgL2iLqFtvdw+lq+kGOUIlAhH8U4czCly1kx5Vq3s6OzF4+Srg6x5b0B+1c1fzJ7pT2PxBmgysWR66XoKVn1Iu12wOOeHXFi2esoaBwAQ7cSavNlZ3jfU8xoAnB7Z2d6wlqBZsFozs/7+TxMsV1a/LeB4JFg3iOUraYx21CaXjPUinqJirNfKjh4s+h36CDvP+5nSC9jwxYgH3tMvsJpI7F0tp76CxfSJq07BKiS9lrLGEgCCLaDPZ9lbdoz1KAa89ctt2dnesJagWbBaM7P+/k8TrKVsywdCEqxbxPKVdABDK2AHyD/N5noJ5MtWdkxFNM3Hi6aT1CBq+mICLcAFAGbofIh3g5XPbQ/BEkO4+iSchWDxLQCLTmFedcxUg5aWQ8Awt3fU3vvu7GxvWE3QIlitmVl//6cJ1s6pLh0BHF6TYL05T/cUqA/LwnMApB3zKUItksF20hUABIaxYjcAgI1h/ki3LxcB2CQAsDTMR7EtAGSrTosG1gAQRV3R6vghAKw6biNJATi+qDyD+6ON5aA0JBMBgKsNn1tkN/iGa7RmNsL3b4dfjf1H9QqZNm9NsGKgmhKWcIFchJoRupANtrMCAGacPBJu292vjCcVobDoGZ2Y3RDodNI2I5KanCW6CB2gc14qAgA/vxdbldAsC88FPXGcW+6b3fAb1mnNbITv344ASJOyQAa/rwnz1gQLgFFQrH6FHC1xPzvCQ2dpnL1mosnQWQI1sXCkaHAkWNqIh5nQQdEe6Ie4jY73rnipfQbhRjTEsg/Ubi6LypCe2Q2+YZ22zMb4/u1w3KJu0rjoGLwW3qZg1X9Ll5x3ujQLpLT97EQZmtd0+WEYhrZulKVFoFxbVsdGPMywNQCsLLtrtTzbXRWjFIDrAr36hLrlAKiaEYVloN4Bsspu+A33yGz877+Rsk8Y5dr5enhrgiW0ZOBvaQoUHcMBdowdlgJ3uVwuu38LEynzDovGd9oS0cs0rcDugHlluZqoCi36TZYdMc2y8BxQ5TgG6u0Ju+wG33CPzMb4/i3xi+bdxjhuMWXemmAJvVkNejSV16O/nXZ5sSMpswYQZyheZBOsVwtGZckAJANqqXsssOq3+b0GbjTL9VGi9h5hR3aDb9g+szG+f0scX2SXpHln8/Xw5gRLPDGrdwMGd0QSb6Ad0X88sdUvOoH5h0Qqjgl9yK0HeR+pf/PMA9rHYjYZgHz/m16Kqln2GbT2Y1ReHpDd4Bu2zmyU798WTzTvXt2Q+xsUrHzIJ53/aW7bG8nZKD+Rve2kwMnt85Wy21EKtI7ye2Wk/vgeMKSPxIB2wZKnV0UrybKEmuV6n9A4cWud3dAbts5sjO/fGh/ABti8PsF6c4uf2XYm9CXbbOB6rfusyWQrMWBVqEVvOzFgORnZRLqIUHhYAd2vgFtmO4D1hwyIV1a7L+h5tgh4FqEQG8B3UgCRXR66ZW8DdYWxqUfYI7uBN2ydWf/v36iedg8s8yNEYZTBeWVDWG9PsODunsrfvSRZwfM8cztdac8neTPKLx8AazsyvWZstAc2TgCAVTvcdDXsTpoecsIFgJVh89KTUPtt/grWgqXjOymQVhupGHuEPbI7/YYtMuv1lZindOwUyI+QpPHra2C9QcGCu1/JPsVxDOZ7hi92ZkorOT3Z2mlBz8JXRkhND6y/rp75BLD4zTZtG2VDGCVAtth2x+zDBpDeOX8FIEmHaYS/AhCXFW4c0+6T3ck33P/e2r//U/BZhtUr7BECb20tIeec8+Na/yl21rUUBlxthWyXnVr5tHV2uv2wKaAWwXxfGi5QrHvrs5Yw/1ssrC4WxNmsJewulNjMoPpcW8Tcw/JetcVUy3bZ2d6wVgrjWsKOzPp8/y1bqukrNU1rCTkvVp26xa3QWsJJw4Ltcb+UG9fp/EP30Hmob7I20M5wVjN9QLstt9P2mhQLVkwbZA5HmeWE2WHdFteBvMFnhnp7ol92J97wmPd2Or7072vibQoWALjhju8k5+LkXfv77QQH47KKvnZOI5YUywXaZ+ROnEhfOgCyk70pZTaA8hb5wFDn1lwcipFG4xxhz+xOu+FR7w1oaKfa7tEqTnB6fYL1BsewJDwPWRzn4+nZ014JVNvlrcdYtdqR0bRMHpKtj1ipPYYsjjcAstmhkE27wakTht7XMwAbv89EU3vzRGxmIEmoK+bSbES1btlfAIjyXxF5hm5wdgNuuF9mvb7/0/BXpU/YK+PC3dBz0WcMS2Odf6+hdQpLOzJboPXwJ4sCiB5pGcm4XZ0cHSg35xowhlWkElsyW45h7VrvsmmCTktva9kFiu2ltoC+/6tNdrY3rCYwjmF1Zdbn+++xH9Zxt9tJO4AddrvdUQ/Y73b2R7DdNG+5SygRHMTTduqAQ6sdBzh1Pb4XApKzZJcne5djaTchQ89dDNrzbFgXk9o4ixksS33C5p1lemXX/4atMxvh+zfBPE8+v9fxPI/pAa6Nx81EIMECAIhDpLKTl+u32BGPTOPKOausxftUdI66FhorCw8H0X/BSqurRaNTu816QoNl4eyeFRZ0J8kB2Q1fodOZ2RjfP/HWBCteLBYL06Mldo+yfmqG2GlfZmc3Uq/YEMuBm1+uqEwxGN8HgHlXtIqmjQ2rQBM2gmWwXC3PMc4RDsmu9w3bZzbG90+8gUF3+VHIVgCYabjB79UPGGLHiwFsmmZ57H7UlRYG8yMAm6aTADftmznkdLwoyzgDEusFK3HalqfYwU5t86VzAFnUOZ1ltOxHAOKgrUfYN7ueN9wjszG+f+L1CFZj30decseA7iUtFgyx4y8AZBuzM3Nm08jQ8SIAG/Melvm0U5GbVe0Y6LlgxbjDS4FQUF0KVilkh/Veln2WAVHqiB6hdo/Dshu4Qscis/G//7fI6+kSMsDcXpCv9ev4NTPEjuMDjUc09DmAoDqKgQGNOwysUkBaqw10146J0AOQWfaREt0XScG8IZQ0ENXfct4njBt7hP2z63XDfTIb7ft/07wewRIjOob3Ly5DAYehYQtfaTdRCwbZEVuAGruMvY63qXoP4rAV449zfkRL0VCwqh0jS0AciN6NeM2bNgjIzGNqfhXW33IhWEBtr9HB2fW44X6ZjfX9v3Wu7VsxFi5Qd8UpVogVfigBUD+CjhcHORdLBbvrxc6OhnigTasN80e90xFMW5B2FAeMms4lFBpUeehY1Q4H6r5CIQAwVy5Rg7eUkIymQ/vWgOl0UbHmrqjKvpYdADg4hmJbZWd7wxXmgthlZv399/DDelu8qnpZGp8l8eaW7nu7hmfGV16U7nqxs6NxqB81LygaB30FKz9gtK5YuV5JMa1qR/ejFFTDOcUVo6wcxFtnUHFB06nYYuDnOMxyCORNF92D1io72xuuMAuWXWbW3z8JVgOvql7y5ob6MOVvbvWMiGdff7pD9Tm0qBcrOzr5hF6otsAOZY+st2DljzrTypEv0pbfRLvaMb6/1Rol5Yoa7xDm/opNJ9WLtqehMXiQy9DX8qEs28EU0JWd7Q1XGL9gy8ysv38SrAZe0ywh2PoJQDYLwuoXciNOx5TOGl1+AIBFHEoDDmIrT/RaQzbITiDGjldREJRTe+lmBQBrq3M8azsQr7MIQLaIg2rEN87Pq3LlrZ3saseIFxpHWFJptD9L8kIxfUOLkgioz+SJawkAefash2WRGIbjveyzq9Fww83YZtbv+2+YTWk81+1NcKevsZ0y83yk1PVcMSieT9A4e+lZ3+QTQI7P8pFosZUnWLmqGHdAZ73Y2GkuIjzXZUCW5InWwVMEhIWXTlMB4hkAdjRZdDzHBZCmhc+1q73hNrVzB8Cr7caUfchNFiWKTZsbAoCzbRy//5BAukEZcfbQwRlkuTi4aKm5FNhlZ3vDFXcAsNN+kiwzg+3331gLpszfEuK9eD2YfzZdta3e4GgpDwTBpl4s7BgweiSyrRhk6uwSii6GOljS4OPo1XpQFrUDGEfgiqZa8blpgzm/qT9YjO4fTEHippbDLBd9Qs2yZXa2N1wBoNYltM2Mc8vvv2UDv5YBhzdAw5cyXUxOlLVnfW9qU3vy82ZXL912TOzqqbwD17aObCyASKwO2xos1ka1OOc2tQOYpwzy/maZo+HGAa/tVQqBxs0K3Cqsv+V8p7ph2dnecAWAmmbYZsY5t/v+SbAaaPhSJsxBb0YYn/W1/tB4WyXctl667Filcrdlpt2CJX6g9VdsrXWXnNDcIOmsHZNxzosh+xbB8vxlu1LXdyeuEB2hwzDLoqGrz7xZZmd7wxUAapphm1lR4s7vnwSrgVc2hgUAyKIkzkcgmOs1LbGI46RwVGeeO3yjs2F24jguxoo9vxCbJGvfJbCVJCrL4blu88oTu9ohzsv43/8b4e4VChYAIMnQvVFBlqBwEDyJYXaSrGMb02HlcC12GLWqHeK8jP/9vwFerWARBPH6uHtFawkJgnj1kGARBDEZSLAIgpgMJFgEQUwGEiyCICYDCRZBEJOBBIsgiMlAgkUQxGQgwSIIYjKQYBEEMRlIsAiCmAwkWARBTAYSLIIgJgMJFkEQk4EEiyCIyUCCRRDEZCDBIghiMpBgEQQxGUiwCIKYDCRYBEFMBhIsgiAmAwkWQRCTgQSLIIjJQIJFEMRkIMEiCGIykGARBEEQBEEQBEEQBEEQt84dwK9dBoIgCAvuaNCdIIjpQIJFEMRkIMEiCGIykGARBDEZSLAIgpgMJFgEQUwGEiyCICYDCRZBEJOBBIsgiMlAgkUQxGQgwSIIYjKQYBEEMRlIsAiCmAwkWARBTAYSLIIgJgMJFkEQk4EEiyCIyUCCRRDEZCDBIghiMpBgEQQxGUiwCIKYDCRYBEFMBhIsgiAmAwkWQRCTgQSLIIjJQIJFEMRkIMEiCGIykGARBDEZSLAIgpgMJFgEQUwGEiyCICYDCRZBEJOBBIsgiMlAgkUQxGQgwSIIYjKQYBEEMRlIsAiCmAwkWARBTAYSLIIgJgMJFkEQk+E/OmPE2mfmAsgS8b9MksFxgCzRLbhMiiJ9QpqWf3odWdat5leVYiSZbL4kixMAXhGUJXIpYsBxJAOVQa20SFM1tzSVUhLEqyNGDE99N/tF6DQwBN6OHt3jnPNd/r+MB4QiSGNXxDgCwLpKEcqx/DKaKcu61fyqpxVhx3V2ZX35e8455wcA2yL0AFFsgQsETaXlIVTzoZySIF4XW798b9aDInQaEOzDMAzDg1WZLtwljIB686kMnM3PkuliVuYYfdgAokFVNtjiolxA3vYqYxfBMvPsLIUkiNsi/vBUvhbR/F39re2K0GmgYLNarVartDFcpbtLCEBpCXV1ghwldpwAZa9qAwBRJnfanFyFkxjYsGVjloXVbFMmseuNrVaA53sOkmSVYo4AgL+qBCsBkKZO9aFsjxlKC6SrJQjitbNYKR/TWbjsF6HTQBmy6Vu2zlaYIUZLl1CPV108iAGwZRkaSlaOPoBDS5amjLu7hEcmdfICgB0551spAwZUHb8QcBtLm/dg9/Jn6hISr5GgLhNBrwidBkry5kd9KMfEubuE6RPglsoaAb4vdcAU2Jo1dxeHs8ngrYsPaw/ZBqIRlWeVZHCrfBOpgWUsLQPO03EliNthZWj1bBY9InQaKJmb5aCR8wrWUwZWDZdvAM8HEnN3lfmAbUfWnlQalAJ80etjlUbFQMBKwYql2MbSBg4SY70TxKvB/IivYusInQYKsnnfDuFZBWueANvKpyEF8x23qYkFgz/C6agS6AAZAHhlQAz4PjJRlfIQVkNp18BmfFkliBuilBtnudsty7HilXWETgOCbPWu9wDWOQVrswGWlQ9GBARAY58Q2Tk0y1E0q/CPkFtYbtXeiiW/q4bSeiEy6hQSr5m4aAkFh9DzwkOgX++K0GkASOJoMfvTov+c+xkFK1kAvjTbFwE+EABJ3QkUQCbCR8YFonq1eIV/awR48AvBSrUhLFNpQ4ZY/6UgiFdE8RNdDP6uXS2gK0KnAdx9mD0ZeogWnE+wsqcMzrr6HKVwXDFUZWpixbMM4fh+474DrN4ttByZm3tiJYAH5iLJAGUIq7G0bA2syBmLeL0UD3zZ2FhqAV0ROg2cgJUf1kz+sNSX5DQwT8G2Uh8vBgIA8CJElUtGkttOU0D21LDOMpFjGtbvbGcZshXgeZ5kxUtE3BjwAC9BFACZ1MIylxYAfD/K5tvmAhHEpEnyn2O37G14jhhWyWLPJkKngVOwEiyl7WbZulhEmtAUPT5/jjQpA7LKtif7blhnmXU0LN29mGKNYzDPL/qc+bBVmsAH4AlHUm0Iy1BaAMAyzqJo/M4rQdwERTNI/n3Px8YTzyZCp4FTOFeXMF4BgaxAmwyeA4helnFuIH53FocBZ33chi4AZNHTh7wN5gNpVvYBPYYIihdWW2mdEBgwWkgQk6B4tKXeUfFnahWh08ApWAmW4mxqpZHpE+Cu5StxOaTuyX3Z0lH9EDKsKsWyzlL3dDfA/OX+uA4cAMksKQsRFz1CwEOWANJCwobSCkIPKY27E6+UQlSkl8lTgroidBoAdiV9S2fVJezPUwamjPNkEbARb34GZPUulbP0ZlgF59quhQVAvIqRzfcAADdG4iOG4wJipMot5auztMsPWHkj75lBELdByxhLbBWh0wBO2HDmPII1T4Ctoj15l6sgNowBeV6MKKxfHw3P28yRiHE/b4UESZbXnAck8hBWR2ndcIX54YwlJYir4xj/7BGh08AQziJYmw0QqiK6kQa0swTRup4Kbmw7om9fkgi+NJIWRDFywQJiREUf0HGTOJOHsDpKu4yTdEHbNhCvkHKYyaQ3qdMdodPASZxDsJIF4Kmvcyo3ubI/IdsYlnOfASeGMsXnls1VL0acVCNVCeJqCKu7tMsZVjRRSLxCWsfFU6c7QqeBkzjDLGH2lMHRHJUiwC2LynxzP/cMM29MGzKvsnCBOC7bUeJT0cLqLq0XSgumCIK4EGcQrHkqL3kWbJRlNx4Q1dUpPcPaHJcpE3rS8h9P7MeQB/hAXO0Hb1Ha0EE8gt8uQRB9GF+wFpG0eCgnSXPHcYEPg5d+/JTBtfSitydQdrVYZCj83T0gk2YrfGkhoU1p2fIcm+EQBNFK/6U5hf+6vCbGlUasVgCiSE0QAb7sRuZHiALVSpoCqAa3jVkOYBkn2SzwPAak8SaR1jf5ESTBcqVPzaWV8H1qYBHEpem/NKcYB2pbE6MniDTPCz9CLIbfZCtMapgZsxzCbpZgU/mqrxWJqjp+/gKyYDWUVmYdk7c7QVyYi5yaE6Xa6JSvD4YDcMPDOebd2D6sWkvevmopeZBXOzlOpVc2pQXYOV3GCIIwcQfUjgF8dURJmgGu49GxpwTRTlyMxsi6cJf/v/O6I3QaUGgMMHJ3rqU5t4VPLlME8Sq46EGqBEHcOK29ENciQqeBkyDBIgiiolpFU10r19UyiwidBk6CBIsgCAOS3hh2uLKI0GlgCCRYBEFIFKPfktdO8adrFaHTwCmQYBEEIVG0gqT9lYo/HasInQZOgQSLIAiJohUk9eiKPx2rCJ0GToEEiyAICWmbcGh/elYROg2cAgkWQRASXt6ly8oFbcU5nMy1itBp4BRIsAiCkCncrBf5yFOy0gK6InQaOAESLIIgZApZyWYRAGxmxRxfYBmh08AJvIm1hARB2DMrR58cR+z7BADwdrYROg1U9F1LSIJFEIRC8sF4ee/aRug0UHF7i5/TVB1rS1M4yuxmlqgRkmqv4vyj8lneQEtKVum4aSoiS2KAubKdJkOGCFpwZ0KCmDLu0nRegbSLZleETgPDsW1hLVZhvqtorG3cl599mm6SGJ5bPwl1sVLlc7FCqBypE8/UtuIsluNnfwKwljq/d1JUMC/wqmxK/EARrWgTGwIaDBlzYr7fIyFBTJv5pnYpWPeJ0GmgoG8LC9qp8E04CPO/9H3rdurVpZ4yBOAclc+hEmFXP29+V31aA4AvBdfqwVisoEpwVLcPPXYYasqpR0KCmDi1Qzf197orQqeBnCJ4Zw6uxbbsEm46Dlx4igDHy5IUi8xwwGi6Gnzq6AYAokxZNRmUzv8xsGGFbcc3XU1mGeD4HpAlUYoo3bEuQxVhFdwvIUFMmdBbyD0pr9ad64rQaWA4FsK2Y1WzaBdKAC7nnIcA2xa6elDTind+L3/u0cI6iHEiSZ6hBLsAjrnZ0srRr4pxdAC2lgvjthtSciothqjsdyYkiOmzK36VWWBu/nRF6DTQHxvBOmxDF9BVRhCC7TnnR1a+wstaDykEWKUSfQVrCQRLObkqF/wAYJ2brawcWX6Vcx+ijDnb6k4aDCk5qQmXlgkJ4lVw2O12u8MJEToN9MTGcXTztEoaguIVQhdAlKEYkw4dbGqnyQQOkoHnJG8AzxdHBRpxXNP5gMwvrsYRsJVao/4SWJmMmQ1JCcO8e9o3IUFMFcfzvNaDELoidBrozSme7tkcXghAOoMU8E0nzKy7R8HMJCmY77gmmznmLcHKqxtAncULvQbh6dpbLGRIjaU4fVMygiDs6BasJef1qUEAwCr9/9m72/NUlYYNw3eO422ApwR2CawSsARSApaAJWgJWkIoQUoIJUgJoQTfH3wNMCAaEx1znT/2XkEZBhNuZwYYvOpMZW7MG2Ftb4SJyvUt1UuleCIEZ5V1jpSp8ejUyvWFVbyoN8MPgN/3jRZWvtP4qivJelgnnrLdePFF1cNOYymfyorcdktl2TwkNZOCQR1jqbAVZi3IFE4E1sUVAdzJNwJrI79uvPjGoWwPFm/fzTFxhbSQH1SNm4lW0a5UODphmq1KJX5dm9EFafbgsRbU4w+fR710RQB3cvutOYdMzTOVAymts6ucCJYoSsv1x1RZ+cr8oftnVt/gHaZKLdc6ZWWaym8voG1KKQo1F9Nbh9fHiwcF2dlSadGKAO7k9sDayW+nm9iU+a5KrM3U2Po2K9N0qutU2pouanqEUrRWkXeBYcZbtG8HvY1SwrpqpSVnjEHyiYIuu3lFAN9wc5fwUHSj2V4sbda5ynRlPQEnSX4iba7sFB5KVedEvWji1J48+znT7L/2MoqFaTJR0A+uCOBaN7ewjAaWtC0POlSJEk9FVpJlk3foDG9+rmXtcHaYKu06Xs0VtGWRlbusvWOmLaU4HMqdmpu1Z+6qnCjosptXBPANtwbWoehNH7j3qyF1fz/REpK0/addeM3MBmUqHaoxsVIquw5lN3NCvirzcQr623ClXexLgaWvmXetrksFTa133YoA7uTWLuFhMN9p8vWRJMnHKdTks3yCRLrqYqxUUp5lWZZlueyn6IKt/bxkGFar+5aXc9v4+VRBl9ZbsiKAO7mxhZXn3YQFtahqAGXTo0bbLC82VzRGDsbMfWVu9gmNra6tQaYgUykplLKiH6BZKc/SzpsqqGMPrAUrAriTGwMrnXzEWDHz8LHtSrvl11gWufTRhE35P5UHyxz2F0aP/CDXoZ+Rqf06z4vDUOWtKwK4lxu7hIfewVtsNu3IVTYTWGEiLb8JOjWvUvcie59wivGcjv5djNmwM7vUrpTPBaLAQ90WWHnZa2x4u12TQ4dyLg4SX9niG/n6oRhK6fKrIoqmORQHKt+N9fJ3Kboldw47ibF14LFuC6y0P5zjhSqrOwXLzeyNdd52+VQsedFrCkWavD1nXGL2Xiqoarj3lK/aUfFsVcqbvDB9umr5+1qKJ/eM6WWAX3HbGNaw35dk2iiRsnWpZO7KhSha3MBKpcgYH/KiVKml8eYXyuuOY3uDT1FIqmMp2K6V/4vD0FOZHTLJm7hqyiioY9zso3CigWVdEcAPuCmwyuEJszA+aLMJ87K6eGHGPlvarxuO60fp6ISfJAWFDnXLx7zBx9s3FYz997K5qlWS/zHRITQK6hglJlMdQuuKAH7ATV3C8cD6PpGUlVLyOX/WzJvPs05aDDqXkWftEwayTFwTJKdu3fCUtHXyktPUAJa1oGa1cHuaHMCaWxHAPd3tyc/FIZcXRE/aN0rzXPL8gJYQ4C4eVQ/AGW/fmtMdAH4VgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnHF5PixzkqnAvtx4MbO+t1HmmeQFgTEFTVH031oU8v2bSjKLaPRmwbHXuJKXxiN6uqV5IXlh974LEJL7AAAgAElEQVQy71cnLy1rWdec3Q6ARS7P1vBm/uCFcWhbrua5y8ZSL4r6s2alhyYyorYUbXbS0XjfZldPlXd1SWYRHeMN9hpLksr/SdoPJjTdNY+v8OJmRq1sNXpK9dEyw6plzZnt1IpDnikMYmOGnvKQ5WVvUXHI89L3w/oha9kghGN/vMS6McBBb5J0njdcJ55YHlqWRl9dOV+h9ZVEkm+8LZGS20oyi7BVeKLG5/P5fN5LUtQr5dNsHQWnauGxt9b5HErH0SdmXXNyO6Nab7uC6rDx9qM3eR+2XdXRsgR4FQunSG6fmZpn0sFr597sHRz+YGmeSWnRTqCer0rJj0KpzNPCfEUqJp71fn1JbWUia4UnaiwdJCktjYLyVSlFoS/lWab8fWImeIu5Ncfbabynkh+WeaFNue0K8gIVRbmuH8exPkheEOSZyvcPJiPEn3Qx1Ixv6VMg6atZbn9388+vRF175MsfNhSC7p/S59l4KbmtJLOIthn0FUk6jeo2cKoGtLbGokDym1odvaadtqSFZV9zajtdnatG07arb1A3HxPJ+6q3ruTrXP0avK/z+XxMDFJgWwK8iqsD63yStG+W29/d/fCh9uCMJO+z/0qVS4nkmceVLbCWlWQW0aXKl9dUeCawtlK87R3dbUicz+cqKU71Py4F1sSaE9sxanns3tPsWd1XjupdjNpd/fLHsZf0Phf7EsBl1wfWObAGivlu46dE8s/nc3Xc9o7stiGRSIlvZI49sJaUZL7XSJW4LXx6X33p42SWYwTI+Xw+n8M6Hy4H1tSa9u009sbIll+3YaM2aU/1zret2/N5P6jI+XwcRdh4CeC0G67DuuqUfOKpSCXpIPVP5yVhPaAjSfvh8+RvLum2CueFvMgPjKfyHEqF5lbC8UURE+bWHG+nURhXYET161n72CA/UJFXDytq9iaU8l4J5VphcmEJ4LqfvXDUi6rjqkwH493dYSlJYaJyfZeSLMrLmZVKcb+cbPCMsfh4XHjsz6053k4jN04BBNWTpM1LvNp4at802qVdMXyi9XgJ4LqrAyuffRb9UH2kZVIwuB4oloq2jZB4Fx/tt7CkkTK9XOHqLbGUN+UMY8cLQ8vlVjZza463MyGXVPTjqZACI/uywaNs893wiqvxEsB51wbWrtT48u1pftUhykdPXu13ary9tJt/JPTCkoayVankwnGbFvKDqhFXN30yyb/tcvS5NcfbafnGLuTt/waNLi8M2yWHweewkT9oAo6XAM676lH1WZmm8rt+xsp8cWvLsXqZbYDKNxdHUVquP+a2vbSkSl5XrSj6z5i31jhTdZlTmCpt3zsZcrlZhi0oJ9e0bqcSSGkdL6W9f9uP810mz7xe/pCpf0m9ZQngvkWBZR6i0b47DHrj0HMNpHLQgZGGozDbrEzTBX3NyyVVb+uqFpoHtrXGTacxWqvIA2mmwdYv2mJuzfF2WtGmzHdVYm0unH6QVG4O0tbc7Z384X1FoyWA+67tEnq3Dotc+Lb3E2kz3ylcWNJQ9t9m/g2HUlVXy4ua843LKmIzs6ZlOy0vljbrXGW6mjvjWRf032FwQ+KhGJ6JGC8BXsCiwIrrC6fjUOVu1R2TvUskLgxKX7oqIAlVXBh3X1iSZFyjdEo87brEstW4GyYPm8GluVG64XVYfTNrWrbT2cbS4d/b/94zXWgYZat1Kf/YexcNLPwRi7qE3VwJ+arMJ278s8qrBlFgCZl80Fba/tNu5lTcFSWZ/G240m7udFmZSocqP0qpTCNJ3s2NrOk1bdsx7P3qrIO/n72qrNztxnNAHIphyo2XAK/gqkF3KdiuZ4dphvKqzeFbBnfyQXMkSHZan+5RUl8YZu2Atk2qXpFZJCmQ8v4dyutCyZILG6bXtG3HlCRpLgWRMuu4fVVm/l5I8fC050GjwBotAV7BlYGlaL30km9JbZaEUlb0j7KslNdPgG2WF5vJ1ts1JfUF2Wxz6WDMqFfmSveSPL8YJMphdL2q3fSatu30RdV6WZVO4a4799lkWL4qFWyHO5vn3XwaU0uAl3BtYF13GDRXbfpBrkM/iyzXc25X2k2dKLyupCsUufTRJGD5P5WHWFK0U6/Plspy/ZfV1Jr27VhrVK1gXqxRnxstV6Xi7ehXkI7qNl4CvISfvTVnV8oPJCke3i2YWTotYSJNndG7rqSe+dGo1Lx03ovqMf1ISs2W5PD69WlTa9q30yg2m4OxRijJ95WX3aJA0qZUvB9/ZRxGlRsvAV7FxRuke7MPtCvY1+wt3UuqZsY8B1JgTA366TXTEyTGTA1fvuRbZ2tYUlKrP1vDyWum27LWuD9Py171hAhhbyufqmdOWDC9zMSaE9upfUle91I1vUzcztbwWc1I00zaMPA5+gDGS4BXcFtgnZp/2N/d/PMzUjd73acnBe3kTEevnTTKDKxzda37KLCWldTqBdYxaOefstX4s58cX02+nDxjduPPdsauBYFlX3NqO0ZBVZ5109N8mvNh7c/n834081ezu9tLS4BXcP0YlvxCedO16d3o0t7pYtwVo7AZbgq2a+X/4jD0VGaHTPJscw5HUe/6pNtLau+fKQpJEzcTaRsolSJjdS9KlcaS/GorUSDl6a6623EZ+5pT22kkmTZKpGxdNqcjgygt3j88aZ1WF1Xl0s64VK15GkY2GrAaLwFexsVQ6zUiIvvjJpp39ReZDYJ+rLSTCPdaWOcvT7I+hGJBSa3B6bz6eQ32GvuDls6HmhZkb7DIqz+CRQ+hsK05vZ1adZehJ6ND+eVLXhh6zRSrgxCqK/I1+hWOl+BZjf4mn8CjP5MZNwy6B7o4E0zFC7cn83ReeOqudvSSk/3KKc927cBNJbX1TU4z489pMRiejrzmKvTYeH5X+HlNi8Wy5sx2avtEUlZKyWezc95nqDLLSvnH+QvoaWDhr7j8XMJ7SvNc8vzg+6ew7lfSjCItCsn3o6tvoLxlzeKQywv6a6R5Lj/gGtCXNXxW5jN4ymZf5e2XAwuAicC6ytv1g+4A7uqZAuIZA7TnZy8cBYA7IrAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAM5sMCnlqRFWWhQCHzXuu3p0gGYHrThQPwcMibf3px0n8+VHnI8yLww8EU2nmal7nC0dTaWZbnZeCHkeV5VYvr81hMkQw80oWAyNe5+aO3N59hsNvVTwb390bjq1i3zxT3t8bb802zvF/KVfV5NAILeKT5gMhXpST5vpRX4bTvWk3rQ/fGbnG9Si1pnzZ12BjLt7aHUy2oz8MRWMAjzQZEviolL459SSoOh1LSZ/PEt81OUhT6eZZJap4sV/wrJcWBX+aHUl2SZStJfhSqevt+6kFMTx9YeurnJgKvbe4A/PIlBd3jdr8CSUH9w8lT82zeRJJfL44lBdWjhb9iSd5XV1RcvWXfLb6uPk+AyxqAZ7UrpODYPafSO/pSXj9+d1dK26qdtI2kouofFgfJ+6gaYd4+kspdW1S8r9aM9+1iB9ElBB5npgtW/Cd5n73n6h7WUvQhSfpfKf9kvLNavNuYA1TFf6rf9F8h79SeHFxl8r6urs8zeKOFBTyng6S4/+Tw2JOqFlZWSu25Pj+S0lKSchmL5YdSIUlFIRkXM8RS2Z5KdAyBBTylg+QNz+aFkjLV/+mSKWgWl5JnZFyzvJBkLI6atzuIK92BZ5SXvVZRZRvXyZOriqNKICmPqsWB8fZS1dsz9Zerbnk5iMACnlGqUchUV2RJkoqqtVULVSdQ3GtJKVf/ZwOBBeB+ClkCq/dqXylJ296iPK/7jeFOysLeW3tX0DuEMSzgGc0GVjl4MawDq2+tuh3mqxdx6V0q+BgEFvCMZptAlhdHi8p1LlU3Rvu+lHZvcPYiLBFYwNP61nwy+eogefXFopGkddMGW7s6fiURWMArKtf/8vraeElKfCn/l0pStjrMrfjsGHQHntTtA+PVzDPBR3OK0PtYlSreFSovJc9zt41FCwt4Rp51HH2R7N+mlLzEuK8nOHqSlGWl5B8nLnVwAYEFPKNAMxdLWU4ftiFUbla5pPizd41DcKqnK/WSz0DSzKyjT40uIfCMgkzKR02h+uZkT/0OY9YFVjVJaZgMR+y97TbPCy8INbog3iUEFvCMfEnZcC7jTPW5Q2/UXaybTNWkf/ZJkIMmpcrJC+CfHl1C4BlFslzh2d4UGPRuX+5uwSlXpRSdpidtb0ohsADcjxdK5fAKBDOwjD5hdyv0eynFHxcGqNp2moMILOApRZI2/Z5flldBZswzUy2vlyjLpGg/LmuzWq26n1LJd3UMi8ACnlIcSuV7b9FGzZQzoWd0GMu0WZxqeAN0LcuyNt+ywpxLyzEEFvCctpKyd6ONtc4l1XP6xd307tqpSaBUimyjU5G6OwjLdbW6m5jTHXic2TnUNztJftI8qWuTq3vSYPGvlHcMpGqm9+BTqh7mFQ46e9X7V1nzFIpylZvPK7ymPo/HcwmBR5oPiOpZqV7oS2VWzdDXDlDtNtUzC7P0oOZxhYf1uIyq9Oq5hHFQPa6wirfr6/NwBBbwSBcCYrfp/2y2jCxPft5YJo6pSzezrL5P54b6PBpPzQGeWNK7oio8mj25ffuECu/j8pCUca1DMp1Xz48WFvA4l1s0RZqXmRR4QTS8FKFIs7z0g3D0rAqr8pDlpReE1lH55fV5KLqEwCM9W0A8W30G6BICcAiBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBn/N+jKwD8cW+ProBLaGEBcAaBBcAZBBYAZzCGBTzOEz8D8DnRwgLgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAM/5v0bvKLJcUBl67IJcXGG/IS1Uv5qV8X5Ky9rXq5355+WhRV1yZZ5IXdBsDAEnSm3S+9J5s16RPlNSxkq0UHo23rDIdw/ofybYuuOVHcT+0stVoI01x6aHdWBxerj+AP+NtSZdws2pbS+m/wy2bKXb/0mXvLFfv3cZW7+UtWwPwqi53CXc7KYxCX3m+K7RWvLjspPpfkRcq3z/NHqRfv1Qe5Ef1IknKV6XkR6FU5mmhtDje0i8sc/U7rFJRyNo3lVRkRVkoUNhvz+WlNOiVZpJkbfUVWVGUnu8FvVf7HV/r1m31GvaXwyte7eqaKVegIOztQqb+ThWFRl37iY8JeBLnWV+eFDc/xJL3dT6fz0cpNN8VSsfmH8n5fD6fzYK3Gry9MSjmy5e8ffNTIimYr5zdcby5QJIiy3v33eHqJV/GC+Hok4klaX8emyrD7DNLUrj9Gq5qq9dwNXnRfumr9XviLpRC81VvsAeJJM9cU5I+LLsIPIMFgbXtHfyhtD2frw2s81bSyVL4oJhI8j67Hz/UFHadcWCdqoN3lBef/XaYZxyro8BKJvLqNCije8soW8wXp+s1Xk3yP5e9ej6fz19R/9Xg2L4Uyfj2OZ/PviQZKx8v/z0Aj7PgsoZCMo7ISBqf4Lss8Zasl6XSh7mxrbQrbtjcSNr7Xytf5ZLkh2HVcyrfp4foDjtJ+3F/uPiXS1KYJEnoSSrXM8N8wxcn6jVWrOY+vt6r+X9VcUFYd3Lz1a55LVDv91AUg63nmuxjAs/g4hhWPzB86aaB8CBTHl1600HqnxhMskyHrVSN3HzjSKpjIuvnTb4qJS+uzmAWh0MprYNgtHJVwlrWvNJ7KXnbqOqDZbtMWvtGTeN2r/Ms0+DFiXpJCrZGNdNcKt9Py17NV6WksN5ufjhI2pT1CtFGysu2v1hFlRl26n09AU9ovhEWW8d+ruwSngN7565XzJdG/ca95DdvXN5VGXUJPyVFvgZ9ry9fUtBt8SuQMWjW7xLupYnxK0m+UetYTZWreph7/eENKmav17hHa46ezb96PnmSvK4TWPdYm5d9mWNUdZh2W/fV/B6BJ7SgSxhI6ea7lxcsaiBlUjA4QRVLxS1d0IFUUhipbdFUdoUUHLstekdfyq3ds8n2lTJJe6PW+1AqMssbJUUfkjKjyWqv19g+lHkl7tyr61IKPo3P2v+MJW3qrYYyW1RZ1Z5qSy4K0SXEU7sYWJEv7f7bLLyOasJaC7oatlALbxszG0glL4rUHywqdpL3YZ719xLZx5Om80qp1OvkKdZ0toRB/0VrvWxizX0OxquHTPI++rG/D6SyHsbqDWJlpbQ1a5SJvMJzuziG5X2sSpU7KQzDXubk5tXqs6mSHrJq3H2ebXjdrxeHFy/Hn9t+IUVe4BfKi+5YPkgaXIAfb0pbdszkVV1HQyj7nlQv5uaL9nrZBHOFmq/uJG2HZX38K3VI/KZ2/XwKM6OFJYaw8NwuX+kefFaHarb5979343AuM4O1z/hWe8+kILm4odJytNzlfsK64TBoyhzqJpXJ2vW6kFeDsxBeGIYLr7y018tmvsDu1bSQ/FFN/VhNr9P31e1hJoUKjV43LSw8uwW35vj7r4/qHsIyff93Ww8tWnbJ+s/c75xKflQFQzdYlJdSNNze9ng8DsPhUl4p738kx+NxO/HOJfWymm/6dK9mau8vMMVqI9EYxKoGFs2M5qoGPLtFszV4UaQyzbNCylfH+sgZ3vw81v7tB9HCjkb2E4fLoaxCIfALFXlTk1SWDLDclXIhr8JMev9Y2o/KZISyvV6T602/oXs1U1XkgB/kzRaMQayqPRX4RX8B8MQWz4flxfvTMZTK9eKyj43togPa9qb8Dq2u9iju9b0Wjtdcal9Fkop/62XnJLJeE8ZeL6tU1iAavloUo/sfK127ymhQZdV9hGG78flYBJ7AVRP4hce9lE+eX/8m3zJ2n3//ECpTqboc9IbAOqwleTPNjupK18P7/94PF6/Jz94l+c1GJ+plUa4zKZmqhPHq5D51w/J+IJXVP7Nqy6HMK0hpYeGpXeoSHlJFRvsiTrOf6bdJCqVscLYsK2fTYpGuddLrey0aizusJalc227gq31U8+GUadrd4mMo23ivrnTX/kK9KsXG+HdWSvF2waulJhqkntpzA2FeX1lf1DddhVJ9FwKBBRfMXlp6HFyinlQ/X3ul+3TpRjHjy+Hj/r26C/UvBg/UXkCfqCtPsk8g0QhVhYvn6cIt2HszagJjRgZbzHUlTdTLupr/sejVZKqqxify0WyrvSE9rK/N/7z0kQAPdrlL6A16Kz85pV4s9ftV2UFXTL9lV+T17S9adAFBz1ryjh+SdnPtsfjztG/PN+ab/2bO+Hn7tqF0Vb382YG8+VcH2kGsvLmxIKgvcedGQjy/S4EVeCp23Y9lOjf6+01xoNKcZDR/l5aeX5yUquvnBH61B035l9f2jkGYqLpUf5off3x9buvPpVxPvdmLP7v4nanXWLbaLHl1yfVfXiAVpeqrsKQuLukR4vldvKwh3mnXTaS5KRX+3LfwflXmq7aHlb2X8uohn+JQ3UVyvYMkrxlICgopq4LFKxe0Fr1jICVpoXxzaetBIGXZoZR08LtrobrZGgbn76bqVTGvGcnSg7QLosuvzgZW87GGuZRFytrrdAOvVK7qjCyBhad3odsYSIo/vs7n82kfqB6r+pExrHpShPjj63z++ghlTOd382wNn6Pd9doaW+cUNPao2fxRWjyJwdZTMyvraLYG02S9bPMxbNVNIzH36uQolDm4VU+LmHSfaCx51WQZtjlZgaex5LKGYyAd3v/39vb23zqv5wb4KfHRqzf2v/dM8o/fbs2NO1plNcY0mMuu9vb2Zjzup9581SlcNnqXHL0L3bsL9bIWarviw/Lq4N7qjjkLQ31NVmb0SKUy4yosuOByYHmfxn3L4ed3B8HnhaduY15yWnwA5auVfZjHEh3VIW3eVNd7yQjkZvPboH8pQWezGc5jEcSau1H5Yr2sIs0lVvfqxOh9ae6XF0hZb8KfSFLGEBZcsOTWnO02zYtSCvz2tt7h7AnH0T8WTa8wnoTB227TPJc8P4hm39hXThztaSEFRvcr/yelpScpWkvpfvD2qVbG/p90CC1nG3b1hFZmVXcLhvOn6zVpvoVXvRqm0mFczbQ0z7aGeTWzjBFheRVYHi0sPLllT36OfuzM4A9vbHhzXeAXUhpL8sJM5SEev9120AbJTlqPrgqV/MLamrp4ncF0vb4l2pTKRhf2lrve1sJdFVhdPIW58iKjgYXnd9WtOY4w7lAZ3YTXdZoiSYOpVLPJE2XbUCrfx8uD8fyihRZcXzBTr+/wYo12qppu1HjqYqiq0lFvyUEMYeH5vUhgeTL6YYWaNs6h7K7OrMRqZimOxxm0kWXKmcrek7LdaHFYr2WYv1FZF+v1LYkn5YMKHQ7qTzoTVpvq4in0qsCihYVn9yKBFRjn5sru2BtPmOIHapoyW1XXerXWuazTSUn1s6rHzxyLfSnvXSi6y4wbnKfM1mtmnYuventJh5XZxtqsNbh1OqiGvIxFoVQyhAUHvEhgVR28XJLKTdlERmlp7XR9ryCRlP5rribI/h1UXSNgldg7hVtJh3/dJMObjYwbnCfM18ti6YyjUpRIyv5ru4WH/3aSwt5lr1VSmQ/8CI3/Ak9s2aD780vSUsUqDpWlhZrISDXu4kUbNVOob8uDVKw3oS+VdT9x+oL2j/9KywXvUbKT8pVfHf5ZLs3MBNO4UK8x6zUY9le33kYqd7swUD2VgxR+9N4/jqc6wi5UG3gGj7569T56rZpttSyQ+RS+c7ewuep7GD/GdemjR9WfP6Tec91tG+4VMnml+3y9xteyn7+6cudfPZ/P549h6o3qEGpYgeEz64Fn9EKBde4mY/fqx4aeZNzw0tqqe9Tp+dS/gc942ziwzpEk/+s8dOpdjWAUMhVYF+pliaRz0P6i5l89n8/n81fvCUXx+AakZPRrT6xVAp6L9LbwEk8XHPI8lx+EEyf67Io0LzMp8BZPPG8royjyUl7g+9GSGRN+XprnRSEv8IOrPgzgqb29VGABeGlvL3OWEMAfQGABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZrzKn+91NTKHumxP0ZZlyBQr6T1jNVD3Fp1EUgwfS5GVVTl7231iv3HtvkRVF6fle0JsnvrQ9Wrpeb77U3pr+5dkGLdtf8smYJRTjF/v1N1+8snD8QY+e9vR+vvZRKAXhdjAr8GcSevKXLj6fz9VMxDbdlMfHuEuFcG+s6kkyfx5NPyxVM6qHGs923F+077LLS4zJma21q6s2X+pgzSCx7fzs9i9/Mn2BJEX9ZcMywu0NhX8mYSCF8b6/+Gsb+QqivWUNuE7SCwXWtkuQ2Di6T13jILm8uHbpyPkaPKUr6KZyjyTFRlHDBzwcmw89lNrnZTRkpM2pP2ezt+8XMVG1+VLHa1p2fnb7VwbWqXq1v5FxGVcXbvz6fPN5Gu0fgX8crQPXSXqdwOo9CyJoj5BP75rFjQtHTrN2ELbPgG8zYisp6Eo6DY+4rer4CCXJ629aXWCdqm2ESZLUfc42sS4G1mSpljWDiaflTGz/ysCqH0zUb/DYyriu8N6vz3jZ/COgkfVyXmkMa3eQ5EehijST8vf6b79clZIXB16RH6R89Tm7uBW2h06+kYL2eWDVWEq+KiWFcdXMyg8HSZuyflO0kfKyPaCqp6Magza5zEcAluv+QwM776XkbeuHSGS7TFr7xkhWPGjjyTyEp0s11yyKQynlq0/rCNHE9uc/mZH6ObVZPHyhq3+eZbqy8GJVSooDv8wPpbTz6+I3B0lR6OfZ8OPCy3h0at7Hl6e2lXP01D53L1bbgPo0RpcmFltYnqt18iR5Rpej6jw1Zfgyn/pXH5ddk8eXdDyf67bQ4AGB3cb2knxjhClW93iyySceXix1uOZW6rUHO3Pb78oajpYNfUqKfA36hMNafHijouYLj9W2DL9itS3KU/erTEbVhfteKLD25jGwVTPO+yWjf3RsD86JxTaWIyeUFPRHq2NJ3qn7d3c4elV7qg2QU/uZh1WrqPeow25jUZNr5laPXZ1mAmum1NGan0bQ98xtvyvrUmAlkvbJcBOjWhwl6TRcMln4yfi0q5pWpcXGhqLZryE46YWuw8okJc0PidecIM8ltW2bneYAACAASURBVKfzwqDpm00sXuaQSd7g+cr7QCp31b8DGeVlpbSVcb4+k/GY+CCRip11K6nU79LEmntevWmm1PF795J25V233y/FiyI1PeMpYXBV4amkpP0FbNviU8lPjKVXVxfP7mUCK5eMy6ECqToGM5kDRmG9ZGrxMjtJ2+GoyocnHYpxcZmkMDQWFL1NJ560m9p2fxthvfICs6UORKFU2uPk5u230kKKvMCX8vlVrys8l9QN4flhvW5WGov9SEotQQynXRdYb29vb29v7T9mDN5/8d/z5SxQ9EedTRPLb30kclpI/mgM2Y/VjDD7vrqAyqRQoVTk3YKuhSVvL2k9saX+4eaFYbjw+snZUoemW043b79V7+zlJtZ1SskzqtI0zzKZOXZdow1uuLGF9XxPiw67Cwx6i2X+1batm4nFi/Q6n51Y7UEZqu0TlnkdWO3mcpmBpSiSio19S3m/o3o8Hrf2N47MlTp6rzeVJrdvv5FWLZ1I7enCu8j7v69SVWuwf/611zPHi3iZLuHxeOxaPVVMSNVfbXs0Fmlz18rE4kX63+MtP2ibUcahUjUxAn+wwLD1pJ3lwAolvd98wE2VamPvEX9v+5VD3UcLfKOJaZXpmiZvnCTmbyBXFVhF76O9pQuLZ3drYD1fE8u0aQczvEQq1lXfpnxX0zaaWLxEUUzEW9euMhKgvosvbPOxP3qmepTY0hiKJBX/1jf2pKZKtb5XtiP7e9uvtNl+qU+YDdqdF2y3W6NPnuf1VsY7wRjWq7n5wtHz8uGlWXcqxlBmh0wK67/obXnQIYsDKTuU0j6aXbzAZP8xUHPI+EGusvAlKauOpfAgpZE06hFKSrJM2W6UmHGaSTocpoaOymGjaFGp8xW/ZvsLlKkUVPcS7qR0uj+Zvatqot5krWrnS/V/M2FGYL2cR1/pfu+82hyqv9Fo3yzZe7t2OMfrgmli8WWlJjovntpv9DCvr+0uiuoYCiXlE4Gl7T9pF41C4eM9k6QyTeWHYTjc5mE4KDRo9E6UOlFxiwvbXyBV09AN/EJF3kukLnCrK921103KTV5/PVn6nIxhvZpbuoTV+bvlncL6/fWVX/3ly9ZdXre8iozkozu+jIPWHJefWHx5C3Mv1g2VdhArVRVPXtMnzMtx1ydIpHLcffOO7WQJxeH9f/9sF0vNmCh1uW9uX9U4e/1VMB52P6wam0ySktvuo8lXh/qsKP6Cbwy6P/Mw1u5fmyubf113J/0vvbD4PtpBrLwacJaCemKo/oms2jaQUksV4s/TPmqSN9/8d92JtqlSl/ve9lXk3dfCpUEsb3/tCUhJUrn+l0vekemy/oqXOUtY2x6PH4kv5au6x7HZSV5yOp/Pn7FUvqezixdY1MkKpKJUfRWW1B2w9sHlraS1rQHjxx9fn9u6lVKuzUur4uPA8lKXm9n+ZU3zUqpie+LyVEle/Dm6sG2J3X8HScHnraNfcM53xrDuNe5+T4GkaLvZqXw/eZKynRRUt9EE++i91DrwpxcvMfu+5sgJcymLlJXNosArlUvKq+7hQJjsVG4m+jVBIGXZoZR08LtRdEsx15RquHDuf2L7lx0kec1IVVBImTlUaMw2ccU1JaZsk0vy4pvaZnDWVfce9le7VOrUZn6wipX2Llhf5uR5W9Vz600sthnehfs5+LmVqLuj96P6d9LVPZa86qbrdvbNsCvoq5nCYarwema6+obtCzc/z5RqWzPRYHKHi9vvypq5+Xk4Y48x7+pc/ZcVfj5/VdkZd7dMfw1KDZmv4dX8YJfwsa2vRNUgUl5IsXHnnl93zOyLF5m846NQ1wOqr8nKjD6RVGbjq7Bq3uXuW3L05npVNgtKlaqKX25fXr398VvLO17tnq92ksLjvqu5p/4pkWxZ/x0u+V5gzTWVrju7Zym7F6xX8v3qOByOcYfVVfATi5eZGD8uzWvYvUDKjAvuq7WyiSEs1ffSmBMsbDabwUaCWNdeuj0q1Wr44Is7bd/yGd3v1r58lUvex7H3YY57lrfeL4pn9c0W1tOcKdysVivz5zqwho2H+lqpicXLhLLeGJeW1f2E3ZuycYTltmyQJO0H99LsdrvhRoxbFJcalmpzKG23Gn17+2nRn2XsU3ecPaFclVJ0Gk6s34vE5oYdvJKXOUuYZdngaPipb9fIq7Oop9zJPO6bwOriKZTyIptoYFU3C5kTLPj21syVOzUs1eYgW6W+vf3hLZeBr/tN2fBeSvHHsDL9252tV5DAca8SWJ76HY6su8LcXFyPM00sXripWNXdij2boncBaiipyIYRdtD0MZSEUt5134JqfdOysabZUi12eTWjwsC3t99d5l674xwzWWbey9Dq/1pHt5njBbxKYA0iKFWVDL1ZGeqb26YXL5R41TMSTIeD+ndQh1JW9GYJ9KYaM7W9qrkB2/WHNy+PImCJfqljh42qK7YGvrv9Q9m7mUD1vFv3mT4hlb3O5kQ5ZVo1hvFSXiWwAl86tN2BcqPq2PL6o87r+cULeXtJh5XZxtqsNbi5pJ7ztD/dSTk5hKVqgoWuzNiX8l5nbpfdcoNwv9ShYr1WNTY/9N3tj9s3/uBr4hvSYRjWYilvttDvouNFfPfm5/PsBQzjMfm3evncCURzrbfRkgnRTlodq+OpeC/qacIVp9KmbvqUm7Tu0E0tXihKdlL2X5zUX+CHXSEp7H3nhzupuS+nXpJKs52UbWYOaW/fpUO+bd5fHHbq3SA8bONVGXOp1P6aeSbV07qP17uw/XmlpTkW5VJ6zZWnU7JyfJvkVpLiQ6l1FaqHnRQQWC/nDrM1zFzwfsUd0t+1zXKV/6IgUJGnZXs/bJjspM0hCrxqsaqR2onFizfmbaRytwsDSUU12h/2nwQYGv81l8w1Ufb/jB+iZCflK7/KvCp1zDbceNx/YhaYXqmWNUP7vl/a/rxU4w5ZtJHy4g4n7gqNd38rSX6yUbmKYz9LD7p5/gc8t6suNLWtdk3Z9eLFFVpexa9eFHjtdez9ptP+wuIx+yXXH8PjbnThdigNLiAfPrM+HBWcyNzY6Hhrt2F/QPJxQamjNf3pXZ/e/twnU+k92cxcmDRrfuNKd1srrX6JJz+/tPuMYc3Ez0Tj6ycug/eMKZIVn9r42hvZEnb32E4sXir6TMz2Q3wajQFXE9f11tHcEJZkPrqqKrRXrfDqGdWtpfaKjD9O07v+je0XeTVQ2HfvZ1FY7Nsw8z5uup8az+3tqos/zaAZjzTZDAtfElU3jWFJUnHIi0K+Hw5GZNOsyOQFQRQsWbxYmudFIS/wgx87G1WkRZGX8gLfXzQX36tt/wZFmuWlH4ScIXxBbz8eWMPSfzSwALyyt28MuvfCa8G4exc9yzqERBWAgTtdh0WuAPh5P3/h6Kg99YTT/gFwwr0C6/ozhQBwpbu1sBZ3Cq+6MB4AOr9xL+Hb5A8AcIVbzhJWDaG30b+/q38+0fw3TS8A+qXZGt6s/xwilQDM+53pZegHAriD55kPiwYWgAt+KbAuN7HIKwCX/FYLi04hgG+75Szh+Mzduf/SDc7GfzkzCMDqzi2s6ZShiQXgu55n0B0ALrjDnO49MxPN/IoiK4rS873AOvt4Uah6jH0nL6VgMNeb9dnt9ofZh7ZX7DOf37zxIivKQoH52MN27bD/vrl9nyil2WymXIGC8PK8d/MlWXYTuJf7TOA39Z7l7jNp36F70pcXJ+ND718uKeo9LWKVSeFgpvO38SJJ2cqyxbP1FS8Mx/Pz3rjx6X1aZeanNL/v869mafcQ+TCan1r4hs94KMvyvAz8qUlB/+U6DrOw+G+0rDzkeRH4xic9eizHbHJailSRZkWvzNkixzXAz3qT7vAQiun3LDcu4foZ6k/9hok3egjBqXrhy1wWStJ2tAuW5x9Yn/ww+Yr/OVj9to1/DvbpY7D2sn2fK+V8/hpMvh4cxzu/rKSJ3RwUEU6vfT5Xj5gY1WA7WrZt0s5vX7D8GmYedTEu8qtNnva3N1ekpQb4WZJuCKwlS64xt625dwycqr+fMEmSul8zTKz6IQq9xaEkef3jS3cILOO5Pd/Y+Ge1I34YNl21fX/tRfs+W0rzqoKw7eMNMnRpSVO72bM3m1WWDR0lS2D5w2W2x+NYfgszgTUq0gzj5rc3UyQP6Pl9kl4nsAJJ3r4++qvG/uDvvm7LR+aycLxoJrDi40D7SmAs3AaS5H9/45+eJC85nc/n8/lU9b8+e2sv2ff5UqoMCuvGTv38oInjfL6kyd00HSXJT47H6hGtoyP9y7f84s7b4bJEkqJ9XUr9kuVvazqwRkV+BZL85OOY+Gq/RqaLtNYAP2t5Ghjvv3dgzW5r9i09e0n+qfs51jAzPlU/4dxs0tSNil7nRJOBZf/7Hz9DL5YGB+MtG//yJQXdPn0FkoLe2tW/Zvd9vpSTJ8kzjreqc2ltMlyoz+RuDouIu1p7w/dV3VNb989cdvLaOibdvg6+TGLJn+yajoo8R5Lir3a/4vki7TXAz3qGwJrf1vLAioZ/gOFwQaL6uXXb/rs8Df6yvx9Y51CDVsYtG08kBeZrX74Zb11gze77fClhP4PO5yruvP6iRfWZ3M3B63Hzw378idaD9cbOfH7Uz1U0dzA2thBN5OvJm2r4WIs0f4lfE5FrFLmkBri3VwosDb/mPoaHgy95X5/qNwpCKUwG77xDYH0Mq3PDxk/j4NibOdgF1ty+z5eyt4VT18DouVSfyd0cvt7+FEpefxNe9QTao/kWjULs7Bk7fBrWodsL+6/LXmQkqd257TCIR0UuqQHu7QkC68K2rgqsfmh8Df6MPqrD0Df/MKvM+Bp0D+4QWKdBtW/Z+DDKzufz2TOK7QXW5L7Pl+LL0jg4ef1qnpfVZ3I3jZL7Ufihccsw6p8ltKZL/1cRydYcSiZD01rkV69mpzAMx20mo8glNcDdff9K96acm9ev//9mMEu+qvyy95MXhqF5FU4mKbQ+L93bS1pfXfc5w8t/btn4QfKSwbJQ1muDZvZ9tpS0kPzRZUR+XK13fX2md7NSqPfRRP21tcmqj8MQhGEYhoPLeLN63fotsnwmxUHa2qowUWQq8ypcvxqvmi5yQQ3wQ64KuMsr3LbxGys02O7w2qeeuhH/qV7/KZTC6iuy+8LUfVpY5hf8DRv/lKVjdjoej6dubeMLY2Lf50uJZR19OckyjHyxPuep3ewMr7FSrxH8KenDeh3Wsb8s7P2VWH8x4ewlDeMiY11sJJlFLqgB7u/h9xLecUqGUNK77e6Z2qGsvhMDXyqG79t60m5m5atlqr53v7HxtF9ExR80Gysz+z5fSr+h0L0eWKq5oD6zuzmhaP9VvkuJpTbWdYxr1MNeKXVNMvnD1uClIoc3Sc0VebkG+BE/FVi/PzlMJKn4t7b2RCTj2LT1V/xE0uaOtUnVS4JbNl7IEhB2M/s+W0oxdZiGkoaBs6A+s7vZlGv0ncreZnbF0pAZh0M5+HEjWW4bmpFVJ2zLbLM5WKO2X+TFGuDHXNUiu7xC857rNn1jhUz1N54X7W3jvV9q+mj9/kpY98BCdaeptfTCUeOV3gpfsXp9hJs2Hlz6KIxuyfS+z5ZylPV0oOUM65L6TO5mZ3A+bW/+uj9U9Wsvdwm/BrULR+PrifU3OFPkWVJyPtXfMb6lf9cr8nIN8BPuP1vDVe7bDPt4zySpTFPz1pFG1+QJ/EJFPmwrbP9Ju+jSJAOH/lC0sQOF0UQqslKKjSHfmzZ+TQ91et9nSylVtStGPI2bDJfrc2k3Jd8vlHbLd2Zd1lKyrEVpqUl/UbGTruoQVi2mw6Zs1s/2g6r0i7xYA/ycqwJuuNq4iNs2P798YfV6f2TBtjeGGqg90967eLFp5JwTtV/+Wnov4fQrfu8qnps2bq+FoTfwO7Xvs6XYLlRo92i42sX6TO7mYIvttaex+SG2jZTLLazhGHd/BPx8PkeXG1iWIkNJ8usbKoeX4PeLvFgD/IiHD7rfV/x52rdTluSb/4zmUJHXt4xoaoBlG0jp5AjYtXyz4fIbG5/Z999yeTelxJfyf6kkZSuzjrvxFQ03y9JrG1jValJ0Oh2P571XnQH4fpG4t4d2Ce/Pj2PlWV4dKuU6bw8B8zKbwC9UpqPTUduVtL4wf1286CSWpCxLui7hzRu/qpsxue/TpVw7zd58fRbspryPVaniXaHyUvK8ZvA63yzuEF6209Q0hRfsqzZfHKxKZZlZxM1F4r5eLLAkKQikLDuUkg7tWaeDJK85PxUUUjY6mMJkp3Iz/y3vTf7RmpPuZelB2gXtFm7buFdef+ZpvO+zpcwG1jA+LtZnwW5KwXFVqj5V6H9smsBa1zcp3UOR9a/VaKeUtMzK2NNOXRhs19LB+F0Pi8QDXdWFHK42LuK2zc8vv6W7u/XUjUR8jopv7mEL1b/l9Xi+x4WjWxmnjW7ceKiJ+1sa0wMnxr7PlvJp31P74Nal+kzvZt9XfXGAl3y1NxMmxqDRTWcJzVOS8eAMZVuf3q6Ox7DMa2/9/mc7LPJCDfBDXmwMqyc5elJZj6OMh1PK8SCPt5W0vsv1NIlv9J9u3HggWx+su3dpbvPdvs+WMnlLSaHxzPSX6rNoNyV526/PfbI9fm095XVDLpeC3aaSS0o3m830vS7eoCZZr61YHm5oDYWqLpc1fzYuaR0WOV8D/JxbuoTzs7mfu38uMj9P/OIG20YK+n+mQbxr/+gs47/ZeCbuKEpV7CbuQLtOtJOa0/c3btyXpVNV36zXN7fv86VEqWQZaSptm7lUn2W7WVWviYayO9AzM6AOslSg442+VYzRv4Ok3naX/g2ZkeNJKtoFoyLna4Cf8zItrN1uN/w+7y7XTov+hX2fklJLU2p/1zt06g3cunHribbBLT+VuX2fLyWU7S5npeXwAL1cn6W7OVz7lpZJ0GsY5v1SDtWtQVeaXWNc5GwN8HN+JrAe8Kwv3343V/W9N7xlLvBlbRF4ie49bcPtG/dCS6fKGlhz+z5fSuQNmjaSpHInS6/qQn2W7uZw7VBqJlCo+PXPMwnQ753mMj+TvLhpfDwYf4ZtBSxFztUAP+uqMa/hCuaS9t+/UZWh0aSb5oSWo/mdEhlD2+ZYbKhqCpHvztZgjBzfvHHLFMJHc1E76D677/OljCYRPZ+rCzotH8B8STO7aS4MQ2OZbxurXjBbw1HmlKb92aiSYT0mDIrc9lcLzFMGliLnaoAf80KBtdfodq5Q9Ymf0byY1fx6p/pN4eAF766B9Y2Nh6Nye3OBtoE1t+8XSvnyNLokfS9LZFwqaW43Db00sn+iCwLr7Bk7PJioMVh4wm5Q5KlXl2OvTFuRMzXAj/mZLuFDHv4c+1Le683tsubEz3gI2Q9k76/4yf3uu8/a/9648a2k7N1Yss5lu+B6bt8vlOLtJR1W5lY3a0mJbcR7rqSFuxmpu4OwXMsyVLZILOVN0f3+a5HfdsWUHxkjiOXGrJm1yOka4IddFXCXV7tXBa6t4odkPgP0lEj1V+iXNGqxtxdKhbZGw/dbWG2X7FsbTyTJb2bYOwbqVaG7Dmt63y+XUl1emjRV3PsTuz9f0uxumkI1bbKvwP6BLmlhnbz20YGD5uXEbOxjwyI/1T496CvofQTWIqdrgJ/zHIFlL+rawKqOJvlRkiRJfZdHN4ozbLG3/ZVRZnzeJbCOzR/x9zZefct7UZIkcTUGbHTfjAtHJ/f9cinNo0/DJEmS+m7EcGpAZrKk2d0cfjDyt8ePxJP9OF8SWOetqgckVhMZG1d8RpZtWo2KTCQpbGpmPG3DXuRkDfBzlqeB8f4LIXI5n0Zu3lbf6K6a+pgNZPmGbL7eR5lR/+GOi78qsL6a7X9z48OLwqamCJja98ulnM8fw/Nx8893t751djd7zJqOhvubj+BiYE0+d9lbOIR1oUjzud0TRfLk598n6d6BNTxwFrlxW0On3oBIWP85nmS7SWSr6s9wnBlfvr4fWFXn7g4bP0WWXar0bs2x7/uCUs7dzTKVeLaBYi9pfjf7PtqNJdaG3LLAOrdDeZ4ZlJM3G43MFanI+Axm718a1wA/SHq7ahq9+avSR29ZzFbWgm2NFWlR5KW8wPcvTsbniiLNy0wKvCCavdZnft8vlJLmeVHIC/wgunTJ9tL6TCoPWV56QfjN31CRZnnpB+HFCl9ZpBcs3bEfqAFmvd09sG48Q2gp7KbAAvC63r5xL6E1UG69oqF5FqHxAyEFYOBl7iUE8PruG1gPuWQUwF9BCwuAM+4aWDSwAPykewYWeQXgR93+EArzjN6SqBqfWxwzzw9yWQOAAcawADiDwALgDAILgDMILADOILAAOOOWs4TXXb7QnOHrzgDOrD96qCHnBwG0nqyFxaVcAKb9eGBZmkhzrSYSC8Ckh7Sw6OcBuMVPB9bV2UQTC8CUHw4s2lIA7ue79xJKSxtFS+4llKS33vMnmH0UQOsOLaxLVyncsTwAf9r3A4t8AfBLnuw6LElEIIAJ3w6sn0gXEguAzXcDi2wB8GtuP0t4ranZRKff270fAPTtFhYNLAC/53uBRV4B+EXPeJYQAKy+FVg0sAD8pu8EFnkF4Ff9xlnCqfsBz/OZZ8w+yrlCAPpWC+seDSySCMBytwfWj3cI6XEC6Hv0WUKmSwaw2KMDi04hgMUeHlhzaGIBMN1ylvDCswXb99jO8b2N/n2eKeqNBhiAzo0tLNo+AH7fbYF117yiEQVgmWcYwyKxACxyU2BdvD79fuh7Amjdu4V1U15xMRaAJd6uyphHpQedRgB6e4oxLABYhMAC4AwCC4AzCCwAziCwADjjunsJOVsH4IFoYQFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWACcQWABcAaBBcAZBBYAZxBYAJxBYAFwBoEFwBkEFgBnEFgAnEFgAXAGgQXAGQQWAGcQWAAAAAAAAAAAAAAAAAAAAAAAAAAAAACewpt0fnQdAGCBN2ZrAOAOAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA44/8eXYE/qsyr/weeuTSr/uf75sI8L/L6vWFgL6XTX3VBEXOFGbzAqF9fOLVOXs7VqdpmlhelJN+LJnat/wE1RVYbrX+qyy8KW33qpd5ot4us+kx8L5zcAzyjM37fsf7wj72l9cKkW/KV9I52PznZSjEFyWd/U/NFzBfWCs36DUyUeGpejyc/hMgoxbPvWm+FffPmveXjamJn21slNOvffSbbXoDF/V8DntX4TwK/Y2Fg7Xvti+q4tpQyTBfz0L9QxMXCzAN+8mVbidt2e/aP4HPUsEm+xrXprTHYXP+npjjvy1zHGljb0WcSDlJ+LArDsHrXNgzD0P4Z4meN/iTwS5YFVmzNjq9RKUNed/hdKmJcJasLgWVrRXVtmL3tE9haSvG7elsC67OJmWZj9Y+DwOrXxRJYX9YuYL9hNvIlSTq1RRJYj8Cg+1PbHGxLs/eLK5arZjzq5iKudBhtp+iGxGxDX+uNZWGxmhlHK1b1AFa8n36TJB3mBuOk/D/rUNxmPb+WJHl++0/GvR6DwHpe2W5iue1Y7yvX3y7iSptysMBIsHT42lSQGkk7ful9YV5JszuXr8a1kSQdZlfLJCmQpKJs/4lfx1nC59WEjRcFvqQsaw7mQzIagxnKD/F3i7hOmQ46n6n572HHNO2C1A98FXnRFLP+lFUbZYGtL9mXHawd4XoDXV6FgZQ3Jxel3dzpwkKqU6o+t3ixFvghj+6X/kkLxrCaIzdoh9CPzem+7UQpX8f2SA0WFjFbu+HyXv3O5/P5fGrH9KP+W3u5M3jt/NWetwzrqn+2JwwTexWaHQuM4bf+Gkba+N2bhmNY7Xb8ff2mz/5nNsGX6sG4xLZH+BV0CZ9YPdLiU8vaHAAAH+hJREFUHbujuxl2tg7CSPLCfdNfysvbiriSHzfJMigw7f0w6IXtmlbN9lgHSvDRxIa9r7iuFwfHJU2bYqInLGVNveLPuC4p2Ddl5tMfSjlsYS2oBX4AgfW06oM6No5Qr+4OzaRN3Bz4+c1FXCeoNzjIpCZgqv+l1heVJN2yfd32KQfvlSTt6jW8j2VdsTYRRy/U/4/Nqz3CJrHsYSnVKWUEFmPuD0JgPa36mOuN7ka2N/Y1byluL+I6TWOjN1xet6miemv9JDjU4Rb2hqOaHyzD7s14uNFUvGBiAD2rczrsD9w3oTud4l1KMeb+UAy6P7teW8GLqx/z6QOm+e431ru2iOsEg/9Lag/9MKySIy/88YtKzDXkR1XbahxYWX3O0zsurnOaWdtATettOHCfVBlaWj6UTde9zN7af/5PUnJ5+B/3RmA9u6x3WF88pf9DRcywXSXQ9OsiL6jyJzWrUL84PCkX2jqDkvLmqrFFeRVWp/3WJ9uLTbWGBXnH+rbEBRvAI9ElfFr1QZWtJ64bmtC827+9iOvULaJe+jQ9Qq/pgZpZ1DSwhm2g+gr14RX37QWj+2XtqyqQrePuWV3SuFschGEYhiEXKzw7AutpNd/2h//WE00PqyYO/NuLuE7TXrJUImyzITe6pU2fb9nAdXvB6H764qqeuuG2s4T0dVvGEyKwnlbUfN2Xh/e3f5vdwvN6TTIFtxdxjXJdRZFvxknbI5T88XnCJkkWNZjaC0aX5lXTxCot4+7NSQgaUs5iDOtpebHRq8lzSUHgT09nVdvVyRB4NxdxUd5lQd7MUNWbAKE+KRh5kqIqcA7dIJatDznpvbnAfXFeyU92knSIx3NgVf+7Kq+2W0nvqepB9vRdkvd1TQm4IwLreW3LwXVBeS75UTweGW5PrBVp04iKriziGtm4pbbvDQuZvcSoSrfixrOSzabyzfJzcvU5v83U/BNGTYr+5zP1wXQXi+aDAvDrHnux/R+1bHqZxPoLS0aljLWTQl0qYrZ2w+VTWwv6s0k1J+iqOgTDTdrn1JuoQmc8yV5/Z4xi6xOhH8ONjfd+sJmpifwkSZ/tVphb5kEYw3pu25OtI7T7d/mkX3tv8+1FLBd/9psc7TUN1f96C2/3PnX1uqVCVUyNZpC4VdXM665zp4X1MATWU/P3X/txNyW/OJ1V1DWsbi3iCodVv49Yd7Pqxk0dWMX8LFWXlVdUudr90aUNtwYN17k/DQLryXnx/vR1TKJe5GTTN71JkqLexaE3FXGVbGWW1lzCUCeV5TzhdfZ18uXzU+yZwqpZeRg0ypqbnK+tweDOZ4/rSx+GQXcHVM91ybrZrLSbO2fmJeOBqyuLmGc8BqdpWm2i7tRbv0fYnidMm1Hzeu2l/bV9HP1Xvfew/FThNi0llZuP3tK6Rsv7ljXG3J8GgeWMMFTWXElVFFNf8l4YRpOn7ZcVcVHUnbAr6ytSzfn76sBqL4Sqk6lobu+7rp2zj+Xt697gJliaFfUFHWm/r1rvsbHrXnNxxdQlaoeiqWq+UbNvG41vLMKvILBcEobNvFD9tDkuP3imiriR9/Ff1V7pWi1p/c/RxQ9pM/dV/fPw/uTmEoP+HA6xpKi6skrletF0WJK0raqx6b0/rAe1sm7OvuY04Zvsusjrer3VnhFYj8AYlluag/kb16zfoQhTc+9Nu2CyXPMafNsbs12lt7Dq3TaPEbxiGKvazf6cfM2Wx+N3P3APAH4CgfWs0tVqtVqtBqfGvGu+1+9QxA0mB9ebG3amRuGba9pt6zYT96WTc4kORZbd9Jp0HeXTz91qibuiS/gY1m5Rbr7o1QdVae0ELeoZ3aGIxdoWluUROY2szouwenMxeFZEc1ORbVW/G8Zamrf7/8bLmhls1p/9vc/vec4UP4jAegzPq47r3ld98zXvSd1xO3jijG0S0Sl3KGKxNqZm2ippfbVFc4fjpnd6oLnM016vZhhL76eFSesn49ZYXM+dXGx6F36U0z3NKKjnVY491eNz1c2YDGE9yqMvt/+bmnvvPrpFzZFYP9q9HhPvP3m9OU1fLbTf4NNZUITV8qfmdPf+1D82twXXE0zVBjvb7Lz5CJzmMTtef9e6N7Qzm05UZ3THz5c5bXu9rM2p2Nj0qc1I6wd57CoSSBMPssZvYAzrYZpjeN12RtonfPavEC9XxmVDzWTBCydIuUMR12oaWMcev/9iE3J5d4n8blX/I56qV/PYiHzpQ2A9y+3S7QwOxtX5h38XHhUtNe0+LsN6NALrQZreULn+b5NmWbZ5/9ekSt2Ba47c/L91fWyl6/Zp7cs2cocirjW8arT+sX6x6fV1ibU6ZGWe7f5rOoSe/W5tGU9Q3S0dcBrPL9PFnvLVf5s0yw7r/12aj7W7zt24pxAP8+hm3h81ObV6+4xO89D1etP3Nr2iS13CBUVY3d4lbCZqGHSbPoeLJw/6ptdoq0KTsd6nrTqWSSC6uRi6pROfezD9QQZS/eDZ7XAD+F20sB4nnmjiBO0RtTWO6jLLunaAt/g5Enco4pLm8tOq7KbTN5g1Pajf1XbDpp4nkcw9hazZm3LpHPWhpbTYuufex3S7qesHdm0tPAiB9TD2OX/NRxtPHNVXPO3qHkVc0M4bL2mqRzjqE05VYP7JWV47jLX0+tGtZUCs9wzVtjr+5AdShWwo8dDnJ0BgPc7ecjgl5r0n3qdtQCf8vCJs7lDEBc3Zg81B9TTMspzzb5o67UUP3nFcMf/jwqyi7TDW0utHfduXQvw5rJ53DKYvSzNSijH3hyOwHig5Jf3DJD4NMmz7OTziwo/FTz++WxHzmuJTTfYIuz5hd5WWtz323+UnnxefSt32ozcLb51ObHvqH/tPDItPwcx1VYy5P5M3aXLiW/yCNKtbJX5gn2ahTPOiHvoJ/CC6JWruUMTPKNK8njwrDH559oM8rZ+fEQYXZrj/l6vuq+42ksLpeanx094IrKdQlJe+tsvc/27O3KGIH1HmD3vsVr6kubSR6qdTZJmk4GIzED+GwALgjDfGsAC4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM4gsAA4g8AC4AwCC4AzCCwAziCwADiDwALgDAILgDMILADOILAAOIPAAuAMAguAMwgsAM74v0dXYJG3+v/n+t/nwXJNLKuWD5csdzb+/TZYNqzH3Hun3tPfn+vraa4//Czmtmcrw/bvW+o0VU+zNNvPlz5D2+99pu5XV3y875O/4/t8KJcqM9ju3N/U1GtmcUvfM/XeJ+FGYH3P+ef/wF7RHT+1tyf8y39q7WfPBzfwFwLLEU8Wq3etzhuH3m2q3wKB3/oTgUUT6wnwO/gGPrwGg+7o4dDAM/sTLSwnPEVSPEUlMOeP964JLHTIKyf85cwisPD73v7uAXcnw4tA/gwC60n8scbNX24k3Msf+5OpMOiOB3n7kwccvocWFh4WHCTWHfyx7jWB9Rwed+ySGq77U79BuoQAnEFgAXAGgQXAGQTWU/hTwxBjf3z3sRyBhSdAYt3FH7hS5O8E1p86+eucP3Co/YqX/xz/TmA9s1f/K8PvefG/JQILeCmv3cj6Q4FFnxB/wysn1h8KLDy9Vz7SftMLN7L+UmDRxHp6r3ug/bKX/SD/UmBBT/+X/OTVc8erfpAE1t/y9H/HT19BPNSfCiz6hA7EgQNVxOP8qcC62qsdPE7szwuPGOPbCCw8HRILUwgsPB8SCxMIrFkcOY/B5w47AguAMwisP8KxNotj1cVvIbDmvcqB49x+OFdh/AoC68F+58Dk8MdrILD+AvLqb3uh3z/PJbzg7QUuj/+Rv9fmc3nr/v1Cx8WLeYW/4gqB9ViuHePnuRqfJff2CE4hsF7fvSLkZb6lf9vZaIX2fhtn4+efbaW+TBOLwLrE+V/1nQ6Baz6GMw2tWzXhdu/P71V+HwTWq3vQXyqZ9T10r+0IrId66b/I2fEuLGB2GSGJyxoWcPsv5ru1d71DjNdCC+u1fTOviKunQFu1RQvrkZ79z/AZ8urZP6PfcX6GX8UzILAue5pD5vo/2m9VnYMET4fAemXfy6t71eKbRT3N9wWeAIEFu7s2r77VWCOx0CKwFniSI8bpHprTlcfTILDwO76RWE/yhfEc/vjIIoGFX/K3D7Q7+tMfJIG1xFN8xTv/d3p72+ApPv/n8ZcbWQQW4Jy/278msFzxh79VnT/K7u/P/jUQWOj5s0eCY27/Pbkd/gTWIu79km+s8bPmlXu/gJ/2RxOLwHLEsyYJHuVvDr0TWDA87zHgdLPgh9z623L5sySwlnHtd3xbfZ83rwBJBNbDXJkoRAkgAutFudYgxK9y+M/j7wbWlW2Wx/6OaWAB0l8OLDwO+ftg7jaxCKzH+Nm/GHf/HnGtPxb+fziwHPpNO1TVZV5uh1zj7FfaHw4sPBCJdTd/66MksB7C2S84PJ8/lVh/ObD+1C/62fDhP5arX5l/ObCAl/CXwv9PB9bDftGufr3d0186ynA3fzqw4BiC/n4c/SwJLDwITSxcj8B6AEe/3ICHI7DwqLbODZsl6u/Hzc+SwALgDALr9z3bV9vDBpMYxcK1CCy45NnC3mVOfpYEFgBnEFi/7rovtp/vNtExgzsILADOILCeG80fwEBg/bZnG+p0LBKf7eNzmYufJYEFwBkE1lO3MJ66csCvI7B+mYvNcOBZEFi0YgBnEFjPjCwdo4n6pxFYAJxBYP1uO4b2AfANBNa1fjFy6BECfQQWAGcQWPrNlsxVzTMaWLjOH/iLIbCuxjDUY/H5/2UEFgBnEFi/iR4h8C0E1vXokwAPQmABL+P1W+UE1rN6/b894GoE1g3oEwKPQWABcAaB9aToEQJjBNYt6BM+Ep/+H0ZgPScaWIAFgQXAGQQWAGcQWDf56WEUeoSADYEFvI6X/6YjsAA4g8C6zc/2CV/+exK4DYH1S7h4CPg+AguAMwisG9FiAn4fgQXAGQTW76BBBtwBgQXAGQSWicsJgKdGYP0KeoTAPRBYAJxBYPXQJ/z/9u7sum1siQJoca1OgCkoBb0Q5BCcgjoEdwhyCHYIdghSCHYIVghyCHgfnCcQBDEV7t4fbYkAWWjo8rAwEIApE1hDsEUInRBYQBoC65BtQpgwgTUAW4QMZPZDTWAd0WLBdAksIA2B1b/Zt+kwFIF1D1EEgxJYZGM3Y8EEVu+0YdAVgQWkIbDuonuCIQmsvsk06IzAmhB7k7nP/D8dBdZ95j9CYEIEFpCGwOrZDS2YLUK4QmDdyTbh0OR6yQQWzEUBn54Cq1+2CKFDAuteBXyqwVQIrKnQYMFVAqtX2i/oksC6m1CCoQisibBF2JAVVTSB1SfNF3RKYN1PLMFABNY02NCBBgQWFCrjp6TA6sD924QjDp1kG7QZ32R0R2ABaQgsIA2BNQWjbuck2yakKym3rgUWmaR8k9EdgQWkIbCwTUgaAovRSMox5dy6FlgkCo6cbzK6I7CANAQWY8nT2M1R0mZVYNVJ+kedLX+P4gksRqLB4nYCq5aPdOYp68gWWIxDg9WZklalwILcSsorgXVF1s558op6l01P2nEtsEaWduQwEWVFv8DqSlnj5l7W1qjyfkwKrCtS/mknv9DyqjOFrUqBNa7JRwtMicC6pnGkTOmjbuI5OKVVVaKJD486AmtUiUcOjEBgQWEyf0wKrKtS/nnbLfSEN9VS/hXonMDqzu1v98m9CyecWJxo+dea3Ki7hcCaqZajcqqJlfpN1pOp/q16JbCuu/nNknkkZV72srT9S+XOfoFFArnfZL0o9JNFYDXQ9O1S6BhiBK3HWvLsF1hMX/I3WQ+K/Wz8Z+wFmKFiBxMDKXiE6bCasE3YhUWZu4m7V/IwE1gMpNS9Lp0rOa9sEjKQot9mHSp8PeqwGrnlQ35CI2pCvUn7tTKh/wlGJ7A6NaGwulfrPU69vxgFE1izdld30l3I3PNKGiz2CKxmsr5t7kssfRETI7C61vBNniMBJRbTIrAaahgwk3uH3xmMmqxJWPg7rAmscQzXYOVo5agjrbach9UxY2vLquiAlXhIYM1eNcqY90a7X5frcJxR0D2BNYpBt9O6GauLpHc8y6j79TebHQMCqwBdfbouYkYjf0CL7X/OTTjzc+fm81cTWNyk5n2lr5qq+eSVwBrF0AOojx0Yg3UHsOO0hiLM6COWogmsEYwQH+kSK90CMwiBVYhkAZBscRmKwGKC5BXnCazheTdeYw1xgcBicuQVlwgspkZecZHAGtyI78cUUZBiIRmJwCpKgjBIsIiMR2CVZfJxMPkFZFQCa2gjvyMnHggTXzzGJrCYEHnVlbmuSV9+HthcB1InrJyOzHdF6rBgbuabVwIL5mbGeWWTcGBzHktMwryHmA6LKajm/TYb0MxXpMC61cwHxDis1I7MPvhtEg5q7sOpJaulGwWsRx3WzQoYFTBRAmtIsg7uIrCANATW7ebVJ83r/4aZE1jFG+/AkqzsRknr0VFCernPaoOqYxSdobLWow6rhbKGSD9mf8LQUApbjzoshlfYm4zu6LDa8IZjdFWRTaoOi51xdmZxuxKzKiIEFgeqCJk1dcWGVYRNwpaKHjNtFbkJ07nC16IOi0GU/TajKwKL86oONw6l1X2qsKm+tjCagBwW9mEBeQgsIA2BBaQhsIA0BBaQhsAC0hBYQBoCC0hDYAFpCCwgDYEFpCGwgDQEFpCGwALSEFhAGgILSENgAWkILCANgQWkIbCANAQWkIbAAtIQWEAaAgtIQ2ABaQgsIA2BBaQhsIA0BBaQhsAC0hBYQBoCC0hDYAFpCCwgDYEFpCGwgDQEFpCGwALSEFhAGgILSENgAWkILCANgQWkIbCANAQWkIbAAtIQWEAa/4y9ABPy/vP3++9YPj5+frwwx9v638fl4cNvv98iHh+fPp95Ss20xnO2LZC/eB8Llr942Sqqqqo+nner5OnX2Vm+baa/7j/6+rB93sPL0TPqpjWes22B/MX7WLD8xQsWEQJr5cdh0/TtzCwf21n2A+v54HlPH1XDaYdq5mxbIH/xPhYsf/GSRYTAqqpqr3naOJNYX7YT9wLr+eh5jx/Nph2qmbNtgfzF+1iw/MWLFhECq6qq6tcyjv04mWc3bRdYX06e97nRtEM1c7YtkL94HwuWv3jZIkJgVVVVbfayL5+eNvsOlscfak+74bMNrG2IPT5tJ39rMO1QzZxtC+Qv3seC5S9euIgQWNVug/Clqna7O5/PzxOxF1jrAziPv6qq+rNOvYcG0w7VzNm2QP7ifSxY/uKFiwiBVW2bp/Wn2Mc6sQ5arNWD6y3HTWD9Wf26/HPwvNer0w7VzNm2QP7ifSxY/uKlc+JoRES8r86velrv6ly+rP79uT/P1/eIeD46QWs9x/NqTC3Xux7erk5r/CptC+Qv3seC5S9O6LCq6sdqRex2E6yGyv6Ozj8REcuPdSu2+bRb9+5/NnOtfn28Ou1QzZxtC+Qv3seC5S9euogQWNuDMruzRVet1nJvlqeIiJfqKLCWR/OtG7Cr0w7VzNm2QP7ifSxY/uKls0m4b7e9txoyf39vH/j5FhFPx0eb//49et56d8PblWmNX6VtgfzF+1iw/MURWHX+bn/4LyLi5Xj67+MHHnbPq5vW+FXaFshfvI8Fy18cgVVn+5n29T0ivpx8JXo9hE4e/31lWuNXaVsgf/E+Fix/cQTWnl3P/X444f1r7I7W7DkZQstm0xq/StsC+Yv3sWD5iyOwIrYfZtvA+nu0u+DfiIhvDcbNpcvSXJvWeM62BfIX72PB8hcvj8CK7Yj4vtlL8PVwd8Fqj/sNVyWqa96bN/Y1c7YtkL94HwuWv3hBBFZEPKwSa7VrPeL71/Xj73sPn1zOARicwIqIWJ/i/v1/39//vv377+bh1eGZ1R73h3PPAwblEskREc9fV83U739Pp71/jYiH0z3uwOB0WBFx5hSrncZ73IG+CayIiPh8uItq74KPP98i4vNT3KJu87H5pmXNnG0L5C/ex4LlL14Qm4Qrz7G3Nfjy8D0iVkcPv0dELNe74zcnaP18O9+UrQ/knG3H6qY1nrNtgfzF+1iw/MXLI7DWnh//W599tfz2eZ1P2yHy/Wjm7xHxcuYEmb3TIeqmHaqZs22B/MX7WLD8xRFYW4+v72/vv5cPj7sTrq5tCK4D7f348Ycr0xq/StsC+Yv3sWD5iyOw9jxsd12tBsvVEXLyrdT33eN10xq/StsC+Yv3sWD5ixPhOjtnrMbGc1Ud3HridLUdr8F1N/9xbdqhmjnbFshfvI8Fy1+8dIcrplyvr6+vr6/bSzyu71ryraquBNZ64ubKfx+rX1f3C6ibdqhmzrYF8hfvY8HyFy+d0xpWPn369OnTp+1xwvU+9s8RES+v+9Yfdi+vr68R2/2jm4u/r/9dDbi6aYdq5mxbIH/xPhYsf3FCh1VtLkq7+UxbX+L96cyMR5dIXrdiy9UT/6xf5sfVaYdq5mxbIH/xPhYsf/HSRYTAqrZ3Bl/+qKqq2pxgde7WlUeBtdm9sPxW7e5n+NBg2qGaOdsWyF+8jwXLX7xwESGwqqp6jbXl7la7Z+9SchxYP3ZP3J609a3BtEM1c7YtkL94HwuWv3jhIkJgVdX2zkr7fp2b7ziwzjzxsdG0a+Ufm7zIvIv3sWD5i5ctIgRWVVXVx8npxec/0U4C6+SJyz+Npl0pv5uzbYH8xftYsPzFyxYRAquqqtMhcqEDPwms4yc+7jdmddNqy+/P2bZA/uJ9LFj+4kWLCIG18rF/xavH1wtznQZWVX3Z+1bql6Oz++qmNZ6zbYH8xftYsPzFCxYRAmvjz8vqY+3h+cYjyB8v6/NnXk4b97ppjedsWyB/8T4WLH/xckUsIjZfBSDi/b3tCXpvj5cv/1E3rfGcbQvkL97HguUvXqSFwAKyWPhqDpCHwALSEFhAGgILSENgAWkILCANgQWkIbCANAQWkIbAAtIQWEAaAgtIQ2ABaQgsIA2BBaQhsIA0BBaQhsACAAAAAAAAAAAAAAAAAAAmYRFRjb0MAA0sXK0ByENgAWkILCANgQWkIbCANAQWkIbAAtIQWEAaAgtIQ2ABaQgsIA2BBaQhsIA0BBaQhsAC0hBYQBoCC0hDYAFpCCwgDYEFpCGwgDQEFpCGwALSEFhAGgILSENgAWkILCANgQWkIbCANAQWkIbAAtIQWEAa/4y9AMC0LCIiotr8UKM6nP/qz/Wv04QOCziveY4MRmABaQgs4ILptVgCC7ikq8S6ujesKYEF9KyzvHKUEDhnfYyvcdbsHxM8fbzdc0/psIDLJrYbS2ABaQgsoMa0WiyBBdSpSazudqY3JbCAtgZPLEcJgVp1RwrvTaxbNzh1WEC9Ce3GElhAGgILSENgAWkILCANRwmBK+qvPnrp+4NV7THE/Wf5LiHQpYmcPiqwgH70kGQCC2jg9harj85LYAFNTOL0UYEF3Gm4vViOEgIX7UdRzXcKF5v2a3e8r1mINT8+uKLDApqZwEahwALudtJP9bSVKLCAhsY/GUtgAU013ii86cT4GwgsoAOLi790yVFC4IxVI7Q4+bmb1z18Nd8lBIa1OPvjsTuPNAosoBND7HcXWMBg7j2VS2AB3bjeYt196qnAAjrS/0aho4TAGadH7qrDSS1Ue/+99VuEKzos4DaXU6b3FktgAWkILOBG4122QWABtxotsQQWkIajhMAZ7e4b2Oz1dr8vauY4R4cFpCGwgP51tNdLYAG962ovvcAC0hBYQN86Ow3CUULginvz5txVRquDKU3psIA0BBbQrw7PixdYQEvDf0NHYAFtNUqsLmNNYAF96rQNc5QQOOP0joSnydPoen2LuufeevVRHRaQhsAC0hBYQBoCC0hDYAFpOEoInHHpmN3eEb0bbupVf2XR5mc+6LCANAQW0Er/N6Y/JbCANsbIK4EF5CGwgBZGabBiMeZtp4HpaXKvwNvj6vwr3XZfwoUOCxhCNx2ZwALSEFjArdq0S520WAILSENgATdq1yx10WL5LiFwxv61QPcfifbJszh9ZfclBGZLYAE3GeeU0RWBBaQhsIBbjNlgCSzgFqPmlaOEwGX7R/SaRNXpscVTp3ck3H9uPR0WkIbAAtIQWEAaAgtIQ2ABaThKCJxx2+kLmyN8uyOANc8/uamh+xICU3XHqVwCC7jXmRaprmtqn1gCC+hDL3e3EVjAnW7OptYtlsAC7jPgnQIdJQQu2mVRs6aoyXcJIyIW1X7KNb/6qA4LuO7aWQodvl4dgQVcNe5FZXYEFjCCdhEosIBr+miwWr2mwAKumMoGoaOEQIcuXU308ry7+ZvQYQH1ptNgCSyg3oTySmABeQgsoM6UGiyBBdSZVF45Sgh04dL3Aav6zNu7+qjvEgL36aLB6vBqDgILuKj3DcIbCwgsoGfdXS5ZYAF962yjUGABY7qpxXKUEDjjyr0Ft/OcO8a3OPm5qnmphe8SAneb1ilYESGwgAs6zauO9mIJLGAA3SSWwALOuXp++jClDgks4Eat8qqTk7EWg94FEZi8sfa1X0+ihQ4LyENgAWkILCANgQWkIbCANHyXEDgw5fMGdFhAGgILSENgAWkILCANgQWkIbCANAQWkIbAAtIQWEAaAgtIQ2ABaQgsIA2BBaQhsIA0BBaQhsAC0hBYQBoCC0hDYAFpCCwgDYEFpCGwgDQEFpCGwALSEFhAGgILSENgAWkILCANgQWkIbCANAQWkIbAAtIQWAAAAMX6Pw4OzyU6FDkcAAAAAElFTkSuQmCC\",\n \"label_epl2_url\": null,\n \"label_file_type\": null,\n \"updated_at\": \"2025-06-16T17:45:37Z\",\n \"id\": \"pl_40234f8c82284c89b68ddb4661ca345d\",\n \"label_zpl_url\": null,\n \"label_date\": \"2025-06-16T17:45:37Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2025-06-16T17:45:36Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2025-06-16T17:45:36Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_95ead285a19c41c78096ce53f9a65ea9\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"6.07000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"created_at\": \"2025-06-16T17:45:36Z\",\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2025-06-16T17:45:36+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2025-06-16T17:45:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_b5c8d3b64ad911f0aec9ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100208303109991634\",\n \"tax_identifiers\": null,\n \"mode\": \"test\",\n \"reference\": null,\n \"luma_info\": {\n \"matching_rule_idx\": 0.0,\n \"ruleset_description\": \"Buy the cheapest rate that satisfies all of the following:\\nRule 0\\n \\nOtherwise buy the cheapest rate\",\n \"ai_results\": [\n {\n \"meets_ruleset_requirements\": true,\n \"carrier\": \"USPS\",\n \"rate_id\": \"rate_4f2d82d062404510a5014ecda00128df\",\n \"predicted_deliver_by_date\": \"2025-06-19\",\n \"service\": \"Priority\",\n \"rate_usd\": \"7.42\",\n \"predicted_deliver_days\": 3.0\n },\n {\n \"meets_ruleset_requirements\": true,\n \"carrier\": \"USPS\",\n \"rate_id\": \"rate_03a8866aefc94098b0749f91671f981e\",\n \"predicted_deliver_by_date\": \"2025-06-19\",\n \"service\": \"GroundAdvantage\",\n \"rate_usd\": \"6.07\",\n \"predicted_deliver_days\": 3.0\n },\n {\n \"meets_ruleset_requirements\": true,\n \"carrier\": \"USPS\",\n \"rate_id\": \"rate_b51c7bddfdd4464288c2e85fc5263f5a\",\n \"predicted_deliver_by_date\": \"2025-06-17\",\n \"service\": \"Express\",\n \"rate_usd\": \"34.15\",\n \"predicted_deliver_days\": 1.0\n }\n ]\n },\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.57\",\n \"created_at\": \"2025-06-16T17:45:37Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a4398d9b962c434496bfdba2a0d7ca6a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.85\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2025-06-16T17:45:37Z\",\n \"rate\": \"6.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_18f9606c7e274ddda005a2c6aba6fdfa\",\n \"object\": \"Rate\"\n },\n \"updated_at\": \"2025-06-16T17:45:37Z\",\n \"messages\": [],\n \"id\": \"shp_a4398d9b962c434496bfdba2a0d7ca6a\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2025-06-16T17:45:36+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2025-06-16T17:45:36+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_b5cb171d4ad911f0aeceac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"forms\": [],\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "72561" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "afd263ff68505840e2baa9c1006f9f1d" + ], + "x-proxied": [ + "intlb4nuq ec99f2d065", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.833157" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202506161725-4166f0359d-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/luma" + }, + "duration": 947 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/create_empty_objects.json b/src/test/cassettes/shipment/create_empty_objects.json new file mode 100644 index 000000000..01fd62017 --- /dev/null +++ b/src/test/cassettes/shipment/create_empty_objects.json @@ -0,0 +1,97 @@ +[ + { + "recordedAt": 1723823928, + "request": { + "body": "{\n \"shipment\": {\n \"customs_info\": {\n \"customs_items\": []\n },\n \"reference\": \"\",\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:47Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:48Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6c40f1745be811efa5903cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_c9fd5ab7f567435d81544cec1da24b6b\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6c40f1745be811efa5903cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:58:47Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:58:47Z\",\n \"customs_certify\": false,\n \"eel_pfc\": null,\n \"customs_signer\": null,\n \"id\": \"cstinfo_70b9c334156446edaa3e3915cd1b464d\",\n \"contents_explanation\": null,\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:47Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:47Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_3f967a3628a3490daeef1e7f9cee0ce4\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6c3e0dff5be811efba16ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:48Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c9fd5ab7f567435d81544cec1da24b6b\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:48Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d82c5d3c8485490cbd8ad4e0ab55c253\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:48Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c9fd5ab7f567435d81544cec1da24b6b\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:48Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_506522a9f12c4cf89261b2405b05e241\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:48Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c9fd5ab7f567435d81544cec1da24b6b\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:48Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8cd1bebb0e674ac2bb15d49a801c93c0\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:47+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:47+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6c3e0dff5be811efba16ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5832" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf7737e786c50600360c8f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.702912" + ], + "location": [ + "/api/v2/shipments/shp_c9fd5ab7f567435d81544cec1da24b6b" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 913 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/create_tax_identifiers.json b/src/test/cassettes/shipment/create_tax_identifiers.json new file mode 100644 index 000000000..6df9f6bdc --- /dev/null +++ b/src/test/cassettes/shipment/create_tax_identifiers.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823960, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"tax_identifiers\": [\n {\n \"issuing_country\": \"GB\",\n \"tax_id_type\": \"IOSS\",\n \"entity\": \"SENDER\",\n \"tax_id\": \"12345\"\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:19Z\",\n \"tax_identifiers\": [\n {\n \"issuing_country\": \"GB\",\n \"tax_id_type\": \"IOSS\",\n \"entity\": \"SENDER\",\n \"tax_id\": \"HIDDEN\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:19+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7f20fec65be811efae563cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_2f2a5fa00fef46fc8af72f1e7459e6d9\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:19+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7f20fec65be811efae563cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:19Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:19Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_f625052ff56642de8d160445820ca40f\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:19+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7f1e60ff5be811efbf8bac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_2f2a5fa00fef46fc8af72f1e7459e6d9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f73b11d674c6444bb168bfa72c098d3a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_2f2a5fa00fef46fc8af72f1e7459e6d9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2e90ceac4d9f4a2e9ed7fa973894c005\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_2f2a5fa00fef46fc8af72f1e7459e6d9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0750ab5bbd7f47f9a965cbec4c24a288\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:19+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7f1e60ff5be811efbf8bac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5538" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf7757e786c8e200362b7b" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.770196" + ], + "location": [ + "/api/v2/shipments/shp_2f2a5fa00fef46fc8af72f1e7459e6d9" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 983 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/create_with_ids.json b/src/test/cassettes/shipment/create_with_ids.json new file mode 100644 index 000000000..29b0e9bf0 --- /dev/null +++ b/src/test/cassettes/shipment/create_with_ids.json @@ -0,0 +1,376 @@ +[ + { + "recordedAt": 1723823950, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:10+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:10+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_798f5fa15be811efbc4cac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "461" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf774ee786c5a700362301" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.034627" + ], + "location": [ + "/api/v2/addresses/adr_798f5fa15be811efbc4cac1f6bc53342" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 248 + }, + { + "recordedAt": 1723823950, + "request": { + "body": "{\n \"address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "response": { + "body": "{\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:10+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:10+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_79ca970d5be811ef80d4ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "459" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf774ee786c5a90036236d" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.035994" + ], + "location": [ + "/api/v2/addresses/adr_79ca970d5be811ef80d4ac1f6bc539ae" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/addresses" + }, + "duration": 248 + }, + { + "recordedAt": 1723823950, + "request": { + "body": "{\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/parcels" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:10Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:10Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_07defb8fc3764c5180a234b55ac16519\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "229" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf774ee786c5ab003623d8" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.032076" + ], + "location": [ + "/api/v2/parcels/prcl_07defb8fc3764c5180a234b55ac16519" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/parcels" + }, + "duration": 241 + }, + { + "recordedAt": 1723823952, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"id\": \"prcl_07defb8fc3764c5180a234b55ac16519\"\n },\n \"to_address\": {\n \"id\": \"adr_79ca970d5be811ef80d4ac1f6bc539ae\"\n },\n \"from_address\": {\n \"id\": \"adr_798f5fa15be811efbc4cac1f6bc53342\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:11Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:12Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:10+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:10+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_798f5fa15be811efbc4cac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_6f8b6a9cf8774f5083e0b167cf42c680\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:10+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:10+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_798f5fa15be811efbc4cac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:10Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:10Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_07defb8fc3764c5180a234b55ac16519\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:10+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:10+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_79ca970d5be811ef80d4ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:12Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_6f8b6a9cf8774f5083e0b167cf42c680\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:12Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d0ad02fc510e4a178516a192844a28d4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:12Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_6f8b6a9cf8774f5083e0b167cf42c680\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:12Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_402ddd6106c34830be00c38369e0fd93\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:12Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_6f8b6a9cf8774f5083e0b167cf42c680\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:12Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3a683bd020ad4304b73e4c7d2a40180a\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:10+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:10+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_79ca970d5be811ef80d4ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5436" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf774fe786c5c40036243f" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.951816" + ], + "location": [ + "/api/v2/shipments/shp_6f8b6a9cf8774f5083e0b167cf42c680" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1162 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/generate_form_with.json b/src/test/cassettes/shipment/generate_form_with.json new file mode 100644 index 000000000..a15631f47 --- /dev/null +++ b/src/test/cassettes/shipment/generate_form_with.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1723823926, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_030b1b61d7e141cfb08324374e6f3636\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"tracking_code\": \"9400100105807076063072\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzFhNDU3Mzg3NjFkZTQ3NzRhZWZhNjBjMDVlY2U1MGI5\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"signed_by\": null,\n \"id\": \"trk_1a45738761de4774aefa60c05ece50b9\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6ae2d32f5be811efb4f8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6ae2d32f5be811efb4f8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8ed0c6e5cc4b14c9aa3947af893080c7b.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"id\": \"pl_53b177cdbe5642dbaf14f7160093aace\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:46Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_a111c1d2487b436883419352ed3fda54\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_6ae041595be811efb601ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_70f14f2a74c4482a8500e6aa9e637366\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_abcc372cd93d43a49349583604d6573f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_030b1b61d7e141cfb08324374e6f3636\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_6ae041595be811efb601ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063072\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf7735e786c50200360a38" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.968397" + ], + "location": [ + "/api/v2/shipments/shp_59adc36e44d54e6c81876fc9d58af473" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1193 + }, + { + "recordedAt": 1723823927, + "request": { + "body": "{\n \"form\": {\n \"type\": \"return_packing_slip\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_59adc36e44d54e6c81876fc9d58af473/forms" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_030b1b61d7e141cfb08324374e6f3636\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"tracking_code\": \"9400100105807076063072\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzFhNDU3Mzg3NjFkZTQ3NzRhZWZhNjBjMDVlY2U1MGI5\",\n \"est_delivery_date\": \"2024-08-16T15:58:46Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"signed_by\": null,\n \"id\": \"trk_1a45738761de4774aefa60c05ece50b9\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6ae2d32f5be811efb4f8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6ae2d32f5be811efb4f8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8ed0c6e5cc4b14c9aa3947af893080c7b.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"id\": \"pl_53b177cdbe5642dbaf14f7160093aace\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:46Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_a111c1d2487b436883419352ed3fda54\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_6ae041595be811efb601ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_70f14f2a74c4482a8500e6aa9e637366\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_abcc372cd93d43a49349583604d6573f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_030b1b61d7e141cfb08324374e6f3636\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_6ae041595be811efb601ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063072\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [\n {\n \"mode\": \"test\",\n \"submitted_electronically\": null,\n \"updated_at\": \"2024-08-16T15:58:47Z\",\n \"form_url\": \"https://easypost-files.s3-us-west-2.amazonaws.com/files/form/20240816/6408d49f334e43e3b356e0550374bc4a.pdf\",\n \"created_at\": \"2024-08-16T15:58:47Z\",\n \"id\": \"form_31463e4d95294c0fb413fe6fbb5ade9c\",\n \"form_type\": \"return_packing_slip\",\n \"object\": \"Form\"\n }\n ],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "8013" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7736e786c50400360b9a" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.606702" + ], + "location": [ + "/api/v2/shipments/shp_59adc36e44d54e6c81876fc9d58af473/forms/return_packing_slip" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_59adc36e44d54e6c81876fc9d58af473/forms" + }, + "duration": 814 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/generate_form_with_option.json b/src/test/cassettes/shipment/generate_form_with_option.json new file mode 100644 index 000000000..c8bc5f768 --- /dev/null +++ b/src/test/cassettes/shipment/generate_form_with_option.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1723823966, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:26Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2dfeb5fc585b457695877fd497bcd6b4\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:59:26Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"tracking_code\": \"9400100105807076063287\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzRjMDc0MjhjYWE2MzQ4OTU5ODRmZWYwNGUzOTRlNTg0\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"signed_by\": null,\n \"id\": \"trk_4c07428caa634895984fef04e394e584\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_82b9789f5be811ef8428ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_82b9789f5be811ef8428ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:26Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e83400537bf15d44279fd7ef1af6a44b8a.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"id\": \"pl_46430efed0d545d9a7f557da2387fbba\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:26Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_4f0b9056dcea44f186156082701966ae\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_82b65b7b5be811ef8094ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2dfeb5fc585b457695877fd497bcd6b4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_50969c8b169749d9b56ca0ca2da117df\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f37aff5459bd4f0a95b891d42846ccb4\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_82b65b7b5be811ef8094ac1f6bc539aa\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063287\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf775de786c9010036303a" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "1.020698" + ], + "location": [ + "/api/v2/shipments/shp_cbf7a2104f9e4746a67c6ffbe6532cac" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1232 + }, + { + "recordedAt": 1723823967, + "request": { + "body": "{\n \"form\": {\n \"line_items\": [\n {\n \"product\": {\n \"title\": \"Square Reader\",\n \"barcode\": \"855658003251\"\n },\n \"units\": 8.0\n }\n ],\n \"type\": \"return_packing_slip\",\n \"barcode\": \"RMA12345678900\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_cbf7a2104f9e4746a67c6ffbe6532cac/forms" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:26Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2dfeb5fc585b457695877fd497bcd6b4\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:59:26Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:59:26Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:36:26Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"tracking_code\": \"9400100105807076063287\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzRjMDc0MjhjYWE2MzQ4OTU5ODRmZWYwNGUzOTRlNTg0\",\n \"est_delivery_date\": \"2024-08-16T15:59:26Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"signed_by\": null,\n \"id\": \"trk_4c07428caa634895984fef04e394e584\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_82b9789f5be811ef8428ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_82b9789f5be811ef8428ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:26Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e83400537bf15d44279fd7ef1af6a44b8a.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"id\": \"pl_46430efed0d545d9a7f557da2387fbba\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:26Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_4f0b9056dcea44f186156082701966ae\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_82b65b7b5be811ef8094ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2dfeb5fc585b457695877fd497bcd6b4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_50969c8b169749d9b56ca0ca2da117df\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f37aff5459bd4f0a95b891d42846ccb4\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_82b65b7b5be811ef8094ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063287\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [\n {\n \"mode\": \"test\",\n \"submitted_electronically\": null,\n \"updated_at\": \"2024-08-16T15:59:27Z\",\n \"form_url\": \"https://easypost-files.s3-us-west-2.amazonaws.com/files/form/20240816/9f8f75c5ae2f44db818fcf3428ff20ea.pdf\",\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"id\": \"form_121b7225729e4db1af3b540dd2312f15\",\n \"form_type\": \"return_packing_slip\",\n \"object\": \"Form\"\n }\n ],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "8013" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf775ee786c9030036315f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.623393" + ], + "location": [ + "/api/v2/shipments/shp_cbf7a2104f9e4746a67c6ffbe6532cac/forms/return_packing_slip" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_cbf7a2104f9e4746a67c6ffbe6532cac/forms" + }, + "duration": 843 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/get_lowest_smartrate.json b/src/test/cassettes/shipment/get_lowest_smartrate.json new file mode 100644 index 000000000..34ccac055 --- /dev/null +++ b/src/test/cassettes/shipment/get_lowest_smartrate.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1723823943, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:02+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:02+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7539f7695be811efa8df3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:02+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:02+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7539f7695be811efa8df3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_3103705e29054470b5ef1729f4c32d2f\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:02+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:02+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_753720975be811efb8c7ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:03Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6b6d838a9efb46b0afc87b8d68a7354d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:03Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4678fe663ad84319bf2a048915c9d5b3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:03Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_023b19689d764f9bbda63f754163c3c9\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:02+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:02+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_753720975be811efb8c7ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5340" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7746e786c56900361a2f" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.771110" + ], + "location": [ + "/api/v2/shipments/shp_a47bae8202544e7fb36712593a235fca" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 972 + }, + { + "recordedAt": 1723823943, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_a47bae8202544e7fb36712593a235fca/smartrate" + }, + "response": { + "body": "{\n \"result\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 33.1,\n \"created_at\": \"2024-08-16T15:59:03Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 37.9,\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"rate\": 33.1,\n \"time_in_transit\": {\n \"percentile_90\": 3.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 4.0,\n \"percentile_99\": 7.0\n },\n \"service\": \"Express\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6b6d838a9efb46b0afc87b8d68a7354d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 8.25,\n \"created_at\": \"2024-08-16T15:59:03Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 9.8,\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"rate\": 6.9,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"Priority\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4678fe663ad84319bf2a048915c9d5b3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 6.4,\n \"created_at\": \"2024-08-16T15:59:03Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_a47bae8202544e7fb36712593a235fca\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 8.45,\n \"updated_at\": \"2024-08-16T15:59:03Z\",\n \"rate\": 5.93,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 2.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"GroundAdvantage\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_023b19689d764f9bbda63f754163c3c9\",\n \"object\": \"Rate\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1965" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf7747e786c58100361b10" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.107607" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_a47bae8202544e7fb36712593a235fca/smartrate" + }, + "duration": 306 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/get_next_page.json b/src/test/cassettes/shipment/get_next_page.json new file mode 100644 index 000000000..546d83711 --- /dev/null +++ b/src/test/cassettes/shipment/get_next_page.json @@ -0,0 +1,174 @@ +[ + { + "recordedAt": 1723823931, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"has_more\": true,\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_030b1b61d7e141cfb08324374e6f3636\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:46Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"tracking_code\": \"9400100105807076063072\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzFhNDU3Mzg3NjFkZTQ3NzRhZWZhNjBjMDVlY2U1MGI5\",\n \"est_delivery_date\": \"2024-08-16T15:58:46Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"signed_by\": null,\n \"id\": \"trk_1a45738761de4774aefa60c05ece50b9\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6ae2d32f5be811efb4f8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6ae2d32f5be811efb4f8ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:46Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8ed0c6e5cc4b14c9aa3947af893080c7b.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:46Z\",\n \"id\": \"pl_53b177cdbe5642dbaf14f7160093aace\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:46Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_a111c1d2487b436883419352ed3fda54\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_6ae041595be811efb601ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_70f14f2a74c4482a8500e6aa9e637366\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_abcc372cd93d43a49349583604d6573f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_59adc36e44d54e6c81876fc9d58af473\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_030b1b61d7e141cfb08324374e6f3636\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:58:45+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:58:45+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_6ae041595be811efb601ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063072\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [\n {\n \"mode\": \"test\",\n \"submitted_electronically\": null,\n \"updated_at\": \"2024-08-16T15:58:47Z\",\n \"form_url\": \"https://easypost-files.s3-us-west-2.amazonaws.com/files/form/20240816/6408d49f334e43e3b356e0550374bc4a.pdf\",\n \"created_at\": \"2024-08-16T15:58:47Z\",\n \"id\": \"form_31463e4d95294c0fb413fe6fbb5ade9c\",\n \"form_type\": \"return_packing_slip\",\n \"object\": \"Form\"\n }\n ],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"249.99\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"1.24995\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:44Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:44Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3ba4fdeceae445a0a276d2825b8b97c4\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:45Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:45Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:45Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"tracking_code\": \"9400100105807076063058\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzJkMmVjZTFmY2MzMjQwZmQ5N2Y3ZmJhYjU1NTk1NjYz\",\n \"est_delivery_date\": \"2024-08-16T15:58:45Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:45Z\",\n \"signed_by\": null,\n \"id\": \"trk_2d2ece1fcc3240fd97f7fbab55595663\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_69930adf5be811efb902ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:43+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_69930adf5be811efb902ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:44Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8cf18db3e20874e55bf9a20f97aee8dfb.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:44Z\",\n \"id\": \"pl_dffd36f121724d69a36603eafa30b950\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:44Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_ee8d4039129f4a15bdf53915f34a6b19\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_698f52d85be811efb8fdac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3ba4fdeceae445a0a276d2825b8b97c4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_16cdbe21590a433e8caa76725f192345\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:43Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_84ff320daac94718b511207c1538cdf0\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:43Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a4ca58d3d8704bbc81088e47f7ca9a9d\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:43+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:44+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_698f52d85be811efb8fdac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063058\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"6.33000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_119edccd62c24583b6e7f59ced7b5d49\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:42Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:42Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"tracking_code\": \"9434600105807076063043\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzUwOTc3YWQ1NTc2ZTQ0ZTg5OGJiMzJlODBhZTk5ZmIx\",\n \"est_delivery_date\": \"2024-08-16T15:58:42Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"signed_by\": null,\n \"id\": \"trk_50977ad5576e44e898bb32e80ae99fb1\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e807e421f9466e4883a480b82b1e71f19e.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"id\": \"pl_a8680e95f49c4f15bc068bdcd9e620f3\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:42Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_0a6f94b2055f4d7888ee1294c5b4fece\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_b1784194fdd8469fade7b00b5f5e9a7e\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_119edccd62c24583b6e7f59ced7b5d49\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_d3372f9181154b6cb7bb5341ac6f1890\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fe13d12f237c4ece984468ced5737017\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9434600105807076063043\",\n \"messages\": [],\n \"order_id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.07000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:41Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:41Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:41Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7e2d2ac36db42ffbbc0aebb8a1e0128\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:42Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:42Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:42Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"tracking_code\": \"9400100105807076063027\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2FmMmE3NjU2YjY2NTRjYWFhMTU2N2E0NjNhMzQ3ZmI1\",\n \"est_delivery_date\": \"2024-08-16T15:58:42Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:42Z\",\n \"signed_by\": null,\n \"id\": \"trk_af2a7656b6654caaa1567a463a347fb5\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:39+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_677a32925be811efb48eac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:41Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8bf48473c72b74f8682106707cb6abc70.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:41Z\",\n \"id\": \"pl_111ca27882714b1fb6e539f4d0e22da1\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:41Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:39Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:39Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_d081bb2780ec4e08bb5bb8f17e58a7c5\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_38ac5fb715e14cabb3029bde5b09d9f5\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_4be8395f399b4279b64677dd495f9519\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:40Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f55e6727e2a945d8941a89ccfa9f5176\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:40Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d7e2d2ac36db42ffbbc0aebb8a1e0128\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:39+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:42+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6778a38a5be811efb83aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063027\",\n \"messages\": [],\n \"order_id\": \"order_64ba299ed95a46a4a3a341cb78e5fdf7\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"6.33000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:30Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec4cc7aee65e451c841afb8bf730a913\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:31Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"tracking_code\": \"9434600105807076063005\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2Q3ZTNlNjNhYjUwNzRjYmY5NTUxODI2OGExNmNlZjU1\",\n \"est_delivery_date\": \"2024-08-16T15:58:31Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:31Z\",\n \"signed_by\": null,\n \"id\": \"trk_d7e3e63ab5074cbf95518268a16cef55\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:30Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8240f500213e54273b72a7aedaa0c0fcc.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:30Z\",\n \"id\": \"pl_c2de163b7f2a4c848f788b3f7ff881a0\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:30Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:27Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"weight\": 17.5,\n \"id\": \"prcl_b7ce992c1a6146af9aa35ef207154021\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"7.75\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"10.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"6.33\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec4cc7aee65e451c841afb8bf730a913\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"37.20\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"42.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"37.20\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_56c7ac22afd448ee8182c2bc6697d74a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.97\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b79ed690e1284bfabfbe00ae6d608a6e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.50\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"7.58\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_142c56933c0048cea318dcb67ba08ec2\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9434600105807076063005\",\n \"messages\": [],\n \"order_id\": \"order_e4f72f9fe91a4373b85ee59ebc901c86\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "39973" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf773be786c52400360f8f" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.628856" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 836 + }, + { + "recordedAt": 1723823933, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%73%68%70%5F%62%37%39%65%64%36%39%30%65%31%32%38%34%62%66%61%62%66%62%65%30%30%61%65%36%64%36%30%38%61%36%65" + }, + "response": { + "body": "{\n \"has_more\": true,\n \"shipments\": [\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.07000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:29Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:29Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:29Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_35ad1f2c242b4dd48535ea3d9d187980\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:31Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"tracking_code\": \"9400100105807076062990\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2VjMTZjZGFiNjY3ZjRkMTViNWM5YjNiMjVmOWNlYjMw\",\n \"est_delivery_date\": \"2024-08-16T15:58:31Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:31Z\",\n \"signed_by\": null,\n \"id\": \"trk_ec16cdab667f4d15b5c9b3b25f9ceb30\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6053a6475be811efb143ac1f6bc539aa\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:29Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e86c978345cd4f48dc810c16053dcb3646.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:29Z\",\n \"id\": \"pl_0b1e99ab251a4803be6acd77ee9457b2\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:29Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:27Z\",\n \"predefined_package\": null,\n \"length\": null,\n \"width\": null,\n \"created_at\": \"2024-08-16T15:58:27Z\",\n \"weight\": 10.2,\n \"id\": \"prcl_a7382a7799af4894bcf12b345fd26cb8\",\n \"object\": \"Parcel\",\n \"height\": null\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_8d70c771dffe437da59d254a905db12c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.07\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.70\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"5.07\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_35ad1f2c242b4dd48535ea3d9d187980\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:28Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4eed7a3b2dda4082b533932e10b67860\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:28Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_18f88c8de8f04e299efe6e193ffc647b\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:27+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:30+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_6051d02a5be811efb141ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062990\",\n \"messages\": [],\n \"order_id\": \"order_e4f72f9fe91a4373b85ee59ebc901c86\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"100.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:16Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:18Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:18Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:18Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fd24e3261ce744278f2ed3c7c8dcaf67\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:19Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"tracking_code\": \"9400100105807076062921\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzIzODcyZWMyYWNhYTRjMzk5OGMxMjk2OTJhMzZhMWY1\",\n \"est_delivery_date\": \"2024-08-16T15:58:19Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:19Z\",\n \"signed_by\": null,\n \"id\": \"trk_23872ec2acaa4c3998c129692a36a1f5\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_59cd49c35be811ef9be93cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:16+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:16+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_59cd49c35be811ef9be93cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:58:16Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:58:16Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:16Z\",\n \"currency\": null,\n \"id\": \"cstitem_336c5d5edc174b6689a59d03ec675c27\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:58:16Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_784643c82f9d4d32bb4bb5c26eff9891\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:18Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e80a9db992a2964b8191f41676ecdd84a4.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:18Z\",\n \"id\": \"pl_8488eb6770d74aed950e5d8a866d91ae\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:18Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:16Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:16Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_fff2452a5e1e4fa1a06e7c7eba1da93d\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:16+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:18+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_59ca397c5be811efb07fac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:17Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:17Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e450974e8330445980763f8550980068\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:17Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:17Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_466796cb688146cc9257ed2764d46e6b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:17Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:17Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fd24e3261ce744278f2ed3c7c8dcaf67\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:16+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:18+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_59ca397c5be811efb07fac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062921\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"100.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:13Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:15Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:14Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:14Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6ab1c9a644434a60965f202b0bd0c015\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:15Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:15Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:15Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"tracking_code\": \"9400100105807076062891\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2RlMGRiOWNjNzk4OTQ5NTY4MTBmOGNhMWMwZjA0Y2M1\",\n \"est_delivery_date\": \"2024-08-16T15:58:15Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:15Z\",\n \"signed_by\": null,\n \"id\": \"trk_de0db9cc79894956810f8ca1c0f04cc5\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:13+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:13+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_57b215cc5be811efaed1ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:13+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:13+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_57b215cc5be811efaed1ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:58:13Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:58:13Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:13Z\",\n \"currency\": null,\n \"id\": \"cstitem_636ad30e4cf544dda272979e7f91eeb3\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:58:13Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_16d06543b82042f5bd35be276196fdf3\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:14Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e839d686d1009e4bc9974b735dd4969268.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:15Z\",\n \"id\": \"pl_a576d9ef88814863954eb80d44fcdd21\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:14Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:13Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:13Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_93f8cc781a9c40d5bff4fd2110e8a655\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:13+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:14+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_57ada9625be811efaa4fac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:13Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:13Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7e32455f0bb84bb9931acdda29a8f6a0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:13Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:13Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_cbf4db8ababe4b2aa4db29ebedae0dda\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:14Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:14Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6ab1c9a644434a60965f202b0bd0c015\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:13+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:14+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_57ada9625be811efaa4fac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062891\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"100.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:09Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:11Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:11Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:11Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e7c5c42dc7df4c809d21bcc0803d009f\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:11Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:11Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:11Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"tracking_code\": \"9400100105807076062877\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2IxMjQwNWY5YTI1OTQ1YjhhYmJhMGY4MjY2NzlmZDU0\",\n \"est_delivery_date\": \"2024-08-16T15:58:11Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:11Z\",\n \"signed_by\": null,\n \"id\": \"trk_b12405f9a25945b8abba0f826679fd54\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:09+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:09+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_556441dc5be811ef98f73cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:09+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:09+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_556441dc5be811ef98f73cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:58:09Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:58:09Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:09Z\",\n \"currency\": null,\n \"id\": \"cstitem_d5a2b35028304acd86920b91741a118f\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:58:09Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_caf290593d384b9781ea2fa53a749be1\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:58:11Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8b5bd40b77aaa480080aa2dafe01f37c2.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:58:11Z\",\n \"id\": \"pl_46cd6d9f6bf146e4876b3761e1fbc357\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:58:11Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:09Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:09Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_bcf062fe38294b62a42b8ba8f5b1df03\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:09+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:10+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_5561a0585be811efadbdac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:10Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:10Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7a3d6a60c9ab4e0c9513ff3287898869\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:10Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:10Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_129584660d90495ba5fcb9af18dd1c1f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:10Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:10Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e7c5c42dc7df4c809d21bcc0803d009f\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277-2506\",\n \"country\": \"US\",\n \"city\": \"REDONDO BEACH\",\n \"created_at\": \"2024-08-16T15:58:09+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 33.8436,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -118.39177\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": false,\n \"updated_at\": \"2024-08-16T15:58:10+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"ELIZABETH SWAN\",\n \"company\": null,\n \"street1\": \"179 N HARBOR DR\",\n \"id\": \"adr_5561a0585be811efadbdac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062877\",\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:57:55Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_03f256d69a44470d8e39bb47baf93af1\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:54Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:57:54Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:34:54Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"tracking_code\": \"9400100105807076062822\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzBhZGEwYzY0YTU0NDQzYTFiMjQxMTM2MTQ2MGU2ZjBh\",\n \"est_delivery_date\": \"2024-08-16T15:57:54Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"signed_by\": null,\n \"id\": \"trk_0ada0c64a54443a1b2411361460e6f0a\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_4bcd16f15be811ef93b63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_4bcd16f15be811ef93b63cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e88dbc7a3cf93842f9920c71b9c3d71409.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"id\": \"pl_637972bd21af452fa61c22c68aa23fae\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:57:53Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_1553867a55f84a3bae09ab7a95a2ed22\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": \"submitted\",\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_4bc9c2125be811efa8b1ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d61fb30bd1c74c19bbe5190441a9b677\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_68a60f118ce6487c948c09a8ed8736b3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:57:53Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:57:53Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_03f256d69a44470d8e39bb47baf93af1\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:57:53+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:57:53+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_4bc9c2125be811efa8b1ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076062822\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "44293" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf773ce786c52500361070" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.739625" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%73%68%70%5F%62%37%39%65%64%36%39%30%65%31%32%38%34%62%66%61%62%66%62%65%30%30%61%65%36%64%36%30%38%61%36%65" + }, + "duration": 947 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/get_next_page_parameter_hand_off.json b/src/test/cassettes/shipment/get_next_page_parameter_hand_off.json new file mode 100644 index 000000000..40be5ff34 --- /dev/null +++ b/src/test/cassettes/shipment/get_next_page_parameter_hand_off.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823970, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments?%70%75%72%63%68%61%73%65%64\u003d%66%61%6C%73%65\u0026%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%69%6E%63%6C%75%64%65%5F%63%68%69%6C%64%72%65%6E\u003d%74%72%75%65" + }, + "response": { + "body": "{\n \"has_more\": true,\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:28Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_842132085be811ef804aac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_842132085be811ef804aac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:27Z\",\n \"currency\": null,\n \"id\": \"cstitem_19dfcaf9a31147b193f4e655af5c6330\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:59:27Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_cccd3624b091446382e8347d4068fb69\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:27Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_a8e68738eb0d4200bb159fbc00d9a38d\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_841e561c5be811ef84b5ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:29Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:29Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2d18e0151d8a43ce8a07a11614689fd4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:29Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:29Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3b475d28703940f6a8e0153d26265c32\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:29Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:29Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2e6e89533af440acb464a5d2bcfb628a\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_841e561c5be811ef84b5ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:26Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2dfeb5fc585b457695877fd497bcd6b4\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:59:26Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:59:26Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:36:26Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"tracking_code\": \"9400100105807076063287\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzRjMDc0MjhjYWE2MzQ4OTU5ODRmZWYwNGUzOTRlNTg0\",\n \"est_delivery_date\": \"2024-08-16T15:59:26Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"signed_by\": null,\n \"id\": \"trk_4c07428caa634895984fef04e394e584\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_82b9789f5be811ef8428ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_82b9789f5be811ef8428ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:26Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e83400537bf15d44279fd7ef1af6a44b8a.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:26Z\",\n \"id\": \"pl_46430efed0d545d9a7f557da2387fbba\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:26Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_4f0b9056dcea44f186156082701966ae\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_82b65b7b5be811ef8094ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2dfeb5fc585b457695877fd497bcd6b4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_50969c8b169749d9b56ca0ca2da117df\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:25Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_cbf7a2104f9e4746a67c6ffbe6532cac\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:25Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f37aff5459bd4f0a95b891d42846ccb4\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:25+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:25+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_82b65b7b5be811ef8094ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063287\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [\n {\n \"mode\": \"test\",\n \"submitted_electronically\": null,\n \"updated_at\": \"2024-08-16T15:59:27Z\",\n \"form_url\": \"https://easypost-files.s3-us-west-2.amazonaws.com/files/form/20240816/9f8f75c5ae2f44db818fcf3428ff20ea.pdf\",\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"id\": \"form_121b7225729e4db1af3b540dd2312f15\",\n \"form_type\": \"return_packing_slip\",\n \"object\": \"Form\"\n }\n ],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:23Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d43143b1ff274c86aaa1b309a295eb17\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:59:23Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:59:23Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:36:23Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"tracking_code\": \"9400100105807076063263\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzA5ZDQxMDgwOTg2MTRmYWRiM2Q3OGYwYjc2NmE4ODA5\",\n \"est_delivery_date\": \"2024-08-16T15:59:23Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:23Z\",\n \"signed_by\": null,\n \"id\": \"trk_09d4108098614fadb3d78f0b766a8809\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_80d66f705be811ef838aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_80d66f705be811ef838aac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e84dc499ee756147d68df4b34eac679492.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:24Z\",\n \"id\": \"pl_c17618284675441cb2570e0c10395b70\",\n \"label_zpl_url\": \"https://easypost-files.s3-us-west-2.amazonaws.com/files/postage_label/20240816/d76049cad6b940dbb15b73e954242321.zpl\",\n \"label_date\": \"2024-08-16T15:59:22Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_5b0b226e670c4b4e9314d71750d65470\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_80d3cb275be811efaed93cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6228387051f2418bada036d885f95c75\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_d43143b1ff274c86aaa1b309a295eb17\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:22Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_070e965fd1cb43d8940afb3f8b40113d\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:22Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6fb2039692b84311a5925407b9971c34\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:22+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_80d3cb275be811efaed93cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063263\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ad8ed23080e0419984f243e28211ba7f\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:59:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:36:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"tracking_code\": \"9400100105807076063256\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2M5ZmE4OTVhYjlmYTQ5NTBiNzMzOWJmYWNiMDc2MzIw\",\n \"est_delivery_date\": \"2024-08-16T15:59:21Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"signed_by\": null,\n \"id\": \"trk_c9fa895ab9fa4950b7339bfacb076320\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7fcb86db5be811efbfc9ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7fcb86db5be811efbfc9ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8730e1ee74ac140cea1c5e5b64619c264.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"id\": \"pl_fad221aefff143f893040d14293357dd\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:21Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_aae7db8d78f94c98b218b441e74d7928\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": \"submitted\",\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7fc92f985be811efae8a3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bf39967c006a43fa9d91516204617ae3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ad8ed23080e0419984f243e28211ba7f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f7bf1becca794586969955ace10eddc2\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7fc92f985be811efae8a3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063256\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n },\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:19Z\",\n \"tax_identifiers\": [\n {\n \"issuing_country\": \"GB\",\n \"tax_id_type\": \"IOSS\",\n \"entity\": \"SENDER\",\n \"tax_id\": \"HIDDEN\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:19+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7f20fec65be811efae563cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_2f2a5fa00fef46fc8af72f1e7459e6d9\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:19+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7f20fec65be811efae563cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:19Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:19Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_f625052ff56642de8d160445820ca40f\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:19+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7f1e60ff5be811efbf8bac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_2f2a5fa00fef46fc8af72f1e7459e6d9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f73b11d674c6444bb168bfa72c098d3a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_2f2a5fa00fef46fc8af72f1e7459e6d9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2e90ceac4d9f4a2e9ed7fa973894c005\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_2f2a5fa00fef46fc8af72f1e7459e6d9\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0750ab5bbd7f47f9a965cbec4c24a288\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:19+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:19+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7f1e60ff5be811efbf8bac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "35336" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7761e786c91f00363415" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.440606" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments?%70%75%72%63%68%61%73%65%64\u003d%66%61%6C%73%65\u0026%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%69%6E%63%6C%75%64%65%5F%63%68%69%6C%64%72%65%6E\u003d%74%72%75%65" + }, + "duration": 647 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/get_smartrate_list.json b/src/test/cassettes/shipment/get_smartrate_list.json new file mode 100644 index 000000000..3b806748f --- /dev/null +++ b/src/test/cassettes/shipment/get_smartrate_list.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1723823942, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:01Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_746a08bc5be811efa8913cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_746a08bc5be811efa8913cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:01Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:01Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_5cbeb7a411be42e9935a4a9a63e9ceb1\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_74670c045be811efb994ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fc1dee8518584d8e9f6405a8da326eff\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_781ada61f2d84f8f8cfcde477e72c38f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e97eeea3d50b4df58a2ad9a91146c2ac\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:01+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:01+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_74670c045be811efb994ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5340" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf7745e786c56500361901" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.675151" + ], + "location": [ + "/api/v2/shipments/shp_aa8b00cce6f841709fbe816032eb404e" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 876 + }, + { + "recordedAt": 1723823942, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_aa8b00cce6f841709fbe816032eb404e/smartrate" + }, + "response": { + "body": "{\n \"result\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 33.1,\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 37.9,\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"rate\": 33.1,\n \"time_in_transit\": {\n \"percentile_90\": 3.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 4.0,\n \"percentile_99\": 7.0\n },\n \"service\": \"Express\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_fc1dee8518584d8e9f6405a8da326eff\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 8.25,\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 9.8,\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"rate\": 6.9,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"Priority\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_781ada61f2d84f8f8cfcde477e72c38f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 6.4,\n \"created_at\": \"2024-08-16T15:59:02Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_aa8b00cce6f841709fbe816032eb404e\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 8.45,\n \"updated_at\": \"2024-08-16T15:59:02Z\",\n \"rate\": 5.93,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 2.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"GroundAdvantage\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e97eeea3d50b4df58a2ad9a91146c2ac\",\n \"object\": \"Rate\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1965" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7746e786c567003619c0" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.111661" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_aa8b00cce6f841709fbe816032eb404e/smartrate" + }, + "duration": 328 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/insure.json b/src/test/cassettes/shipment/insure.json new file mode 100644 index 000000000..dd7a1d16b --- /dev/null +++ b/src/test/cassettes/shipment/insure.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1723823955, + "request": { + "body": "{\n \"shipment\": {\n \"insurance\": 0.0,\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a3ff301f594d4d31bc4fbfd4a8310030\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"tracking_code\": \"9400100105807076063232\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzE2OGQyMmVmMmUxNDQ2MDY4ZWQxODcwMTdkZDZkYTEy\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"signed_by\": null,\n \"id\": \"trk_168d22ef2e1446068ed187017dd6da12\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:14+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:14+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7c6d06d45be811ef820bac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:14+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:14+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7c6d06d45be811ef820bac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8d3944a2579d841e38eb51983247df5df.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"id\": \"pl_62aea740a0934613a5f0a3df28c911e4\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:15Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:14Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:14Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_9ce939f163e5473eb156be93d389e4be\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:14+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:15+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7c6aa0f05be811efbda6ac1f6bc53342\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_aaadded36e794ad2a85b32a6243be741\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a3ff301f594d4d31bc4fbfd4a8310030\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7035f396d7084290913d226fcdcf172c\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:14+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:15+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7c6aa0f05be811efbda6ac1f6bc53342\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063232\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6456" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7752e786c5cb003627b1" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.910967" + ], + "location": [ + "/api/v2/shipments/shp_bf09342c7e414155ac82f406b71a3a82" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1115 + }, + { + "recordedAt": 1723823956, + "request": { + "body": "{\n \"amount\": \"100\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_bf09342c7e414155ac82f406b71a3a82/insure" + }, + "response": { + "body": "{\n \"insurance\": \"100.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a3ff301f594d4d31bc4fbfd4a8310030\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:59:15Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:36:15Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"tracking_code\": \"9400100105807076063232\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzE2OGQyMmVmMmUxNDQ2MDY4ZWQxODcwMTdkZDZkYTEy\",\n \"est_delivery_date\": \"2024-08-16T15:59:15Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"signed_by\": null,\n \"id\": \"trk_168d22ef2e1446068ed187017dd6da12\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:14+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:14+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7c6d06d45be811ef820bac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:14+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:14+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7c6d06d45be811ef820bac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8d3944a2579d841e38eb51983247df5df.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"id\": \"pl_62aea740a0934613a5f0a3df28c911e4\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:15Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:14Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:14Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_9ce939f163e5473eb156be93d389e4be\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:14+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:15+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7c6aa0f05be811efbda6ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_aaadded36e794ad2a85b32a6243be741\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a3ff301f594d4d31bc4fbfd4a8310030\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:15Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_bf09342c7e414155ac82f406b71a3a82\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:15Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_7035f396d7084290913d226fcdcf172c\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:14+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:15+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7c6aa0f05be811efbda6ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063232\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7680" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7754e786c8db003628dc" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.288387" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_bf09342c7e414155ac82f406b71a3a82/insure" + }, + "duration": 502 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/lowest_rate.json b/src/test/cassettes/shipment/lowest_rate.json new file mode 100644 index 000000000..5a90bf325 --- /dev/null +++ b/src/test/cassettes/shipment/lowest_rate.json @@ -0,0 +1,97 @@ +[ + { + "recordedAt": 1723823949, + "request": { + "body": "{\n \"shipment\": {\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n ],\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"contents_type\": \"merchandise\"\n },\n \"reference\": \"123\",\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"options\": {\n \"label_format\": \"PNG\",\n \"invoice_number\": \"123\"\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:09Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:09Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:09+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:09+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_78e752f05be811efabb43cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_b48c71bd8ff74aac9ec390197c4fc994\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:09+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:09+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_78e752f05be811efabb43cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:59:09Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:59:09Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:09Z\",\n \"currency\": null,\n \"id\": \"cstitem_f02b09d988fd4e7fb112bee1127e1540\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:59:09Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_841b3fbbaf1a4f33945eb7b3a105fe4f\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:09Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:09Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_205a85c907ac46118302b1be0dc51fc8\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:09+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:09+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_78e4a9385be811efabb23cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:09Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b48c71bd8ff74aac9ec390197c4fc994\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:09Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_03d75778cc1b443190a446118017f239\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:09Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b48c71bd8ff74aac9ec390197c4fc994\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:09Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3b98ccd2e8a94f98a1cee71f6701d3f0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:09Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_b48c71bd8ff74aac9ec390197c4fc994\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:09Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1a01ba2dc94a425087e9cdf46edaebd9\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:09+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:09+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_78e4a9385be811efabb23cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6271" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf774de786c5a4003621d6" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.766259" + ], + "location": [ + "/api/v2/shipments/shp_b48c71bd8ff74aac9ec390197c4fc994" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 979 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/lowest_smartrate.json b/src/test/cassettes/shipment/lowest_smartrate.json new file mode 100644 index 000000000..3bf2f5be7 --- /dev/null +++ b/src/test/cassettes/shipment/lowest_smartrate.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823929, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:48Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:49Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:48+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6ce1b5f55be811efb5a1ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_e34e17fc29014902adb45654bf5156b7\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:48+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_6ce1b5f55be811efb5a1ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:48Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:48Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_611c6170cad547a4bca0be2f5671843f\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:48+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6cdeaf395be811efb6bfac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:49Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e34e17fc29014902adb45654bf5156b7\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:49Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_de25e9fd61e5425b85c7bf234d1da74b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:49Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e34e17fc29014902adb45654bf5156b7\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:49Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_be93c827dceb4c80beeb3143a3143c9d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:49Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e34e17fc29014902adb45654bf5156b7\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:49Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6631f5206f7f4324847af9cb55b3ec57\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:48+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:48+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_6cdeaf395be811efb6bfac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5436" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf7738e786c51f00360d91" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.769976" + ], + "location": [ + "/api/v2/shipments/shp_e34e17fc29014902adb45654bf5156b7" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 977 + }, + { + "recordedAt": 1723823930, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_e34e17fc29014902adb45654bf5156b7/smartrate" + }, + "response": { + "body": "{\n \"result\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 6.4,\n \"created_at\": \"2024-08-16T15:58:49Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e34e17fc29014902adb45654bf5156b7\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 8.45,\n \"updated_at\": \"2024-08-16T15:58:49Z\",\n \"rate\": 5.93,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 2.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"GroundAdvantage\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_de25e9fd61e5425b85c7bf234d1da74b\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 33.1,\n \"created_at\": \"2024-08-16T15:58:49Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e34e17fc29014902adb45654bf5156b7\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 37.9,\n \"updated_at\": \"2024-08-16T15:58:49Z\",\n \"rate\": 33.1,\n \"time_in_transit\": {\n \"percentile_90\": 3.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 4.0,\n \"percentile_99\": 7.0\n },\n \"service\": \"Express\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_be93c827dceb4c80beeb3143a3143c9d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 8.25,\n \"created_at\": \"2024-08-16T15:58:49Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_e34e17fc29014902adb45654bf5156b7\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 9.8,\n \"updated_at\": \"2024-08-16T15:58:49Z\",\n \"rate\": 6.9,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"Priority\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_6631f5206f7f4324847af9cb55b3ec57\",\n \"object\": \"Rate\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1965" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf773ae786c52300360f3d" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.123689" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_e34e17fc29014902adb45654bf5156b7/smartrate" + }, + "duration": 320 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/lowest_smartrate_list.json b/src/test/cassettes/shipment/lowest_smartrate_list.json new file mode 100644 index 000000000..7b510cd9a --- /dev/null +++ b/src/test/cassettes/shipment/lowest_smartrate_list.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823940, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:00+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:00+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_73933b5a5be811efb83eac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:00+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:00+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_73933b5a5be811efb83eac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_19c914584f004892b507902a475029ba\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:00+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:00+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_73907aeb5be811efbca5ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_af297646287d427fa0ddd3192083ed17\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_788bab7d8b5644ffa8de1fb1d2c2620c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1cc346ea52564de59d2576f4eb5a167e\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:00+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:00+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_73907aeb5be811efbca5ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5340" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf7744e786c562003617aa" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.724411" + ], + "location": [ + "/api/v2/shipments/shp_df33bec8dabf4e3bb89cf905ba173fd4" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 945 + }, + { + "recordedAt": 1723823941, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_df33bec8dabf4e3bb89cf905ba173fd4/smartrate" + }, + "response": { + "body": "{\n \"result\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 6.4,\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 8.45,\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"rate\": 5.93,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 2.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"GroundAdvantage\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_af297646287d427fa0ddd3192083ed17\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 33.1,\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 37.9,\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"rate\": 33.1,\n \"time_in_transit\": {\n \"percentile_90\": 3.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 4.0,\n \"percentile_99\": 7.0\n },\n \"service\": \"Express\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_788bab7d8b5644ffa8de1fb1d2c2620c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 8.25,\n \"created_at\": \"2024-08-16T15:59:00Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_df33bec8dabf4e3bb89cf905ba173fd4\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 9.8,\n \"updated_at\": \"2024-08-16T15:59:00Z\",\n \"rate\": 6.9,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"Priority\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_1cc346ea52564de59d2576f4eb5a167e\",\n \"object\": \"Rate\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1965" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf7745e786c56300361894" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.115416" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_df33bec8dabf4e3bb89cf905ba173fd4/smartrate" + }, + "duration": 325 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/refund.json b/src/test/cassettes/shipment/refund.json new file mode 100644 index 000000000..aedc35671 --- /dev/null +++ b/src/test/cassettes/shipment/refund.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823961, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"carrier\": \"USPS\",\n \"service\": \"GroundAdvantage\",\n \"to_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"carrier_accounts\": [\n \"ca_f09befdb2e9c410e95c7622ea912c18c\"\n ],\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ad8ed23080e0419984f243e28211ba7f\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": null,\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"weight\": null,\n \"tracking_details\": [],\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"tracking_code\": \"9400100105807076063256\",\n \"status_detail\": \"unknown\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2M5ZmE4OTVhYjlmYTQ5NTBiNzMzOWJmYWNiMDc2MzIw\",\n \"est_delivery_date\": null,\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"signed_by\": null,\n \"id\": \"trk_c9fa895ab9fa4950b7339bfacb076320\",\n \"object\": \"Tracker\",\n \"status\": \"unknown\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7fcb86db5be811efbfc9ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7fcb86db5be811efbfc9ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8730e1ee74ac140cea1c5e5b64619c264.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"id\": \"pl_fad221aefff143f893040d14293357dd\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:21Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_aae7db8d78f94c98b218b441e74d7928\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7fc92f985be811efae8a3cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bf39967c006a43fa9d91516204617ae3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ad8ed23080e0419984f243e28211ba7f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f7bf1becca794586969955ace10eddc2\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7fc92f985be811efae8a3cecef1b359e\",\n \"street2\": \"\",\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063256\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6549" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf7758e786c8e400362c62" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.966052" + ], + "location": [ + "/api/v2/shipments/shp_48f1f6414f3d495c9d572a42a9605cf8" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1164 + }, + { + "recordedAt": 1723823962, + "request": { + "body": "", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_48f1f6414f3d495c9d572a42a9605cf8/refund" + }, + "response": { + "body": "{\n \"insurance\": \"50.00\",\n \"fees\": [\n {\n \"amount\": \"0.00000\",\n \"refunded\": false,\n \"type\": \"LabelFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"5.93000\",\n \"refunded\": false,\n \"type\": \"PostageFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n },\n {\n \"amount\": \"0.50000\",\n \"refunded\": false,\n \"type\": \"InsuranceFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"selected_rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ad8ed23080e0419984f243e28211ba7f\",\n \"object\": \"Rate\"\n },\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:59:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:36:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"tracking_code\": \"9400100105807076063256\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2M5ZmE4OTVhYjlmYTQ5NTBiNzMzOWJmYWNiMDc2MzIw\",\n \"est_delivery_date\": \"2024-08-16T15:59:21Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"signed_by\": null,\n \"id\": \"trk_c9fa895ab9fa4950b7339bfacb076320\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n \"return_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7fcb86db5be811efbfc9ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"from_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7fcb86db5be811efbfc9ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": {\n \"label_resolution\": 300.0,\n \"date_advance\": 0.0,\n \"label_size\": \"4x6\",\n \"integrated_form\": \"none\",\n \"label_pdf_url\": null,\n \"created_at\": \"2024-08-16T15:59:21Z\",\n \"label_type\": \"default\",\n \"label_url\": \"https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20240816/e8730e1ee74ac140cea1c5e5b64619c264.png\",\n \"label_file\": null,\n \"label_epl2_url\": null,\n \"label_file_type\": \"image/png\",\n \"updated_at\": \"2024-08-16T15:59:21Z\",\n \"id\": \"pl_fad221aefff143f893040d14293357dd\",\n \"label_zpl_url\": null,\n \"label_date\": \"2024-08-16T15:59:21Z\",\n \"object\": \"PostageLabel\"\n },\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_aae7db8d78f94c98b218b441e74d7928\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": \"submitted\",\n \"buyer_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7fc92f985be811efae8a3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bf39967c006a43fa9d91516204617ae3\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ad8ed23080e0419984f243e28211ba7f\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:20Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_48f1f6414f3d495c9d572a42a9605cf8\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:20Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f7bf1becca794586969955ace10eddc2\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"94107-1670\",\n \"country\": \"US\",\n \"city\": \"SAN FRANCISCO\",\n \"created_at\": \"2024-08-16T15:59:20+00:00\",\n \"verifications\": {\n \"delivery\": {\n \"success\": true,\n \"details\": {\n \"latitude\": 37.77551,\n \"time_zone\": \"America/Los_Angeles\",\n \"longitude\": -122.39697\n },\n \"errors\": []\n },\n \"zip4\": {\n \"success\": true,\n \"details\": null,\n \"errors\": []\n }\n },\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": true,\n \"updated_at\": \"2024-08-16T15:59:20+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"JACK SPARROW\",\n \"company\": null,\n \"street1\": \"388 TOWNSEND ST APT 20\",\n \"id\": \"adr_7fc92f985be811efae8a3cecef1b359e\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"TEST@EXAMPLE.COM\",\n \"object\": \"Address\"\n },\n \"tracking_code\": \"9400100105807076063256\",\n \"messages\": [],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "7686" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7759e786c8fc00362d41" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.203574" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_48f1f6414f3d495c9d572a42a9605cf8/refund" + }, + "duration": 423 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/regenerate_rates.json b/src/test/cassettes/shipment/regenerate_rates.json new file mode 100644 index 000000000..12c595f11 --- /dev/null +++ b/src/test/cassettes/shipment/regenerate_rates.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1723823968, + "request": { + "body": "{\n \"shipment\": {\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n ],\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"contents_type\": \"merchandise\"\n },\n \"reference\": \"123\",\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"options\": {\n \"label_format\": \"PNG\",\n \"invoice_number\": \"123\"\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:28Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_842132085be811ef804aac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_842132085be811ef804aac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:27Z\",\n \"currency\": null,\n \"id\": \"cstitem_19dfcaf9a31147b193f4e655af5c6330\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:59:27Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_cccd3624b091446382e8347d4068fb69\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:27Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:27Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_a8e68738eb0d4200bb159fbc00d9a38d\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_841e561c5be811ef84b5ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:28Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:28Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_83dd744ac5f74616b6372fdeae2a7a88\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:28Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:28Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bccebf95cb30461fbd645f44bac700bd\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:28Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:28Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e1e5c22f6c934439adcade7a1b7bfa0b\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:27+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:27+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_841e561c5be811ef84b5ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6271" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf775fe786c9050036323f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.820652" + ], + "location": [ + "/api/v2/shipments/shp_4b226cf19b5642d69f374880045412d1" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1027 + }, + { + "recordedAt": 1723823969, + "request": { + "body": "{}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_4b226cf19b5642d69f374880045412d1/rerate" + }, + "response": { + "body": "{\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:29Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:29Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2d18e0151d8a43ce8a07a11614689fd4\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:29Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:29Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_3b475d28703940f6a8e0153d26265c32\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:29Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_4b226cf19b5642d69f374880045412d1\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:29Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_2e6e89533af440acb464a5d2bcfb628a\",\n \"object\": \"Rate\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1628" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7761e786c91e0036333d" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.711571" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_4b226cf19b5642d69f374880045412d1/rerate" + }, + "duration": 921 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/retrieve.json b/src/test/cassettes/shipment/retrieve.json new file mode 100644 index 000000000..367da4e24 --- /dev/null +++ b/src/test/cassettes/shipment/retrieve.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823948, + "request": { + "body": "{\n \"shipment\": {\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"hs_tariff_number\": \"654321\",\n \"value\": 23.25,\n \"origin_country\": \"US\"\n }\n ],\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"contents_type\": \"merchandise\"\n },\n \"reference\": \"123\",\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"options\": {\n \"label_format\": \"PNG\",\n \"invoice_number\": \"123\"\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:07Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:08Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:07+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:07+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_77fba8985be811efbf57ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_7d33e2a894cb4a7eb5e1861e845acb92\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:07+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:07+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_77fba8985be811efbf57ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:59:07Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:59:07Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:07Z\",\n \"currency\": null,\n \"id\": \"cstitem_e672815533284cef82b3a6e877488112\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:59:07Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_dda5bccaa39a4c3da766b4c6423346c4\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:07Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:07Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_26beb601d34c4c51ab9f3602770297ba\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:07+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:07+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_77f8c7905be811efbb02ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:08Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7d33e2a894cb4a7eb5e1861e845acb92\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:08Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_332bf557659940428092edc17f51d5a0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:08Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7d33e2a894cb4a7eb5e1861e845acb92\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:08Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9e996863abca4d58b65359090825ff1a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:08Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7d33e2a894cb4a7eb5e1861e845acb92\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:08Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_512f125236f14fd59c3a0bb23708b162\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:07+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:07+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_77f8c7905be811efbb02ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "6175" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf774be786c58a0036203a" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.892881" + ], + "location": [ + "/api/v2/shipments/shp_7d33e2a894cb4a7eb5e1861e845acb92" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1097 + }, + { + "recordedAt": 1723823948, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_7d33e2a894cb4a7eb5e1861e845acb92" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:59:07Z\",\n \"mode\": \"test\",\n \"reference\": \"123\",\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:59:08Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"label_format\": \"PNG\",\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n },\n \"invoice_number\": \"123\"\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:07+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:07+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_77fba8985be811efbf57ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_7d33e2a894cb4a7eb5e1861e845acb92\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:59:07+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:07+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_77fba8985be811efbf57ac1f6bc539ae\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": {\n \"restriction_type\": \"none\",\n \"created_at\": \"2024-08-16T15:59:07Z\",\n \"declaration\": null,\n \"mode\": \"test\",\n \"customs_items\": [\n {\n \"quantity\": 2.0,\n \"code\": null,\n \"eccn\": null,\n \"created_at\": \"2024-08-16T15:59:07Z\",\n \"description\": \"Sweet shirts\",\n \"weight\": 11.0,\n \"printed_commodity_identifier\": null,\n \"origin_country\": \"US\",\n \"manufacturer\": null,\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:07Z\",\n \"currency\": null,\n \"id\": \"cstitem_e672815533284cef82b3a6e877488112\",\n \"hs_tariff_number\": \"654321\",\n \"value\": \"23.25\",\n \"object\": \"CustomsItem\"\n }\n ],\n \"restriction_comments\": null,\n \"updated_at\": \"2024-08-16T15:59:07Z\",\n \"customs_certify\": true,\n \"eel_pfc\": \"NOEEI 30.37(a)\",\n \"customs_signer\": \"Steve Brule\",\n \"id\": \"cstinfo_dda5bccaa39a4c3da766b4c6423346c4\",\n \"contents_explanation\": \"\",\n \"non_delivery_option\": \"return\",\n \"object\": \"CustomsInfo\",\n \"contents_type\": \"merchandise\"\n },\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:59:07Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:59:07Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_26beb601d34c4c51ab9f3602770297ba\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:07+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:07+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_77f8c7905be811efbb02ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:59:08Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7d33e2a894cb4a7eb5e1861e845acb92\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:08Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_332bf557659940428092edc17f51d5a0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:59:08Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7d33e2a894cb4a7eb5e1861e845acb92\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:08Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9e996863abca4d58b65359090825ff1a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:59:08Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_7d33e2a894cb4a7eb5e1861e845acb92\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:59:08Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_512f125236f14fd59c3a0bb23708b162\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:59:07+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:59:07+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_77f8c7905be811efbb02ac1f6bc53342\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Too Many Requests\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "6175" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf774ce786c5a200362160" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.081478" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_7d33e2a894cb4a7eb5e1861e845acb92" + }, + "duration": 285 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/retrieve_estimated_delivery_date.json b/src/test/cassettes/shipment/retrieve_estimated_delivery_date.json new file mode 100644 index 000000000..5c17f069c --- /dev/null +++ b/src/test/cassettes/shipment/retrieve_estimated_delivery_date.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723823935, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:54Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:54Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:54+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:54+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7027886c5be811efa6ff3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_f8c2680a36cb4202bfba2df875413d75\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:54+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:54+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_7027886c5be811efa6ff3cecef1b359e\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:54Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:54Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_1b2d84278dec4f5490d4f04809e0454b\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:54+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:54+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7024bd915be811efb804ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:54Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f8c2680a36cb4202bfba2df875413d75\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:54Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bb6b1c1d8dc54d54b608aac379fb5cad\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:54Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f8c2680a36cb4202bfba2df875413d75\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:54Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_86bcd3501e6444609392a1f82e024d8d\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:54Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f8c2680a36cb4202bfba2df875413d75\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:54Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec8d75e79a494eb7ad451368d84d4c0e\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:54+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:54+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_7024bd915be811efb804ac1f6bc539aa\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5436" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf773ee786c53f00361258" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.632584" + ], + "location": [ + "/api/v2/shipments/shp_f8c2680a36cb4202bfba2df875413d75" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 840 + }, + { + "recordedAt": 1723823935, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_f8c2680a36cb4202bfba2df875413d75/smartrate/delivery_date?%70%6C%61%6E%6E%65%64%5F%73%68%69%70%5F%64%61%74%65\u003d%32%30%32%34%2D%30%38%2D%31%38" + }, + "response": { + "body": "{\n \"rates\": [\n {\n \"rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 33.1,\n \"created_at\": \"2024-08-16T15:58:54Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f8c2680a36cb4202bfba2df875413d75\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 37.9,\n \"updated_at\": \"2024-08-16T15:58:54Z\",\n \"rate\": 33.1,\n \"service\": \"Express\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_bb6b1c1d8dc54d54b608aac379fb5cad\",\n \"object\": \"Rate\"\n },\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 3.0,\n \"percentile_95\": 4.0,\n \"percentile_75\": 3.0,\n \"percentile_97\": 5.0,\n \"percentile_99\": 6.0\n },\n \"easypost_estimated_delivery_date\": \"2024-08-19\",\n \"planned_ship_date\": \"2024-08-18\"\n }\n },\n {\n \"rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 8.25,\n \"created_at\": \"2024-08-16T15:58:54Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f8c2680a36cb4202bfba2df875413d75\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 9.8,\n \"updated_at\": \"2024-08-16T15:58:54Z\",\n \"rate\": 6.9,\n \"service\": \"Priority\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_86bcd3501e6444609392a1f82e024d8d\",\n \"object\": \"Rate\"\n },\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 3.0,\n \"percentile_97\": 6.0,\n \"percentile_99\": 8.0\n },\n \"easypost_estimated_delivery_date\": \"2024-08-19\",\n \"planned_ship_date\": \"2024-08-18\"\n }\n },\n {\n \"rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 6.4,\n \"created_at\": \"2024-08-16T15:58:54Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_f8c2680a36cb4202bfba2df875413d75\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 8.45,\n \"updated_at\": \"2024-08-16T15:58:54Z\",\n \"rate\": 5.93,\n \"service\": \"GroundAdvantage\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_ec8d75e79a494eb7ad451368d84d4c0e\",\n \"object\": \"Rate\"\n },\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 5.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 3.0,\n \"percentile_97\": 6.0,\n \"percentile_99\": 9.0\n },\n \"easypost_estimated_delivery_date\": \"2024-08-19\",\n \"planned_ship_date\": \"2024-08-18\"\n }\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2336" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf773fe786c5400036130d" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.102369" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_f8c2680a36cb4202bfba2df875413d75/smartrate/delivery_date?%70%6C%61%6E%6E%65%64%5F%73%68%69%70%5F%64%61%74%65\u003d%32%30%32%34%2D%30%38%2D%31%38" + }, + "duration": 299 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/retrieve_recommend_date.json b/src/test/cassettes/shipment/retrieve_recommend_date.json new file mode 100644 index 000000000..b30a6c944 --- /dev/null +++ b/src/test/cassettes/shipment/retrieve_recommend_date.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1723824082, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T16:01:22Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T16:01:22Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T16:01:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:01:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_c83344795be811efa7b3ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_c9d82b54c5ad41afbdb6969f6a13f72a\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T16:01:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:01:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_c83344795be811efa7b3ac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T16:01:22Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T16:01:22Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_56599b2fa7a045c9bafddb63b171a4ca\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T16:01:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:01:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_c8309eb05be811efab86ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T16:01:22Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c9d82b54c5ad41afbdb6969f6a13f72a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:01:22Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a76bbe13d8f646e199a24c1c6cc7ae37\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T16:01:22Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c9d82b54c5ad41afbdb6969f6a13f72a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:01:22Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_563bfc41b37b424b82f79f45a76bacfa\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T16:01:22Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c9d82b54c5ad41afbdb6969f6a13f72a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T16:01:22Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0c84f3ba031646869f34bb78bd71e9d4\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T16:01:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T16:01:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_c8309eb05be811efab86ac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5436" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf77d2e787377b0036dfce" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.836989" + ], + "location": [ + "/api/v2/shipments/shp_c9d82b54c5ad41afbdb6969f6a13f72a" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1036 + }, + { + "recordedAt": 1723824083, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_c9d82b54c5ad41afbdb6969f6a13f72a/smartrate/precision_shipping?%64%65%73%69%72%65%64%5F%64%65%6C%69%76%65%72%79%5F%64%61%74%65\u003d%32%30%32%34%2D%30%38%2D%32%31" + }, + "response": { + "body": "{\n \"rates\": [\n {\n \"rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 33.1,\n \"created_at\": \"2024-08-16T16:01:22Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c9d82b54c5ad41afbdb6969f6a13f72a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 37.9,\n \"updated_at\": \"2024-08-16T16:01:22Z\",\n \"rate\": 33.1,\n \"service\": \"Express\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_a76bbe13d8f646e199a24c1c6cc7ae37\",\n \"object\": \"Rate\"\n },\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 3.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 3.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 4.0,\n \"percentile_99\": 7.0\n },\n \"delivery_date_confidence\": 0.45,\n \"ship_on_date\": \"2024-08-20\",\n \"desired_delivery_date\": \"2024-08-21\",\n \"estimated_transit_days\": 1.0\n }\n },\n {\n \"rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 8.25,\n \"created_at\": \"2024-08-16T16:01:22Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c9d82b54c5ad41afbdb6969f6a13f72a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 9.8,\n \"updated_at\": \"2024-08-16T16:01:22Z\",\n \"rate\": 6.9,\n \"service\": \"Priority\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_563bfc41b37b424b82f79f45a76bacfa\",\n \"object\": \"Rate\"\n },\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 3.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 4.0,\n \"percentile_97\": 7.0,\n \"percentile_99\": 8.0\n },\n \"delivery_date_confidence\": 0.29,\n \"ship_on_date\": \"2024-08-19\",\n \"desired_delivery_date\": \"2024-08-21\",\n \"estimated_transit_days\": 2.0\n }\n },\n {\n \"rate\": {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 6.4,\n \"created_at\": \"2024-08-16T16:01:22Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_c9d82b54c5ad41afbdb6969f6a13f72a\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 8.45,\n \"updated_at\": \"2024-08-16T16:01:22Z\",\n \"rate\": 5.93,\n \"service\": \"GroundAdvantage\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0c84f3ba031646869f34bb78bd71e9d4\",\n \"object\": \"Rate\"\n },\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 3.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 4.0,\n \"percentile_97\": 7.0,\n \"percentile_99\": 9.0\n },\n \"delivery_date_confidence\": 0.26,\n \"ship_on_date\": \"2024-08-19\",\n \"desired_delivery_date\": \"2024-08-21\",\n \"estimated_transit_days\": 2.0\n }\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2465" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf77d3e787377c0036e11d" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.140292" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_c9d82b54c5ad41afbdb6969f6a13f72a/smartrate/precision_shipping?%64%65%73%69%72%65%64%5F%64%65%6C%69%76%65%72%79%5F%64%61%74%65\u003d%32%30%32%34%2D%30%38%2D%32%31" + }, + "duration": 335 + } +] \ No newline at end of file diff --git a/src/test/cassettes/shipment/smart_rate.json b/src/test/cassettes/shipment/smart_rate.json new file mode 100644 index 000000000..2b6d7c6ac --- /dev/null +++ b/src/test/cassettes/shipment/smart_rate.json @@ -0,0 +1,183 @@ +[ + { + "recordedAt": 1723823939, + "request": { + "body": "{\n \"shipment\": {\n \"parcel\": {\n \"length\": 10.0,\n \"width\": 8.0,\n \"weight\": 15.4,\n \"height\": 4.0\n },\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"street1\": \"179 N Harbor Dr\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n },\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"street1\": \"388 Townsend St\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "response": { + "body": "{\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:58Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 4.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:58+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:58+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_729d37df5be811efb7ccac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:58+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:58+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Jack Sparrow\",\n \"company\": null,\n \"street1\": \"388 Townsend St\",\n \"id\": \"adr_729d37df5be811efb7ccac1f6bc53342\",\n \"street2\": \"Apt 20\",\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:58Z\",\n \"predefined_package\": null,\n \"length\": 10.0,\n \"width\": 8.0,\n \"created_at\": \"2024-08-16T15:58:58Z\",\n \"weight\": 15.4,\n \"id\": \"prcl_7a96490c9c1d4a06a727f60077a2e240\",\n \"object\": \"Parcel\",\n \"height\": 4.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:58+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:58+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_729ace3c5be811efbc4cac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"33.10\",\n \"created_at\": \"2024-08-16T15:58:59Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"37.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"rate\": \"33.10\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f0e69c0ba58d4b57ae08d098771b9b0c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"8.25\",\n \"created_at\": \"2024-08-16T15:58:59Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"9.80\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"rate\": \"6.90\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9b784972a375442da0d159c03b077866\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"6.40\",\n \"created_at\": \"2024-08-16T15:58:59Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"8.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"rate\": \"5.93\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_25a6c97d8340468188d1f39005ef7488\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"90277\",\n \"country\": \"US\",\n \"city\": \"Redondo Beach\",\n \"created_at\": \"2024-08-16T15:58:58+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:58+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"Elizabeth Swan\",\n \"company\": null,\n \"street1\": \"179 N Harbor Dr\",\n \"id\": \"adr_729ace3c5be811efbc4cac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"CA\",\n \"email\": \"test@example.com\",\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": null,\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "5436" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7742e786c5480036161a" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.927235" + ], + "location": [ + "/api/v2/shipments/shp_5f4dd3c13ff74547bcb2061c5a103e2f" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/shipments" + }, + "duration": 1137 + }, + { + "recordedAt": 1723823939, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/shipments/shp_5f4dd3c13ff74547bcb2061c5a103e2f/smartrate" + }, + "response": { + "body": "{\n \"result\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 33.1,\n \"created_at\": \"2024-08-16T15:58:59Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 37.9,\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"rate\": 33.1,\n \"time_in_transit\": {\n \"percentile_90\": 3.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 4.0,\n \"percentile_99\": 7.0\n },\n \"service\": \"Express\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_f0e69c0ba58d4b57ae08d098771b9b0c\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 8.25,\n \"created_at\": \"2024-08-16T15:58:59Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 9.8,\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"rate\": 6.9,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"Priority\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_9b784972a375442da0d159c03b077866\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": 6.4,\n \"created_at\": \"2024-08-16T15:58:59Z\",\n \"delivery_days\": 3.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_5f4dd3c13ff74547bcb2061c5a103e2f\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_currency\": \"USD\",\n \"retail_rate\": 8.45,\n \"updated_at\": \"2024-08-16T15:58:59Z\",\n \"rate\": 5.93,\n \"time_in_transit\": {\n \"percentile_90\": 2.0,\n \"percentile_50\": 1.0,\n \"percentile_85\": 2.0,\n \"percentile_95\": 2.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 3.0,\n \"percentile_99\": 3.0\n },\n \"service\": \"GroundAdvantage\",\n \"est_delivery_days\": 3.0,\n \"currency\": \"USD\",\n \"id\": \"rate_25a6c97d8340468188d1f39005ef7488\",\n \"object\": \"Rate\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1965" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf7743e786c56000361726" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.091068" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/shipments/shp_5f4dd3c13ff74547bcb2061c5a103e2f/smartrate" + }, + "duration": 297 + } +] \ No newline at end of file diff --git a/src/test/cassettes/smart_rate/retrieve_estimated_delivery_date.json b/src/test/cassettes/smart_rate/retrieve_estimated_delivery_date.json new file mode 100644 index 000000000..43c2a4f60 --- /dev/null +++ b/src/test/cassettes/smart_rate/retrieve_estimated_delivery_date.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723823875, + "request": { + "body": "{\n \"planned_ship_date\": \"2024-08-18\",\n \"to_zip\": \"90277\",\n \"from_zip\": \"94107\",\n \"carriers\": [\n \"USPS\"\n ]\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/smartrate/deliver_by" + }, + "response": { + "body": "{\n \"planned_ship_date\": \"2024-08-18\",\n \"to_zip\": \"90277\",\n \"carriers_without_tint_estimates\": null,\n \"from_zip\": \"94107\",\n \"saturday_delivery\": null,\n \"results\": [\n {\n \"carrier\": \"USPS\",\n \"service\": \"express\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 3.0,\n \"percentile_95\": 4.0,\n \"percentile_75\": 3.0,\n \"percentile_97\": 5.0,\n \"percentile_99\": 6.0\n },\n \"easypost_estimated_delivery_date\": \"2024-08-19\"\n }\n },\n {\n \"carrier\": \"USPS\",\n \"service\": \"groundadvantage\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 5.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 3.0,\n \"percentile_97\": 6.0,\n \"percentile_99\": 9.0\n },\n \"easypost_estimated_delivery_date\": \"2024-08-19\"\n }\n },\n {\n \"carrier\": \"USPS\",\n \"service\": \"librarymail\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 5.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 3.0,\n \"percentile_97\": 6.0,\n \"percentile_99\": 9.0\n },\n \"easypost_estimated_delivery_date\": \"2024-08-19\"\n }\n },\n {\n \"carrier\": \"USPS\",\n \"service\": \"mediamail\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 5.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 3.0,\n \"percentile_97\": 6.0,\n \"percentile_99\": 9.0\n },\n \"easypost_estimated_delivery_date\": \"2024-08-19\"\n }\n },\n {\n \"carrier\": \"USPS\",\n \"service\": \"priority\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 3.0,\n \"percentile_97\": 6.0,\n \"percentile_99\": 8.0\n },\n \"easypost_estimated_delivery_date\": \"2024-08-19\"\n }\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1496" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf7703e786c09e0035d5a9" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.069770" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/smartrate/deliver_by" + }, + "duration": 270 + } +] \ No newline at end of file diff --git a/src/test/cassettes/smart_rate/retrieve_recommend_ship_date.json b/src/test/cassettes/smart_rate/retrieve_recommend_ship_date.json new file mode 100644 index 000000000..6747402ae --- /dev/null +++ b/src/test/cassettes/smart_rate/retrieve_recommend_ship_date.json @@ -0,0 +1,91 @@ +[ + { + "recordedAt": 1723824483, + "request": { + "body": "{\n \"to_zip\": \"90277\",\n \"from_zip\": \"94107\",\n \"carriers\": [\n \"USPS\"\n ],\n \"desired_delivery_date\": \"2024-08-21\"\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/smartrate/deliver_on" + }, + "response": { + "body": "{\n \"to_zip\": \"90277\",\n \"carriers_without_tint_estimates\": null,\n \"from_zip\": \"94107\",\n \"saturday_delivery\": null,\n \"desired_delivery_date\": \"2024-08-21\",\n \"results\": [\n {\n \"carrier\": \"USPS\",\n \"service\": \"express\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 3.0,\n \"percentile_50\": 2.0,\n \"percentile_85\": 3.0,\n \"percentile_95\": 3.0,\n \"percentile_75\": 2.0,\n \"percentile_97\": 4.0,\n \"percentile_99\": 7.0\n },\n \"delivery_date_confidence\": 0.45,\n \"ship_on_date\": \"2024-08-20\",\n \"estimated_transit_days\": 1.0\n }\n },\n {\n \"carrier\": \"USPS\",\n \"service\": \"groundadvantage\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 3.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 4.0,\n \"percentile_97\": 7.0,\n \"percentile_99\": 9.0\n },\n \"delivery_date_confidence\": 0.26,\n \"ship_on_date\": \"2024-08-19\",\n \"estimated_transit_days\": 2.0\n }\n },\n {\n \"carrier\": \"USPS\",\n \"service\": \"librarymail\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 3.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 7.0,\n \"percentile_75\": 4.0,\n \"percentile_97\": 7.0,\n \"percentile_99\": 9.0\n },\n \"delivery_date_confidence\": 0.21,\n \"ship_on_date\": \"2024-08-19\",\n \"estimated_transit_days\": 2.0\n }\n },\n {\n \"carrier\": \"USPS\",\n \"service\": \"mediamail\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 3.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 4.0,\n \"percentile_97\": 7.0,\n \"percentile_99\": 9.0\n },\n \"delivery_date_confidence\": 0.29,\n \"ship_on_date\": \"2024-08-19\",\n \"estimated_transit_days\": 2.0\n }\n },\n {\n \"carrier\": \"USPS\",\n \"service\": \"priority\",\n \"easypost_time_in_transit_data\": {\n \"days_in_transit\": {\n \"percentile_90\": 4.0,\n \"percentile_50\": 3.0,\n \"percentile_85\": 4.0,\n \"percentile_95\": 5.0,\n \"percentile_75\": 4.0,\n \"percentile_97\": 7.0,\n \"percentile_99\": 8.0\n },\n \"delivery_date_confidence\": 0.29,\n \"ship_on_date\": \"2024-08-19\",\n \"estimated_transit_days\": 2.0\n }\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1695" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "0580883666bf7963e787564a00379441" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb2nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.158530" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/smartrate/deliver_on" + }, + "duration": 378 + } +] \ No newline at end of file diff --git a/src/test/cassettes/thread/thread_order_creation.json b/src/test/cassettes/thread/thread_order_creation.json new file mode 100644 index 000000000..1b74244c0 --- /dev/null +++ b/src/test/cassettes/thread/thread_order_creation.json @@ -0,0 +1,94 @@ +[ + { + "recordedAt": 1723823902, + "request": { + "body": "{\n \"order\": {\n \"to_address\": {\n \"zip\": \"64153\",\n \"city\": \"Kansas City\",\n \"phone\": \"REDACTED\",\n \"company\": \"Airport Shipping\",\n \"street1\": \"601 Brasilia Avenue\",\n \"state\": \"MO\"\n },\n \"shipments\": [\n {\n \"parcel\": {\n \"length\": 10.8,\n \"width\": 8.3,\n \"weight\": 10.0,\n \"height\": 6.0\n }\n }\n ],\n \"from_address\": {\n \"zip\": \"94107\",\n \"city\": \"San Francisco\",\n \"phone\": \"REDACTED\",\n \"name\": \"EasyPost\",\n \"street1\": \"164 Townsend St\",\n \"street2\": \"Unit 1\",\n \"state\": \"CA\"\n }\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "response": { + "body": "{\n \"customs_info\": null,\n \"buyer_address\": {\n \"zip\": \"64153\",\n \"country\": \"US\",\n \"city\": \"Kansas City\",\n \"created_at\": \"2024-08-16T15:58:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"Airport Shipping\",\n \"street1\": \"601 Brasilia Avenue\",\n \"id\": \"adr_5cedce4f5be811efb2aaac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"MO\",\n \"email\": null,\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"44.05\",\n \"created_at\": null,\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_02b98ba3f3824eddb0aee558d14fd355\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"51.65\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"44.05\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_832e039754be4a72a943d14addad11f0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"9.86\",\n \"created_at\": null,\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_02b98ba3f3824eddb0aee558d14fd355\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"9.43\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0a5c02530a6049bd804fb21acd8d724a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.45\",\n \"created_at\": null,\n \"delivery_days\": 4.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_02b98ba3f3824eddb0aee558d14fd355\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": null,\n \"rate\": \"5.45\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 4.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e1c3fad844b24d2b8130d3fc130215b1\",\n \"object\": \"Rate\"\n }\n ],\n \"created_at\": \"2024-08-16T15:58:22Z\",\n \"to_address\": {\n \"zip\": \"64153\",\n \"country\": \"US\",\n \"city\": \"Kansas City\",\n \"created_at\": \"2024-08-16T15:58:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"Airport Shipping\",\n \"street1\": \"601 Brasilia Avenue\",\n \"id\": \"adr_5cedce4f5be811efb2aaac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"MO\",\n \"email\": null,\n \"object\": \"Address\"\n },\n \"shipments\": [\n {\n \"insurance\": null,\n \"fees\": [],\n \"batch_id\": null,\n \"batch_message\": null,\n \"batch_status\": null,\n \"created_at\": \"2024-08-16T15:58:22Z\",\n \"mode\": \"test\",\n \"reference\": null,\n \"usps_zone\": 7.0,\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:22Z\",\n \"selected_rate\": null,\n \"options\": {\n \"date_advance\": 0.0,\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"tracker\": null,\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"EasyPost\",\n \"company\": null,\n \"street1\": \"164 Townsend St\",\n \"id\": \"adr_5cef58755be811efaee8ac1f6bc539aa\",\n \"street2\": \"Unit 1\",\n \"state\": \"CA\",\n \"email\": null,\n \"object\": \"Address\"\n },\n \"id\": \"shp_02b98ba3f3824eddb0aee558d14fd355\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"EasyPost\",\n \"company\": null,\n \"street1\": \"164 Townsend St\",\n \"id\": \"adr_5cef58755be811efaee8ac1f6bc539aa\",\n \"street2\": \"Unit 1\",\n \"state\": \"CA\",\n \"email\": null,\n \"object\": \"Address\"\n },\n \"customs_info\": null,\n \"postage_label\": null,\n \"parcel\": {\n \"mode\": \"test\",\n \"updated_at\": \"2024-08-16T15:58:22Z\",\n \"predefined_package\": null,\n \"length\": 10.8,\n \"width\": 8.3,\n \"created_at\": \"2024-08-16T15:58:22Z\",\n \"weight\": 10.0,\n \"id\": \"prcl_6a91509ee5d7466dbfb20bd7da374577\",\n \"object\": \"Parcel\",\n \"height\": 6.0\n },\n \"refund_status\": null,\n \"buyer_address\": {\n \"zip\": \"64153\",\n \"country\": \"US\",\n \"city\": \"Kansas City\",\n \"created_at\": \"2024-08-16T15:58:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"Airport Shipping\",\n \"street1\": \"601 Brasilia Avenue\",\n \"id\": \"adr_5cedce4f5be811efb2aaac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"MO\",\n \"email\": null,\n \"object\": \"Address\"\n },\n \"rates\": [\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"44.05\",\n \"created_at\": \"2024-08-16T15:58:22Z\",\n \"delivery_days\": 1.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_02b98ba3f3824eddb0aee558d14fd355\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"51.65\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:22Z\",\n \"rate\": \"44.05\",\n \"service\": \"Express\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 1.0,\n \"currency\": \"USD\",\n \"id\": \"rate_832e039754be4a72a943d14addad11f0\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"9.86\",\n \"created_at\": \"2024-08-16T15:58:22Z\",\n \"delivery_days\": 2.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_02b98ba3f3824eddb0aee558d14fd355\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"12.45\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:22Z\",\n \"rate\": \"9.43\",\n \"service\": \"Priority\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 2.0,\n \"currency\": \"USD\",\n \"id\": \"rate_0a5c02530a6049bd804fb21acd8d724a\",\n \"object\": \"Rate\"\n },\n {\n \"carrier_account_id\": \"ca_f09befdb2e9c410e95c7622ea912c18c\",\n \"list_rate\": \"5.45\",\n \"created_at\": \"2024-08-16T15:58:22Z\",\n \"delivery_days\": 4.0,\n \"list_currency\": \"USD\",\n \"shipment_id\": \"shp_02b98ba3f3824eddb0aee558d14fd355\",\n \"mode\": \"test\",\n \"carrier\": \"USPS\",\n \"delivery_date\": null,\n \"delivery_date_guaranteed\": false,\n \"retail_rate\": \"6.90\",\n \"retail_currency\": \"USD\",\n \"updated_at\": \"2024-08-16T15:58:22Z\",\n \"rate\": \"5.45\",\n \"service\": \"GroundAdvantage\",\n \"billing_type\": \"easypost\",\n \"est_delivery_days\": 4.0,\n \"currency\": \"USD\",\n \"id\": \"rate_e1c3fad844b24d2b8130d3fc130215b1\",\n \"object\": \"Rate\"\n }\n ],\n \"scan_form\": null,\n \"to_address\": {\n \"zip\": \"64153\",\n \"country\": \"US\",\n \"city\": \"Kansas City\",\n \"created_at\": \"2024-08-16T15:58:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": null,\n \"company\": \"Airport Shipping\",\n \"street1\": \"601 Brasilia Avenue\",\n \"id\": \"adr_5cedce4f5be811efb2aaac1f6bc539ae\",\n \"street2\": null,\n \"state\": \"MO\",\n \"email\": null,\n \"object\": \"Address\"\n },\n \"tracking_code\": null,\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"order_id\": \"order_762874dd0d3941c6afe7cbedef177d5c\",\n \"forms\": [],\n \"status\": \"unknown\",\n \"object\": \"Shipment\"\n }\n ],\n \"mode\": \"test\",\n \"reference\": \"\",\n \"is_return\": false,\n \"updated_at\": \"2024-08-16T15:58:22Z\",\n \"options\": {\n \"currency\": \"USD\",\n \"payment\": {\n \"type\": \"SENDER\"\n }\n },\n \"return_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"EasyPost\",\n \"company\": null,\n \"street1\": \"164 Townsend St\",\n \"id\": \"adr_5cef58755be811efaee8ac1f6bc539aa\",\n \"street2\": \"Unit 1\",\n \"state\": \"CA\",\n \"email\": null,\n \"object\": \"Address\"\n },\n \"messages\": [\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_e6db2c19d54c4025b852d0ad81ee7f4e\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_687017c7f80044ab942b697a9607c439\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_6924408886ad49ac9a8468804f2b52b7\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_3e92a82adac444a58f032ebcd8eb9028\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_8031f3014d2b49dba089e5c14da57413\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_2cdc6fb96d99484e8631d7c9620dec24\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_1c4eecb124f841d7a51e7e53cdda6cd8\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n },\n {\n \"carrier\": \"UPS\",\n \"carrier_account_id\": \"ca_f363eb4e1b194798b015a07598be6ed4\",\n \"type\": \"rate_error\",\n \"message\": \"Invalid Access License number\"\n }\n ],\n \"id\": \"order_762874dd0d3941c6afe7cbedef177d5c\",\n \"from_address\": {\n \"zip\": \"94107\",\n \"country\": \"US\",\n \"city\": \"San Francisco\",\n \"created_at\": \"2024-08-16T15:58:22+00:00\",\n \"verifications\": {},\n \"mode\": \"test\",\n \"federal_tax_id\": null,\n \"state_tax_id\": null,\n \"carrier_facility\": null,\n \"residential\": null,\n \"updated_at\": \"2024-08-16T15:58:22+00:00\",\n \"phone\": \"REDACTED\",\n \"name\": \"EasyPost\",\n \"company\": null,\n \"street1\": \"164 Townsend St\",\n \"id\": \"adr_5cef58755be811efaee8ac1f6bc539aa\",\n \"street2\": \"Unit 1\",\n \"state\": \"CA\",\n \"email\": null,\n \"object\": \"Address\"\n },\n \"object\": \"Order\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "10186" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf771ee786c16a0035f19c" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.639739" + ], + "location": [ + "/api/v2/orders/order_762874dd0d3941c6afe7cbedef177d5c" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/orders" + }, + "duration": 850 + } +] \ No newline at end of file diff --git a/src/test/cassettes/tracker/all.json b/src/test/cassettes/tracker/all.json new file mode 100644 index 000000000..6a9e56349 --- /dev/null +++ b/src/test/cassettes/tracker/all.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823904, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"trackers\": [\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:19Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"tracking_code\": \"9400100105807076062921\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzIzODcyZWMyYWNhYTRjMzk5OGMxMjk2OTJhMzZhMWY1\",\n \"est_delivery_date\": \"2024-08-16T15:58:19Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:19Z\",\n \"signed_by\": null,\n \"id\": \"trk_23872ec2acaa4c3998c129692a36a1f5\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:15Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:15Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:15Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"tracking_code\": \"9400100105807076062891\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2RlMGRiOWNjNzk4OTQ5NTY4MTBmOGNhMWMwZjA0Y2M1\",\n \"est_delivery_date\": \"2024-08-16T15:58:15Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:15Z\",\n \"signed_by\": null,\n \"id\": \"trk_de0db9cc79894956810f8ca1c0f04cc5\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:11Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:11Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:11Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"tracking_code\": \"9400100105807076062877\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2IxMjQwNWY5YTI1OTQ1YjhhYmJhMGY4MjY2NzlmZDU0\",\n \"est_delivery_date\": \"2024-08-16T15:58:11Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:11Z\",\n \"signed_by\": null,\n \"id\": \"trk_b12405f9a25945b8abba0f826679fd54\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:54Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:57:54Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:34:54Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"tracking_code\": \"9400100105807076062822\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzBhZGEwYzY0YTU0NDQzYTFiMjQxMTM2MTQ2MGU2ZjBh\",\n \"est_delivery_date\": \"2024-08-16T15:57:54Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"signed_by\": null,\n \"id\": \"trk_0ada0c64a54443a1b2411361460e6f0a\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:31Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:57:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:34:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_a6df738bc84b4fc3bda44745b7e97f07\",\n \"tracking_code\": \"9400100105807076062648\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2JjMjkxNzA2NzM1MjQ1YTFhYWQ4ZDkyNzEyMDcyNjFk\",\n \"est_delivery_date\": \"2024-08-16T15:57:31Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:31Z\",\n \"signed_by\": null,\n \"id\": \"trk_bc291706735245a1aad8d9271207261d\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "8220" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7720e786c1860035f440" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.216903" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 415 + } +] \ No newline at end of file diff --git a/src/test/cassettes/tracker/all_parameter_hand_off.json b/src/test/cassettes/tracker/all_parameter_hand_off.json new file mode 100644 index 000000000..18b6ebe0f --- /dev/null +++ b/src/test/cassettes/tracker/all_parameter_hand_off.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823904, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%72%61%63%6B%69%6E%67%5F%63%6F%64%65\u003d%73%6F%6D%65%74%68%69%6E%67\u0026%63%61%72%72%69%65%72\u003d%73%6F%6D%65%74%68%69%6E%67+%65%6C%73%65" + }, + "response": { + "body": "{\n \"trackers\": [],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "32" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf7720e786c1870035f4ba" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.043134" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%72%61%63%6B%69%6E%67%5F%63%6F%64%65\u003d%73%6F%6D%65%74%68%69%6E%67\u0026%63%61%72%72%69%65%72\u003d%73%6F%6D%65%74%68%69%6E%67+%65%6C%73%65" + }, + "duration": 251 + } +] \ No newline at end of file diff --git a/src/test/cassettes/tracker/create.json b/src/test/cassettes/tracker/create.json new file mode 100644 index 000000000..cbbc18cfa --- /dev/null +++ b/src/test/cassettes/tracker/create.json @@ -0,0 +1,97 @@ +[ + { + "recordedAt": 1723823906, + "request": { + "body": "{\n \"tracker\": {\n \"carrier\": \"USPS\",\n \"tracking_code\": \"EZ1000000001\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/trackers" + }, + "response": { + "body": "{\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-24T22:21:52Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T22:21:52Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T10:58:52Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2VjNDg5YTg4NWQ3MzRlNDY5MjRiZWZhZDMzMzZkNWY0\",\n \"est_delivery_date\": \"2024-07-24T22:21:52Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-24T22:21:52Z\",\n \"signed_by\": null,\n \"id\": \"trk_ec489a885d734e46924befad3336d5f4\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1618" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7722e786c49c0035f665" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.092682" + ], + "location": [ + "/api/v2/trackers/trk_ec489a885d734e46924befad3336d5f4" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers" + }, + "duration": 312 + } +] \ No newline at end of file diff --git a/src/test/cassettes/tracker/delete.json b/src/test/cassettes/tracker/delete.json new file mode 100644 index 000000000..83675ba7d --- /dev/null +++ b/src/test/cassettes/tracker/delete.json @@ -0,0 +1,180 @@ +[ + { + "recordedAt": 1770145106, + "request": { + "body": "{\n \"tracker\": {\n \"carrier\": \"USPS\",\n \"tracking_code\": \"EZ1000000001\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/trackers" + }, + "response": { + "body": "{\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2025-11-06T17:22:58Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"est_delivery_date\": null,\n \"datetime\": \"2025-10-06T17:22:58Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"est_delivery_date\": null,\n \"datetime\": \"2025-10-07T05:59:58Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzJlNWJmZTAyZTE3MTRjODU5MDdiYTdhYTU2ODI1NDI3\",\n \"est_delivery_date\": \"2025-11-06T17:22:58Z\",\n \"carrier\": \"USPS\",\n \"delivery_evidence\": [],\n \"is_return\": false,\n \"updated_at\": \"2025-11-06T17:22:58Z\",\n \"signed_by\": null,\n \"id\": \"trk_2e5bfe02e1714c85907ba7aa56825427\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1691" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "e05a3b9c69824552e789838a003ca558" + ], + "x-proxied": [ + "intlb4nuq 5f0235a1ab", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.109996" + ], + "location": [ + "/api/v2/trackers/trk_2e5bfe02e1714c85907ba7aa56825427" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202602022215-5a5c93c546-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers" + }, + "duration": 339 + }, + { + "recordedAt": 1770145106, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/trackers/trk_2e5bfe02e1714c85907ba7aa56825427" + }, + "response": { + "body": "{\n \"success\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "16" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb64nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "e05a3b9c69824552e789838b003ca5f3" + ], + "x-proxied": [ + "intlb4nuq 5f0235a1ab", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.038769" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202602022215-5a5c93c546-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers/trk_2e5bfe02e1714c85907ba7aa56825427" + }, + "duration": 270 + } +] \ No newline at end of file diff --git a/src/test/cassettes/tracker/get_next_page.json b/src/test/cassettes/tracker/get_next_page.json new file mode 100644 index 000000000..566210bed --- /dev/null +++ b/src/test/cassettes/tracker/get_next_page.json @@ -0,0 +1,174 @@ +[ + { + "recordedAt": 1723823903, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"trackers\": [\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:19Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:19Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_1afc79ef71b2437e92cfd3c63b048ab9\",\n \"tracking_code\": \"9400100105807076062921\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzIzODcyZWMyYWNhYTRjMzk5OGMxMjk2OTJhMzZhMWY1\",\n \"est_delivery_date\": \"2024-08-16T15:58:19Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:19Z\",\n \"signed_by\": null,\n \"id\": \"trk_23872ec2acaa4c3998c129692a36a1f5\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:15Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:15Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:15Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_92744ae3e4364c35b4ed9035695dd218\",\n \"tracking_code\": \"9400100105807076062891\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2RlMGRiOWNjNzk4OTQ5NTY4MTBmOGNhMWMwZjA0Y2M1\",\n \"est_delivery_date\": \"2024-08-16T15:58:15Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:15Z\",\n \"signed_by\": null,\n \"id\": \"trk_de0db9cc79894956810f8ca1c0f04cc5\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:58:11Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:11Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:11Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_54ad1de739464651a50980f4b4246eee\",\n \"tracking_code\": \"9400100105807076062877\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2IxMjQwNWY5YTI1OTQ1YjhhYmJhMGY4MjY2NzlmZDU0\",\n \"est_delivery_date\": \"2024-08-16T15:58:11Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:11Z\",\n \"signed_by\": null,\n \"id\": \"trk_b12405f9a25945b8abba0f826679fd54\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:54Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:57:54Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:34:54Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_e2b01acfa9ce40a1beabb08665cac06d\",\n \"tracking_code\": \"9400100105807076062822\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzBhZGEwYzY0YTU0NDQzYTFiMjQxMTM2MTQ2MGU2ZjBh\",\n \"est_delivery_date\": \"2024-08-16T15:57:54Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:54Z\",\n \"signed_by\": null,\n \"id\": \"trk_0ada0c64a54443a1b2411361460e6f0a\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:31Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:57:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:34:31Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_a6df738bc84b4fc3bda44745b7e97f07\",\n \"tracking_code\": \"9400100105807076062648\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2JjMjkxNzA2NzM1MjQ1YTFhYWQ4ZDkyNzEyMDcyNjFk\",\n \"est_delivery_date\": \"2024-08-16T15:57:31Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:31Z\",\n \"signed_by\": null,\n \"id\": \"trk_bc291706735245a1aad8d9271207261d\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "8220" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf771fe786c1840035f32d" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.200468" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 399 + }, + { + "recordedAt": 1723823904, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%74%72%6B%5F%62%63%32%39%31%37%30%36%37%33%35%32%34%35%61%31%61%61%64%38%64%39%32%37%31%32%30%37%32%36%31%64" + }, + "response": { + "body": "{\n \"trackers\": [\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:29Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:57:29Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:34:29Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_761def93b984449987a38eedb7470636\",\n \"tracking_code\": \"9400100105807076062624\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2Y2MGM4NGRhMjgxOTQxNTc5NjUyMGE1M2FkZTNlMjky\",\n \"est_delivery_date\": \"2024-08-16T15:57:29Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:29Z\",\n \"signed_by\": null,\n \"id\": \"trk_f60c84da2819415796520a53ade3e292\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:24Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:57:24Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:34:24Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_0f2ce274ee16425a97809c452708cac8\",\n \"tracking_code\": \"9400100105807076062549\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzU1ZjVkNTc0ODFlYjQ3MDU4OGJjY2Q5NmI5ODMzNGJk\",\n \"est_delivery_date\": \"2024-08-16T15:57:24Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:57:24Z\",\n \"signed_by\": null,\n \"id\": \"trk_55f5d57481eb470588bccd96b98334bd\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:21Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T14:40:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-18T16:16:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-18T19:07:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-19T00:47:21Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_313455b1af2843bba16b05df1803a302\",\n \"tracking_code\": \"9400100105807076062532\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2E1N2QxM2MyZDhkMjQ5MmE5NzU1ODQ3YzE2ZjBiOWJj\",\n \"est_delivery_date\": \"2024-08-16T15:58:21Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:21Z\",\n \"signed_by\": null,\n \"id\": \"trk_a57d13c2d8d2492a9755847c16f0b9bc\",\n \"object\": \"Tracker\",\n \"status\": \"in_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:18Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T14:40:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-18T16:16:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-18T19:07:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-19T00:47:18Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_730842bb306645f2834578e167608cb1\",\n \"tracking_code\": \"9400100105807076062518\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzE1ODNmYzdkYTYyYjRkMmU4YzA0NzY2NTg4M2EyZDQ4\",\n \"est_delivery_date\": \"2024-08-16T15:58:18Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:18Z\",\n \"signed_by\": null,\n \"id\": \"trk_1583fc7da62b4d2e8c047665883a2d48\",\n \"object\": \"Tracker\",\n \"status\": \"in_transit\"\n },\n {\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-08-16T15:57:13Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-16T15:58:13Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T04:35:13Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77315\",\n \"country\": null,\n \"city\": \"NORTH HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-17T14:40:13Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Origin Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29201\",\n \"country\": null,\n \"city\": \"COLUMBIA\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-18T16:16:13Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at USPS Facility\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-18T19:07:13Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Arrived at Post Office\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"arrived_at_facility\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"29407\",\n \"country\": null,\n \"city\": \"CHARLESTON\",\n \"state\": \"SC\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-07-19T00:47:13Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Sorting Complete\",\n \"object\": \"TrackingDetail\",\n \"status\": \"in_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": \"shp_e7ea0fa2a1294ab6b98ed4b38acc835f\",\n \"tracking_code\": \"9400100105807076062464\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzc4M2QyYjY1MTczNjQxYWVhYWJjOWVlMDUzYzQyOWJm\",\n \"est_delivery_date\": \"2024-08-16T15:58:13Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-08-16T15:58:13Z\",\n \"signed_by\": null,\n \"id\": \"trk_783d2b65173641aeaabc9ee053c429bf\",\n \"object\": \"Tracker\",\n \"status\": \"in_transit\"\n }\n ],\n \"has_more\": true\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "12075" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf771fe786c1850035f3a4" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.215482" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%62%65%66%6F%72%65%5F%69%64\u003d%74%72%6B%5F%62%63%32%39%31%37%30%36%37%33%35%32%34%35%61%31%61%61%64%38%64%39%32%37%31%32%30%37%32%36%31%64" + }, + "duration": 413 + } +] \ No newline at end of file diff --git a/src/test/cassettes/tracker/get_next_page_parameter_hand_off.json b/src/test/cassettes/tracker/get_next_page_parameter_hand_off.json new file mode 100644 index 000000000..ef1e4eb8f --- /dev/null +++ b/src/test/cassettes/tracker/get_next_page_parameter_hand_off.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823906, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%72%61%63%6B%69%6E%67%5F%63%6F%64%65\u003d%73%6F%6D%65%74%68%69%6E%67\u0026%63%61%72%72%69%65%72\u003d%73%6F%6D%65%74%68%69%6E%67+%65%6C%73%65" + }, + "response": { + "body": "{\n \"trackers\": [],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "32" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf7722e786c49d0035f6bb" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.054183" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers?%70%61%67%65%5F%73%69%7A%65\u003d%35\u0026%74%72%61%63%6B%69%6E%67%5F%63%6F%64%65\u003d%73%6F%6D%65%74%68%69%6E%67\u0026%63%61%72%72%69%65%72\u003d%73%6F%6D%65%74%68%69%6E%67+%65%6C%73%65" + }, + "duration": 251 + } +] \ No newline at end of file diff --git a/src/test/cassettes/tracker/retrieve.json b/src/test/cassettes/tracker/retrieve.json new file mode 100644 index 000000000..564747ff0 --- /dev/null +++ b/src/test/cassettes/tracker/retrieve.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1723823905, + "request": { + "body": "{\n \"tracker\": {\n \"carrier\": \"USPS\",\n \"tracking_code\": \"EZ1000000001\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/trackers" + }, + "response": { + "body": "{\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-24T22:21:52Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T22:21:52Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T10:58:52Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2VjNDg5YTg4NWQ3MzRlNDY5MjRiZWZhZDMzMzZkNWY0\",\n \"est_delivery_date\": \"2024-07-24T22:21:52Z\",\n \"carrier\": \"USPS\",\n \"is_return\": false,\n \"updated_at\": \"2024-07-24T22:21:52Z\",\n \"signed_by\": null,\n \"id\": \"trk_ec489a885d734e46924befad3336d5f4\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1618" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf7721e786c1890035f511" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.090974" + ], + "location": [ + "/api/v2/trackers/trk_ec489a885d734e46924befad3336d5f4" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers" + }, + "duration": 292 + }, + { + "recordedAt": 1723823905, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/trackers/trk_ec489a885d734e46924befad3336d5f4" + }, + "response": { + "body": "{\n \"fees\": [],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2024-07-24T22:21:52Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-24T22:21:52Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"datetime\": \"2024-06-25T10:58:52Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrX2VjNDg5YTg4NWQ3MzRlNDY5MjRiZWZhZDMzMzZkNWY0\",\n \"est_delivery_date\": \"2024-07-24T22:21:52Z\",\n \"carrier\": \"USPS\",\n \"updated_at\": \"2024-07-24T22:21:52Z\",\n \"signed_by\": null,\n \"id\": \"trk_ec489a885d734e46924befad3336d5f4\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1593" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43c66bf7721e786c18a0035f55f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.072253" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers/trk_ec489a885d734e46924befad3336d5f4" + }, + "duration": 271 + } +] \ No newline at end of file diff --git a/src/test/cassettes/tracker/retrieve_batch.json b/src/test/cassettes/tracker/retrieve_batch.json new file mode 100644 index 000000000..8f6518de1 --- /dev/null +++ b/src/test/cassettes/tracker/retrieve_batch.json @@ -0,0 +1,186 @@ +[ + { + "recordedAt": 1762449778, + "request": { + "body": "{\n \"tracker\": {\n \"carrier\": \"USPS\",\n \"tracking_code\": \"EZ1000000001\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/trackers" + }, + "response": { + "body": "{\n \"fees\": [\n {\n \"amount\": \"0.02000\",\n \"refunded\": false,\n \"type\": \"TrackerFee\",\n \"charged\": false,\n \"object\": \"Fee\"\n }\n ],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2025-11-06T17:22:58Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"est_delivery_date\": null,\n \"datetime\": \"2025-10-06T17:22:58Z\",\n \"description\": null,\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": null\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"est_delivery_date\": null,\n \"datetime\": \"2025-10-07T05:59:58Z\",\n \"description\": null,\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": null\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"finalized\": true,\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzJlNWJmZTAyZTE3MTRjODU5MDdiYTdhYTU2ODI1NDI3\",\n \"est_delivery_date\": \"2025-11-06T17:22:58Z\",\n \"carrier\": \"USPS\",\n \"delivery_evidence\": [],\n \"is_return\": false,\n \"updated_at\": \"2025-11-06T17:22:58Z\",\n \"signed_by\": null,\n \"id\": \"trk_2e5bfe02e1714c85907ba7aa56825427\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "1797" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "a777ff39690cd972e2aac1950102100a" + ], + "x-proxied": [ + "intlb6nuq c0061e0a2e", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.172763" + ], + "location": [ + "/api/v2/trackers/trk_2e5bfe02e1714c85907ba7aa56825427" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202511061639-9e7dc69a6b-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/trackers" + }, + "duration": 287 + }, + { + "recordedAt": 1762449778, + "request": { + "body": "{\n \"tracking_codes\": [\n \"EZ1000000001\"\n ]\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/trackers/batch" + }, + "response": { + "body": "{\n \"trackers\": [\n {\n \"fees\": [\n {\n \"amount\": \"0.02000\",\n \"refunded\": false,\n \"type\": \"TrackerFee\",\n \"charged\": true,\n \"object\": \"Fee\"\n }\n ],\n \"carrier_detail\": {\n \"est_delivery_date_local\": null,\n \"origin_location\": \"HOUSTON TX, 77001\",\n \"destination_tracking_location\": null,\n \"guaranteed_delivery_date\": null,\n \"est_delivery_time_local\": null,\n \"service\": \"First-Class Package Service\",\n \"container_type\": null,\n \"initial_delivery_attempt\": null,\n \"origin_tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"destination_location\": \"CHARLESTON SC, 29401\",\n \"alternate_identifier\": null,\n \"object\": \"CarrierDetail\"\n },\n \"created_at\": \"2025-11-06T17:22:58Z\",\n \"weight\": null,\n \"tracking_details\": [\n {\n \"tracking_location\": {\n \"zip\": null,\n \"country\": null,\n \"city\": null,\n \"state\": null,\n \"object\": \"TrackingLocation\"\n },\n \"est_delivery_date\": null,\n \"datetime\": \"2025-10-06T17:22:58Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Pre-Shipment Info Sent to USPS\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n },\n {\n \"tracking_location\": {\n \"zip\": \"77063\",\n \"country\": null,\n \"city\": \"HOUSTON\",\n \"state\": \"TX\",\n \"object\": \"TrackingLocation\"\n },\n \"est_delivery_date\": null,\n \"datetime\": \"2025-10-07T05:59:58Z\",\n \"description\": \"\",\n \"source\": \"USPS\",\n \"message\": \"Shipping Label Created\",\n \"object\": \"TrackingDetail\",\n \"status\": \"pre_transit\",\n \"status_detail\": \"status_update\",\n \"carrier_code\": \"\"\n }\n ],\n \"shipment_id\": null,\n \"tracking_code\": \"EZ1000000001\",\n \"status_detail\": \"status_update\",\n \"mode\": \"test\",\n \"public_url\": \"https://track.easypost.com/djE6dHJrXzJlNWJmZTAyZTE3MTRjODU5MDdiYTdhYTU2ODI1NDI3\",\n \"est_delivery_date\": \"2025-11-06T17:22:58Z\",\n \"carrier\": \"USPS\",\n \"delivery_evidence\": [],\n \"updated_at\": \"2025-11-06T17:22:58Z\",\n \"signed_by\": null,\n \"id\": \"trk_2e5bfe02e1714c85907ba7aa56825427\",\n \"object\": \"Tracker\",\n \"status\": \"pre_transit\"\n }\n ],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "1785" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb55nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "a777ff3b690cd972e2aac19701021096" + ], + "x-proxied": [ + "intlb5nuq c0061e0a2e", + "extlb1nuq cbbd141214" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.062892" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202511061639-9e7dc69a6b-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/trackers/batch" + }, + "duration": 178 + } +] \ No newline at end of file diff --git a/src/test/cassettes/user/all_children.json b/src/test/cassettes/user/all_children.json new file mode 100644 index 000000000..ff6d9809d --- /dev/null +++ b/src/test/cassettes/user/all_children.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823861, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/children?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"children\": [\n {\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"test user\",\n \"verified\": true,\n \"created_at\": \"2023-12-07T17:46:08Z\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\",\n \"object\": \"User\"\n }\n ],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "245" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76f4e786bce60035c750" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.081468" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/children?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 283 + } +] \ No newline at end of file diff --git a/src/test/cassettes/user/create.json b/src/test/cassettes/user/create.json new file mode 100644 index 000000000..904e9e196 --- /dev/null +++ b/src/test/cassettes/user/create.json @@ -0,0 +1,257 @@ +[ + { + "recordedAt": 1723823861, + "request": { + "body": "{\n \"user\": {\n \"name\": \"Test User\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/users" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:41Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_2f5cb2d387d84df8b7581bd2ff1f78f0\",\n \"api_keys\": [],\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "691" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76f5e786bcff0035c7ce" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.488848" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/users" + }, + "duration": 692 + }, + { + "recordedAt": 1723823862, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_2f5cb2d387d84df8b7581bd2ff1f78f0" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:41Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_2f5cb2d387d84df8b7581bd2ff1f78f0\",\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "284" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44066bf76f6e786bd000035c8aa" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.107554" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/user_2f5cb2d387d84df8b7581bd2ff1f78f0" + }, + "duration": 315 + }, + { + "recordedAt": 1723823862, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_2f5cb2d387d84df8b7581bd2ff1f78f0" + }, + "response": { + "body": "", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 204 No Content" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76f6e786bd010035c908" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.121439" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "uri": "https://api.easypost.com/v2/users/user_2f5cb2d387d84df8b7581bd2ff1f78f0" + }, + "duration": 334 + } +] \ No newline at end of file diff --git a/src/test/cassettes/user/delete.json b/src/test/cassettes/user/delete.json new file mode 100644 index 000000000..1c56d4aee --- /dev/null +++ b/src/test/cassettes/user/delete.json @@ -0,0 +1,260 @@ +[ + { + "recordedAt": 1723823863, + "request": { + "body": "{\n \"user\": {\n \"name\": \"Test User\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/users" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:43Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_12f88240c28447e4ab03d662499a9048\",\n \"api_keys\": [],\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "691" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb33nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76f6e786bd020035c95f" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.582883" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/users" + }, + "duration": 780 + }, + { + "recordedAt": 1723823863, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_12f88240c28447e4ab03d662499a9048" + }, + "response": { + "body": "", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 204 No Content" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76f7e786bd030035ca21" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.052142" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "uri": "https://api.easypost.com/v2/users/user_12f88240c28447e4ab03d662499a9048" + }, + "duration": 256 + }, + { + "recordedAt": 1723823863, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_12f88240c28447e4ab03d662499a9048" + }, + "response": { + "body": "{\n \"error\": {\n \"code\": \"NOT_FOUND\",\n \"message\": \"The requested resource could not be found.\",\n \"errors\": []\n }\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 404 Not Found" + ], + "content-length": [ + "97" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76f7e786bd030035ca3f" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.117425" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 404, + "message": "Not Found" + }, + "uri": "https://api.easypost.com/v2/users/user_12f88240c28447e4ab03d662499a9048" + }, + "duration": 186 + } +] \ No newline at end of file diff --git a/src/test/cassettes/user/get_next_page.json b/src/test/cassettes/user/get_next_page.json new file mode 100644 index 000000000..ca191689e --- /dev/null +++ b/src/test/cassettes/user/get_next_page.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823858, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/children?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "response": { + "body": "{\n \"children\": [\n {\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"test user\",\n \"verified\": true,\n \"created_at\": \"2023-12-07T17:46:08Z\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\",\n \"object\": \"User\"\n }\n ],\n \"has_more\": false\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "245" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76f1e786bcde0035c442" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.187380" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/children?%70%61%67%65%5F%73%69%7A%65\u003d%35" + }, + "duration": 393 + } +] \ No newline at end of file diff --git a/src/test/cassettes/user/retrieve.json b/src/test/cassettes/user/retrieve.json new file mode 100644 index 000000000..fc6b13829 --- /dev/null +++ b/src/test/cassettes/user/retrieve.json @@ -0,0 +1,174 @@ +[ + { + "recordedAt": 1723823860, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users" + }, + "response": { + "body": "{\n \"recharge_amount\": \"100.00\",\n \"verified\": true,\n \"created_at\": \"2022-02-02T20:31:53Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": \"100.00\",\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": \"0.00\",\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [\n {\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"test user\",\n \"verified\": true,\n \"created_at\": \"2023-12-07T17:46:08Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\",\n \"has_elevate_access\": false,\n \"object\": \"User\"\n }\n ],\n \"parent_id\": null,\n \"has_billing_method\": false,\n \"name\": \"EasyPost Java Client Library Tests\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"dev+easypost-java@easypost.com\",\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "887" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb53nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76f4e786bce40035c6ac" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.060609" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users" + }, + "duration": 127 + }, + { + "recordedAt": 1723823860, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_04ad194774a54f6c97d1385715721091" + }, + "response": { + "body": "{\n \"recharge_amount\": \"100.00\",\n \"verified\": true,\n \"created_at\": \"2022-02-02T20:31:53Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": \"100.00\",\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": \"0.00\",\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [\n {\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"test user\",\n \"verified\": true,\n \"created_at\": \"2023-12-07T17:46:08Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\",\n \"has_elevate_access\": false,\n \"object\": \"User\"\n }\n ],\n \"parent_id\": null,\n \"has_billing_method\": false,\n \"name\": \"EasyPost Java Client Library Tests\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"dev+easypost-java@easypost.com\",\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "887" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb41nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43e66bf76f4e786bce50035c6ef" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.117699" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/user_04ad194774a54f6c97d1385715721091" + }, + "duration": 330 + } +] \ No newline at end of file diff --git a/src/test/cassettes/user/retrieve_me.json b/src/test/cassettes/user/retrieve_me.json new file mode 100644 index 000000000..fdc07ad5f --- /dev/null +++ b/src/test/cassettes/user/retrieve_me.json @@ -0,0 +1,88 @@ +[ + { + "recordedAt": 1723823865, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users" + }, + "response": { + "body": "{\n \"recharge_amount\": \"100.00\",\n \"verified\": true,\n \"created_at\": \"2022-02-02T20:31:53Z\",\n \"default_carbon_offset\": false,\n \"secondary_recharge_amount\": \"100.00\",\n \"cc_fee_rate\": \"0.0325\",\n \"has_elevate_access\": false,\n \"recharge_threshold\": \"0.00\",\n \"balance\": \"0.00000\",\n \"default_insurance_amount\": \"50.00\",\n \"children\": [\n {\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"test user\",\n \"verified\": true,\n \"created_at\": \"2023-12-07T17:46:08Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_af930e9bd27a4445bc2741fac37850cc\",\n \"has_elevate_access\": false,\n \"object\": \"User\"\n }\n ],\n \"parent_id\": null,\n \"has_billing_method\": false,\n \"name\": \"EasyPost Java Client Library Tests\",\n \"insurance_fee_rate\": \"0.005\",\n \"price_per_shipment\": \"0.00000\",\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"insurance_fee_minimum\": \"0.50\",\n \"email\": \"dev+easypost-java@easypost.com\",\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "887" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76f9e786bd200035cc65" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.059515" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users" + }, + "duration": 128 + } +] \ No newline at end of file diff --git a/src/test/cassettes/user/update.json b/src/test/cassettes/user/update.json new file mode 100644 index 000000000..cc5f139cb --- /dev/null +++ b/src/test/cassettes/user/update.json @@ -0,0 +1,349 @@ +[ + { + "recordedAt": 1723823864, + "request": { + "body": "{\n \"user\": {\n \"name\": \"Test User\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/users" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:44Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_290a56b0f3a24883b1f6fa7b186b708f\",\n \"api_keys\": [],\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "691" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43a66bf76f8e786bd050035caa4" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.503789" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/users" + }, + "duration": 713 + }, + { + "recordedAt": 1723823865, + "request": { + "body": "{\n \"user\": {\n \"name\": \"New Name\"\n }\n}", + "method": "PUT", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_290a56b0f3a24883b1f6fa7b186b708f" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"New Name\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:44Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_290a56b0f3a24883b1f6fa7b186b708f\",\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "283" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb40nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76f9e786bd070035cb6c" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.146859" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/user_290a56b0f3a24883b1f6fa7b186b708f" + }, + "duration": 351 + }, + { + "recordedAt": 1723823865, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_290a56b0f3a24883b1f6fa7b186b708f" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"New Name\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:44Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_290a56b0f3a24883b1f6fa7b186b708f\",\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "283" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb39nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf76f9e786bd080035cbcc" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.154919" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/user_290a56b0f3a24883b1f6fa7b186b708f" + }, + "duration": 364 + }, + { + "recordedAt": 1723823865, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_290a56b0f3a24883b1f6fa7b186b708f" + }, + "response": { + "body": "", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 204 No Content" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43d66bf76f9e786bd200035cc36" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.050539" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "uri": "https://api.easypost.com/v2/users/user_290a56b0f3a24883b1f6fa7b186b708f" + }, + "duration": 258 + } +] \ No newline at end of file diff --git a/src/test/cassettes/user/update_brand.json b/src/test/cassettes/user/update_brand.json new file mode 100644 index 000000000..a9c41984b --- /dev/null +++ b/src/test/cassettes/user/update_brand.json @@ -0,0 +1,355 @@ +[ + { + "recordedAt": 1723823859, + "request": { + "body": "{\n \"user\": {\n \"name\": \"Test User\"\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/users" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:38Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_2997e23591f8442ca1663dd873882cc6\",\n \"api_keys\": [],\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "691" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76f2e786bce00035c4cd" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.562266" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/users" + }, + "duration": 769 + }, + { + "recordedAt": 1723823859, + "request": { + "body": "{\n \"brand\": {\n \"color\": \"#123456\"\n }\n}", + "method": "PUT", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_2997e23591f8442ca1663dd873882cc6/brand" + }, + "response": { + "body": "{\n \"ad\": null,\n \"background_color\": null,\n \"color\": \"#123456\",\n \"user_id\": \"user_2997e23591f8442ca1663dd873882cc6\",\n \"logo_href\": \"https://www.easypost.com\",\n \"name\": \"EasyPost\",\n \"logo\": \"https://assets.easypost.com/assets/images/branding/easypost-primary-logo.7324aa54b64b34d6cd70ca5ba4d1842d.svg\",\n \"theme\": \"theme1\",\n \"ad_href\": null,\n \"id\": \"brd_39253e61b6854a8c84b58065f6108860\",\n \"object\": \"Brand\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "373" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43f66bf76f3e786bce20035c5bd" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.162316" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/user_2997e23591f8442ca1663dd873882cc6/brand" + }, + "duration": 375 + }, + { + "recordedAt": 1723823859, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_2997e23591f8442ca1663dd873882cc6" + }, + "response": { + "body": "{\n \"children\": [],\n \"parent_id\": \"user_04ad194774a54f6c97d1385715721091\",\n \"name\": \"Test User\",\n \"verified\": true,\n \"created_at\": \"2024-08-16T15:57:38Z\",\n \"default_carbon_offset\": false,\n \"phone_number\": \"REDACTED\",\n \"id\": \"user_2997e23591f8442ca1663dd873882cc6\",\n \"has_elevate_access\": false,\n \"object\": \"User\"\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "284" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf44166bf76f3e786bce30035c61f" + ], + "x-proxied": [ + "intlb4nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.123552" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/users/user_2997e23591f8442ca1663dd873882cc6" + }, + "duration": 326 + }, + { + "recordedAt": 1723823860, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/users/user_2997e23591f8442ca1663dd873882cc6" + }, + "response": { + "body": "", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 204 No Content" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb42nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "8a4bf43b66bf76f4e786bce40035c67a" + ], + "x-proxied": [ + "intlb3nuq c0f5e722d1", + "extlb1nuq b6e1b5034c" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.153857" + ], + "x-version-label": [ + "easypost-202408152333-48cda4a73e-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 204, + "message": "No Content" + }, + "uri": "https://api.easypost.com/v2/users/user_2997e23591f8442ca1663dd873882cc6" + }, + "duration": 355 + } +] \ No newline at end of file diff --git a/src/test/cassettes/webhook/all.json b/src/test/cassettes/webhook/all.json new file mode 100644 index 000000000..6549f7c53 --- /dev/null +++ b/src/test/cassettes/webhook/all.json @@ -0,0 +1,263 @@ +[ + { + "recordedAt": 1740070340, + "request": { + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:20Z\",\n \"id\": \"hook_0cb0f41cefab11ef807963ca33822ef2\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "213" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb59nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f9167b75dc4e2b7e27500432cfc" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.441378" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "duration": 555 + }, + { + "recordedAt": 1740070340, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "response": { + "body": "{\n \"webhooks\": [\n {\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:20Z\",\n \"id\": \"hook_0cb0f41cefab11ef807963ca33822ef2\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "228" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb56nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f9367b75dc4e2b7e29000432d93" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.032402" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "duration": 145 + }, + { + "recordedAt": 1740070341, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_0cb0f41cefab11ef807963ca33822ef2" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f9267b75dc5e2b7e29100432dcb" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.394873" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_0cb0f41cefab11ef807963ca33822ef2" + }, + "duration": 494 + } +] \ No newline at end of file diff --git a/src/test/cassettes/webhook/create.json b/src/test/cassettes/webhook/create.json new file mode 100644 index 000000000..c4b397d25 --- /dev/null +++ b/src/test/cassettes/webhook/create.json @@ -0,0 +1,177 @@ +[ + { + "recordedAt": 1740070316, + "request": { + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:51:56Z\",\n \"id\": \"hook_fe5d2a84efaa11efb84e61dfc018c5b8\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "213" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f8f67b75dace2b7da570043128a" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.427009" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "duration": 534 + }, + { + "recordedAt": 1740070317, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_fe5d2a84efaa11efb84e61dfc018c5b8" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb36nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f8d67b75dace2b7da6f0043130a" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.338361" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_fe5d2a84efaa11efb84e61dfc018c5b8" + }, + "duration": 435 + } +] \ No newline at end of file diff --git a/src/test/cassettes/webhook/delete.json b/src/test/cassettes/webhook/delete.json new file mode 100644 index 000000000..4ce5d1bca --- /dev/null +++ b/src/test/cassettes/webhook/delete.json @@ -0,0 +1,269 @@ +[ + { + "recordedAt": 1740070361, + "request": { + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:41Z\",\n \"id\": \"hook_190c06d4efab11efb7663b222d4bf486\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "213" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb43nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f9267b75dd9e2b7eace0043480b" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.436254" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "duration": 563 + }, + { + "recordedAt": 1740070361, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_190c06d4efab11efb7663b222d4bf486" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:41Z\",\n \"id\": \"hook_190c06d4efab11efb7663b222d4bf486\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "213" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb38nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f9167b75dd9e2b7eacf0043489f" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.025882" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_190c06d4efab11efb7663b222d4bf486" + }, + "duration": 142 + }, + { + "recordedAt": 1740070362, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_190c06d4efab11efb7663b222d4bf486" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb32nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-canary": [ + "direct" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f8e67b75dd9e2b7ead0004348cc" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.354045" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_190c06d4efab11efb7663b222d4bf486" + }, + "duration": 456 + } +] \ No newline at end of file diff --git a/src/test/cassettes/webhook/retrieve.json b/src/test/cassettes/webhook/retrieve.json new file mode 100644 index 000000000..1eca34221 --- /dev/null +++ b/src/test/cassettes/webhook/retrieve.json @@ -0,0 +1,263 @@ +[ + { + "recordedAt": 1740070379, + "request": { + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:59Z\",\n \"id\": \"hook_23c7531cefab11efbe44197603026978\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "213" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f9267b75debe2b7eff800435dd3" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.402787" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "duration": 516 + }, + { + "recordedAt": 1740070379, + "request": { + "body": "", + "method": "GET", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_23c7531cefab11efbe44197603026978" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:59Z\",\n \"id\": \"hook_23c7531cefab11efbe44197603026978\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "213" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb54nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f8c67b75debe2b7eff900435e6e" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.034835" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_23c7531cefab11efbe44197603026978" + }, + "duration": 153 + }, + { + "recordedAt": 1740070380, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_23c7531cefab11efbe44197603026978" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb54nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f8f67b75debe2b7effa00435ea0" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.337242" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_23c7531cefab11efbe44197603026978" + }, + "duration": 438 + } +] \ No newline at end of file diff --git a/src/test/cassettes/webhook/update.json b/src/test/cassettes/webhook/update.json new file mode 100644 index 000000000..a9e8602b5 --- /dev/null +++ b/src/test/cassettes/webhook/update.json @@ -0,0 +1,266 @@ +[ + { + "recordedAt": 1740070397, + "request": { + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", + "method": "POST", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:53:17Z\",\n \"id\": \"hook_2e88ac92efab11ef96cc57dc6c60627e\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "213" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb35nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f8e67b75dfde2b85a2f004372cb" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.384566" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/webhooks" + }, + "duration": 491 + }, + { + "recordedAt": 1740070398, + "request": { + "body": "{\n \"webhook_secret\": \"sécret\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", + "method": "PUT", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ], + "Content-Type": [ + "application/json" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_2e88ac92efab11ef96cc57dc6c60627e" + }, + "response": { + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:53:17Z\",\n \"id\": \"hook_2e88ac92efab11ef96cc57dc6c60627e\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 201 Created" + ], + "content-length": [ + "213" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb57nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f9067b75dfde2b85a3100437361" + ], + "x-proxied": [ + "intlb4nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.743142" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 201, + "message": "Created" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_2e88ac92efab11ef96cc57dc6c60627e" + }, + "duration": 871 + }, + { + "recordedAt": 1740070398, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_2e88ac92efab11ef96cc57dc6c60627e" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb56nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "c6a31f8e67b75dfee2b85a3200437449" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.325343" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502192243-499e5bdec0-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_2e88ac92efab11ef96cc57dc6c60627e" + }, + "duration": 441 + } +] \ No newline at end of file diff --git a/src/test/java/com/easypost/AddressTest.java b/src/test/java/com/easypost/AddressTest.java new file mode 100644 index 000000000..1aa8ba8a0 --- /dev/null +++ b/src/test/java/com/easypost/AddressTest.java @@ -0,0 +1,350 @@ +package com.easypost; + +import com.easypost.exception.API.InvalidRequestError; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.model.Address; +import com.easypost.model.AddressCollection; +import com.easypost.model.AddressDetail; +import com.easypost.model.AddressVerificationFieldError; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class AddressTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("address", TestUtils.ApiKey.TEST); + } + + /** + * Create a basic address. + * + * @return basic Address object + * @throws EasyPostException if an exception is thrown. + */ + public Address createBasicAddress() throws EasyPostException { + return vcr.client.address.create(Fixtures.caAddress1()); + } + + /** + * Test creating an address. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Address address = createBasicAddress(); + + assertInstanceOf(Address.class, address); + assertTrue(address.getId().startsWith("adr_")); + assertEquals("Address", address.getObject()); + assertEquals("388 Townsend St", address.getStreet1()); + } + + /** + * Test creating an address with the verify param. + * We purposefully pass in slightly incorrect data to get the corrected address + * back once verified. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateVerify() throws EasyPostException { + vcr.setUpTest("create_verify"); + + Map addressData = Fixtures.incorrectAddress(); + + // Creating normally (without specifying "verify") will make the address, perform no verifications + Address address = vcr.client.address.create(addressData); + + assertInstanceOf(Address.class, address); + assertNull(address.getVerifications().getDelivery()); + assertNull(address.getVerifications().getZip4()); + + // Creating with verify would make the address and perform verifications + // internally, we're just checking for the presence of "verify" in the dictionary, so the value doesn't matter + addressData.put("verify", true); + address = vcr.client.address.create(addressData); + + assertInstanceOf(Address.class, address); + + assertEquals(false, address.getVerifications().getDelivery().getSuccess()); + assertInstanceOf(AddressDetail.class, address.getVerifications().getDelivery().getDetails()); + AddressVerificationFieldError addressVerificationFieldErrorGetDelivery = address.getVerifications() + .getDelivery() + .getErrors() + .get(0); + assertEquals("E.ADDRESS.NOT_FOUND", addressVerificationFieldErrorGetDelivery.getCode()); + assertEquals("address", addressVerificationFieldErrorGetDelivery.getField()); + assertNull(addressVerificationFieldErrorGetDelivery.getSuggestion()); + assertEquals("Address not found", addressVerificationFieldErrorGetDelivery.getMessage()); + + assertEquals(false, address.getVerifications().getZip4().getSuccess()); + assertNull(address.getVerifications().getZip4().getDetails()); + AddressVerificationFieldError addressVerificationFieldErrorZip4 = address.getVerifications() + .getZip4() + .getErrors() + .get(0); + assertEquals("E.ADDRESS.NOT_FOUND", addressVerificationFieldErrorZip4.getCode()); + assertEquals("address", addressVerificationFieldErrorZip4.getField()); + assertNull(addressVerificationFieldErrorZip4.getSuggestion()); + assertEquals("Address not found", addressVerificationFieldErrorZip4.getMessage()); + } + + /** + * Test creating an address with the verify_strict param. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateVerifyStrict() throws EasyPostException { + vcr.setUpTest("create_verify_strict"); + + Map addressData = Fixtures.caAddress1(); + addressData.put("verify_strict", true); + + Address address = vcr.client.address.create(addressData); + + assertInstanceOf(Address.class, address); + assertTrue(address.getId().startsWith("adr_")); + assertEquals("388 TOWNSEND ST APT 20", address.getStreet1()); + } + + /** + * Test creating an address with the verify param. + * We purposefully pass in slightly incorrect data to get the corrected address + * back once verified. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateVerifyArray() throws EasyPostException { + vcr.setUpTest("create_verify_array"); + + Map addressData = Fixtures.incorrectAddress(); + + // Creating normally (without specifying "verify") will make the address, perform no verifications + Address address = vcr.client.address.create(addressData); + + assertInstanceOf(Address.class, address); + assertNull(address.getVerifications().getDelivery()); + assertNull(address.getVerifications().getZip4()); + + // Creating with verify would make the address and perform verifications + // internally, we're just checking for the presence of "verify" in the dictionary, so the value doesn't matter + List verificationList = new ArrayList<>(); + verificationList.add(true); + addressData.put("verify", verificationList); + + address = vcr.client.address.create(addressData); + + assertInstanceOf(Address.class, address); + assertNotNull(address.getVerifications().getDelivery()); + assertNotNull(address.getVerifications().getZip4()); + } + + /** + * Test retrieving an address. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Address address = createBasicAddress(); + Address retrievedAddress = vcr.client.address.retrieve(address.getId()); + + assertInstanceOf(Address.class, retrievedAddress); + assertTrue(address.equals(retrievedAddress)); + } + + /** + * Test retrieving all addresses. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + AddressCollection addresses = vcr.client.address.all(params); + + List

addressesList = addresses.getAddresses(); + + assertTrue(addressesList.size() <= Fixtures.pageSize()); + assertNotNull(addresses.getHasMore()); + assertTrue(addressesList.stream().allMatch(address -> address != null)); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + AddressCollection collection = vcr.client.address.all(params); + + try { + AddressCollection nextPage = vcr.client.address.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getAddresses().get(0).getId(); + String firstIdOfSecondPage = nextPage.getAddresses().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Test creating a verified address. + * We purposefully pass in slightly incorrect data to get the corrected address + * back once verified. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateAndVerify() throws EasyPostException { + vcr.setUpTest("create_and_verify"); + + Map addressData = Fixtures.caAddress1(); + + Address address = vcr.client.address.createAndVerify(addressData); + + assertInstanceOf(Address.class, address); + assertTrue(address.getId().startsWith("adr_")); + assertEquals("388 TOWNSEND ST APT 20", address.getStreet1()); + } + + /** + * Test verifying an existing address. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testVerify() throws EasyPostException { + vcr.setUpTest("verify"); + + Address address = createBasicAddress(); + + Address verifiedAddress = vcr.client.address.verify(address.getId()); + + assertInstanceOf(Address.class, verifiedAddress); + assertTrue(verifiedAddress.getId().startsWith("adr_")); + assertEquals("388 TOWNSEND ST APT 20", verifiedAddress.getStreet1()); + } + + /** + * Test creating invalid address creation to see if the error has correct properties. + * + * @throws EasyPostException if an exception is thrown. + */ + @Test + public void testInvalidAddressCreation() throws EasyPostException { + vcr.setUpTest("error_address_creation"); + Map params = new HashMap<>(); + InvalidRequestError exception = + assertThrows(InvalidRequestError.class, () -> vcr.client.address.createAndVerify(params)); + + assertEquals("PARAMETER.REQUIRED", exception.getCode()); + assertEquals(422, exception.getStatusCode()); + assertEquals("Missing required parameter.", exception.getMessage()); + } + + /** + * Test creating an address with the verify_carrier param. + * We purposefully pass in slightly incorrect data to get the corrected address + * back once verified. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateVerifyCarrier() throws EasyPostException { + vcr.setUpTest("create_verify_carrier"); + + Map addressData = Fixtures.incorrectAddress(); + + addressData.put("verify", true); + addressData.put("verify_carrier", "UPS"); + Address address = vcr.client.address.create(addressData); + + assertInstanceOf(Address.class, address); + + AddressVerificationFieldError addressVerificationFieldErrorGetDelivery = address.getVerifications() + .getDelivery() + .getErrors() + .get(0); + AddressVerificationFieldError addressVerificationFieldErrorZip4 = address.getVerifications() + .getZip4() + .getErrors() + .get(0); + assertEquals("Address not found", addressVerificationFieldErrorGetDelivery.getMessage()); + assertEquals("Address not found", addressVerificationFieldErrorZip4.getMessage()); + } + + /** + * Test creating and verifying an address with the verify_carrier param. + * We purposefully pass in slightly incorrect data to get the corrected address + * back once verified. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateAndVerifyCarrier() throws EasyPostException { + vcr.setUpTest("create_and_verify_carrier"); + + Map addressData = Fixtures.incorrectAddress(); + + addressData.put("verify_carrier", "UPS"); + Address address = vcr.client.address.createAndVerify(addressData); + + assertInstanceOf(Address.class, address); + + AddressVerificationFieldError addressVerificationFieldErrorGetDelivery = address.getVerifications() + .getDelivery() + .getErrors() + .get(0); + AddressVerificationFieldError addressVerificationFieldErrorZip4 = address.getVerifications() + .getZip4() + .getErrors() + .get(0); + assertEquals("Address not found", addressVerificationFieldErrorGetDelivery.getMessage()); + assertEquals("Address not found", addressVerificationFieldErrorZip4.getMessage()); + } +} diff --git a/src/test/java/com/easypost/ApiKeyTest.java b/src/test/java/com/easypost/ApiKeyTest.java new file mode 100644 index 000000000..06748cfe7 --- /dev/null +++ b/src/test/java/com/easypost/ApiKeyTest.java @@ -0,0 +1,130 @@ +package com.easypost; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.FilteringError; +import com.easypost.model.ApiKey; +import com.easypost.model.ApiKeys; +import com.easypost.model.User; + +public final class ApiKeyTest { + private static String testUserId = null; + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setUp() throws EasyPostException { + vcr = new TestUtils.VCR("api_key", TestUtils.ApiKey.PRODUCTION); + } + + /** + * Clean up test attributes after each unit test. + */ + @AfterEach + public void cleanup() { + if (testUserId != null) { + try { + User user = vcr.client.user.retrieve(testUserId); + vcr.client.user.delete(user.getId()); + testUserId = null; + } catch (Exception e) { + // in case we try to delete something that's already been deleted + } + } + } + + /** + * Create a user. + * + * @return User object + */ + private static User createUser() throws EasyPostException { + Map params = new HashMap<>(); + params.put("name", "Test User"); + User user = vcr.client.user.create(params); + testUserId = user.getId(); // trigger deletion after test + return user; + } + + /** + * Test retrieving all API keys for a user. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testApiKeys() throws EasyPostException { + vcr.setUpTest("api_keys"); + + User user = createUser(); + + List apiKeys = vcr.client.apiKey.retrieveApiKeysForUser(user.getId()); + + assertNotNull(apiKeys); + + assertThrows(FilteringError.class, () -> vcr.client.apiKey.retrieveApiKeysForUser("invalid_id")); + } + + /** + * Test retrieving all API keys. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAllApiKeys() throws EasyPostException { + vcr.setUpTest("all_api_keys"); + + ApiKeys apikeys = vcr.client.apiKey.all(); + + assertInstanceOf(ApiKeys.class, apikeys); + + List apiKeys = vcr.client.apiKey.retrieveApiKeysForUser(apikeys.getId()); + + assertNotNull(apiKeys); + } + + /** + * Test creating an API key for a child user. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testApiKeyLifecycle() throws EasyPostException { + vcr.setUpTest("lifecycle"); + + // Create an API key + TestUtils.VCR referralVcr = new TestUtils.VCR("api_key", TestUtils.ApiKey.REFERRAL); + ApiKey apiKey = referralVcr.client.apiKey.create("production"); + assertInstanceOf(ApiKey.class, apiKey); + assertTrue(apiKey.getId().startsWith("ak_")); + assertEquals("production", apiKey.getMode()); + + // Disable the API key + apiKey = referralVcr.client.apiKey.disable(apiKey.getId()); + assertFalse(apiKey.getActive()); + + // Enable the API key + apiKey = referralVcr.client.apiKey.enable(apiKey.getId()); + assertTrue(apiKey.getActive()); + + // Delete the API key + referralVcr.client.apiKey.delete(apiKey.getId()); + } +} diff --git a/src/test/java/com/easypost/BatchTest.java b/src/test/java/com/easypost/BatchTest.java new file mode 100644 index 000000000..5c51f4051 --- /dev/null +++ b/src/test/java/com/easypost/BatchTest.java @@ -0,0 +1,230 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.Batch; +import com.easypost.model.BatchCollection; +import com.easypost.model.Shipment; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class BatchTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("batch", TestUtils.ApiKey.TEST); + } + + /** + * Test creating a Batch. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Batch batch = createBasicBatch(); + + assertInstanceOf(Batch.class, batch); + assertTrue(batch.getId().startsWith("batch_")); + assertNotNull(batch.getShipments()); + } + + /** + * Create a batch. + * + * @return Batch object. + */ + private static Batch createBasicBatch() throws EasyPostException { + Map params = new HashMap<>(); + + List shipments = new ArrayList<>(); + shipments.add(Fixtures.basicShipment()); + params.put("shipments", shipments); + + return vcr.client.batch.create(params); + } + + /** + * Test retrieving a Batch. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Batch batch = createBasicBatch(); + + Batch retrievedBatch = vcr.client.batch.retrieve(batch.getId()); + + assertInstanceOf(Batch.class, batch); + // Must compare IDs since elements of batch (i.e. status) may be different + assertEquals(batch.getId(), retrievedBatch.getId()); + } + + /** + * Test retrieving all batches. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + BatchCollection batches = vcr.client.batch.all(params); + + List batchesList = batches.getBatches(); + + assertTrue(batchesList.size() <= Fixtures.pageSize()); + assertNotNull(batches.getHasMore()); + assertTrue(batchesList.stream().allMatch(batch -> batch != null)); + } + + /** + * Test buying a batch. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuy() throws EasyPostException { + vcr.setUpTest("buy"); + + Batch batch = createOneCallBuyBatch(); + + batch = vcr.client.batch.buy(batch.getId()); + + assertInstanceOf(Batch.class, batch); + assertEquals(1, batch.getNumShipments().intValue()); + } + + private static Batch createOneCallBuyBatch() throws EasyPostException { + Map params = new HashMap<>(); + + List shipments = new ArrayList<>(); + shipments.add(Fixtures.oneCallBuyShipment()); + params.put("shipments", shipments); + + return vcr.client.batch.create(params); + } + + /** + * Test creating a scanform for a batch. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateScanForm() throws EasyPostException, InterruptedException { + vcr.setUpTest("create_scanform"); + + Batch batch = createOneCallBuyBatch(); + batch = vcr.client.batch.buy(batch.getId()); + + if (vcr.isRecording()) { + Thread.sleep(10000); // Wait enough time for processing + } + + Batch batchWithScanForm = vcr.client.batch.createScanForm(batch.getId()); + + // We can't assert anything meaningful here + // because the scanform gets queued for generation and may not be immediately available + assertInstanceOf(Batch.class, batchWithScanForm); + } + + /** + * Test adding and removing a shipment from a batch with map. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAddRemoveShipmentWithMap() throws EasyPostException { + vcr.setUpTest("add_remove_shipment_with_map"); + + Shipment shipment = vcr.client.shipment.create(Fixtures.oneCallBuyShipment()); + + Batch batch = vcr.client.batch.create(); + + List shipmentData = new ArrayList<>(); + Map params = new HashMap<>(); + + shipmentData.add(shipment); + params.put("shipments", shipmentData); + + Batch batchWithAddedShipment = vcr.client.batch.addShipments(batch.getId(), params); + + assertEquals(1, batchWithAddedShipment.getNumShipments().intValue()); + + Batch batchWithoutShipment = vcr.client.batch.removeShipments(batch.getId(), params); + + assertEquals(0, batchWithoutShipment.getNumShipments().intValue()); + } + + /** + * Test adding and removing a shipment from a batch with list. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAddRemoveShipmentWithList() throws EasyPostException { + vcr.setUpTest("add_remove_shipment_with_list"); + + Shipment shipment = vcr.client.shipment.create(Fixtures.oneCallBuyShipment()); + Batch batch = vcr.client.batch.create(); + List shipmentData = Arrays.asList(shipment); + + Batch batchWithAddedShipment = vcr.client.batch.addShipments(batch.getId(), shipmentData); + + assertEquals(1, batchWithAddedShipment.getNumShipments().intValue()); + + Batch batchWithoutShipment = vcr.client.batch.removeShipments(batch.getId(), shipmentData); + + assertEquals(0, batchWithoutShipment.getNumShipments().intValue()); + } + + /** + * Test generating a label for a Batch. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testLabel() throws EasyPostException, InterruptedException { + vcr.setUpTest("label"); + + Batch batch = createOneCallBuyBatch(); + + batch = vcr.client.batch.buy(batch.getId()); + + if (vcr.isRecording()) { + Thread.sleep(10000); // Wait enough time for processing + } + + Map params = new HashMap<>(); + params.put("file_format", "ZPL"); + + Batch batchWithLabel = vcr.client.batch.label(batch.getId(), params); + + // We can't assert anything meaningful here + // because the label gets queued for generation and may not be immediately available + assertInstanceOf(Batch.class, batchWithLabel); + } +} diff --git a/src/test/java/com/easypost/BetaRateTest.java b/src/test/java/com/easypost/BetaRateTest.java new file mode 100644 index 000000000..ddaf651ec --- /dev/null +++ b/src/test/java/com/easypost/BetaRateTest.java @@ -0,0 +1,72 @@ +package com.easypost; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.StatelessRate; +import com.easypost.utils.Utilities; + +public class BetaRateTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("beta_stateless_rate", TestUtils.ApiKey.TEST); + } + + /** + * Test retrieving stateless rates. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveStatelessRates() throws EasyPostException { + vcr.setUpTest("retrieve_stateless_rates"); + + HashMap shipment = Fixtures.basicShipment(); + + List rates = vcr.client.betaRate.retrieveStatelessRates(shipment); + + // Test that deserialization worked by accessing a field with an underscore + for (StatelessRate rate : rates) { + assertTrue(rate.getListRate() != null); + } + } + + /** + * Test retrieving the lowest rate of stateless rate. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveLowestStatelessRate() throws EasyPostException { + vcr.setUpTest("retrieve_lowest_stateless_rate"); + + HashMap shipment = Fixtures.basicShipment(); + + List rates = vcr.client.betaRate.retrieveStatelessRates(shipment); + StatelessRate lowestRate = Utilities.getLowestStatelessRate(rates, null, null); + + assertEquals("GroundAdvantage", lowestRate.getService()); + + List carriers = Arrays.asList("invalidCarrierName"); + EasyPostException exception = assertThrows(EasyPostException.class, + () -> Utilities.getLowestStatelessRate(rates, carriers, null)); + + assertEquals("No rates found.", exception.getMessage()); + } +} diff --git a/src/test/java/com/easypost/BetaReferralCustomerTest.java b/src/test/java/com/easypost/BetaReferralCustomerTest.java new file mode 100644 index 000000000..c47784f95 --- /dev/null +++ b/src/test/java/com/easypost/BetaReferralCustomerTest.java @@ -0,0 +1,102 @@ +package com.easypost; + +import com.easypost.exception.API.InvalidRequestError; +import com.easypost.exception.EasyPostException; +import com.easypost.model.ClientSecret; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class BetaReferralCustomerTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("beta_referral_customer", TestUtils.ApiKey.REFERRAL); + } + + /** + * Test add Stripe payment method for referral customer. + * + * @throws EasyPostException When the request fails. + */ + @Test + public void testAddPaymentMethod() throws EasyPostException { + vcr.setUpTest("add_payment_method"); + InvalidRequestError exception = assertThrows(InvalidRequestError.class, + () -> vcr.client.betaReferralCustomer.addPaymentMethod("cus_123", "ba_123")); + + assertEquals("BILLING.INVALID_PAYMENT_GATEWAY_REFERENCE", exception.getCode()); + assertEquals(422, exception.getStatusCode()); + assertEquals("Invalid connect integration.", exception.getMessage()); + } + + /** + * Test refund by amount for a previous payment. + * + * @throws EasyPostException if an exception is thrown. + */ + @Test + public void testRefundByAmount() throws EasyPostException { + vcr.setUpTest("refund_by_amount"); + InvalidRequestError exception = + assertThrows(InvalidRequestError.class, () -> vcr.client.betaReferralCustomer.refundByAmount(2000)); + + assertEquals("TRANSACTION.AMOUNT_INVALID", exception.getCode()); + assertEquals(422, exception.getStatusCode()); + assertEquals("Refund amount is invalid. Please use a valid amount or escalate to finance.", + exception.getMessage()); + } + + /** + * Test refund by payment log for a previous payment. + * + * @throws EasyPostException if an exception is thrown. + */ + @Test + public void testRefundByPaymentLogId() throws EasyPostException { + vcr.setUpTest("refund_by_payment_log_id"); + InvalidRequestError exception = assertThrows(InvalidRequestError.class, + () -> vcr.client.betaReferralCustomer.refundByPaymentLog("paylog_123")); + + assertEquals("TRANSACTION.DOES_NOT_EXIST", exception.getCode()); + assertEquals(422, exception.getStatusCode()); + assertEquals("We could not find a transaction with that id.", exception.getMessage()); + } + + /** + * Test creating a client secret for credit cards. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateCreditCardClientSecret() throws EasyPostException { + vcr.setUpTest("create_credit_card_client_secret"); + + ClientSecret response = vcr.client.betaReferralCustomer.createCreditCardClientSecret(); + + assertTrue(response.getClientSecret().startsWith("seti_")); + } + + /** + * Test creating a client secret for bank accounts. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateBankAccountClientSecret() throws EasyPostException { + vcr.setUpTest("create_bank_account_client_secret"); + + ClientSecret response = vcr.client.betaReferralCustomer.createBankAccountClientSecret(); + + assertTrue(response.getClientSecret().startsWith("fcsess_client_secret_")); + } +} diff --git a/src/test/java/com/easypost/BillingTest.java b/src/test/java/com/easypost/BillingTest.java new file mode 100644 index 000000000..40ff321dc --- /dev/null +++ b/src/test/java/com/easypost/BillingTest.java @@ -0,0 +1,132 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.PaymentMethod; +import com.easypost.model.PaymentMethodObject; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class BillingTest { + private static TestUtils.VCR vcr; + private String jsonResponse = "{\"id\":\"cust_...\",\"object\":\"PaymentMethods\",\"primary_" + + "payment_method\":{\"id\":\"pm_...\",\"disabled_at\":null,\"object\":\"CreditCard\",\"na" + + "me\":null,\"last4\":\"4242\",\"exp_month\":1,\"exp_year\":2025,\"brand\":\"Visa\"},\"secondar" + + "y_payment_method\":{\"id\":\"pm_...\",\"disabled_at\":null,\"object\":\"BankAccount\",\"name\":nu" + + "ll,\"last4\":\"4444\",\"exp_month\":1,\"exp_year\":2025,\"brand\":\"Mastercard\"}}"; + private PaymentMethod paymentMethod = Constants.Http.GSON.fromJson(jsonResponse, PaymentMethod.class); + + private static MockedStatic requestMock = Mockito.mockStatic(Requestor.class); + + /** + * Setup the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("billing", TestUtils.ApiKey.PRODUCTION); + } + + /** + * Release the static mock once it has been used. + */ + @AfterAll + public static void cleanup() { + requestMock.close(); + } + + /** + * Test deleting a payment method. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testDeletePaymentMethod() throws EasyPostException { + requestMock.when(() -> Requestor.request( + RequestMethod.GET, "payment_methods", null, PaymentMethod.class, vcr.client)) + .thenReturn(paymentMethod); + + PaymentMethodObject paymentMethodObject = + vcr.client.billing.retrievePaymentMethods().getSecondaryPaymentMethod(); + + requestMock.when(() -> Requestor.request(RequestMethod.GET, + paymentMethodObject.getEndpoint() + "/" + paymentMethodObject.getId(), + null, PaymentMethod.class, + vcr.client)).thenReturn(null); + + assertDoesNotThrow(() -> vcr.client.billing.deletePaymentMethod(PaymentMethod.Priority.SECONDARY)); + } + + /** + * Test funding a wallet. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testFundWallet() throws EasyPostException { + requestMock.when(() -> Requestor.request( + RequestMethod.GET, "payment_methods", null, PaymentMethod.class, vcr.client)) + .thenReturn(paymentMethod); + + PaymentMethodObject paymentMethodObject = vcr.client.billing.retrievePaymentMethods().getPrimaryPaymentMethod(); + + requestMock.when(() -> Requestor.request(RequestMethod.GET, + paymentMethodObject.getEndpoint() + "/" + paymentMethodObject.getId() + "/charges", null, + PaymentMethod.class, vcr.client)).thenReturn(paymentMethod); + + assertDoesNotThrow(() -> vcr.client.billing.fundWallet("2000")); + } + + /** + * Test retrieving all payment methods. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrievePaymentMethods() throws EasyPostException { + requestMock.when(() -> Requestor.request( + RequestMethod.GET, "payment_methods", null, PaymentMethod.class, vcr.client)) + .thenReturn(paymentMethod); + + PaymentMethod paymentMethods = vcr.client.billing.retrievePaymentMethods(); + + assertNotNull(paymentMethods.getPrimaryPaymentMethod()); + assertNotNull(paymentMethods.getSecondaryPaymentMethod()); + } + + /** + * Test determining a payment method type by its object type. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testDeterminePaymentMethodTypeByObjectType() throws EasyPostException { + requestMock.when(() -> Requestor.request( + RequestMethod.GET, "payment_methods", null, PaymentMethod.class, vcr.client)) + .thenReturn(paymentMethod); + + // Should be a credit card with "CreditCard" object type and "pm_" prefix + PaymentMethodObject creditCard = + vcr.client.billing.retrievePaymentMethods().getPrimaryPaymentMethod(); + assertTrue(creditCard.getId().startsWith("pm_")); + assertEquals("CreditCard", creditCard.getObject()); + assertEquals(PaymentMethodObject.PaymentMethodType.CREDIT_CARD, creditCard.getType()); + + // Should be a bank account with "BankAccount" object type and "pm_" prefix + PaymentMethodObject bankAccount = + vcr.client.billing.retrievePaymentMethods().getSecondaryPaymentMethod(); + assertTrue(bankAccount.getId().startsWith("pm_")); + assertEquals("BankAccount", bankAccount.getObject()); + assertEquals(PaymentMethodObject.PaymentMethodType.BANK_ACCOUNT, bankAccount.getType()); + } +} diff --git a/src/test/java/com/easypost/CarrierAccountTest.java b/src/test/java/com/easypost/CarrierAccountTest.java new file mode 100644 index 000000000..18b672912 --- /dev/null +++ b/src/test/java/com/easypost/CarrierAccountTest.java @@ -0,0 +1,312 @@ +package com.easypost; + +import com.easypost.exception.API.InvalidRequestError; +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.model.CarrierAccount; +import com.easypost.model.CarrierType; +import com.easypost.model.FieldError; +import com.easypost.model.Pickup; +import com.easypost.model.Shipment; +import com.google.common.collect.ImmutableMap; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class CarrierAccountTest { + private static String testCarrierAccountId = null; + + private static TestUtils.VCR vcr; + + private static CarrierAccount createBasicCarrierAccount() throws EasyPostException { + CarrierAccount carrierAccount = vcr.client.carrierAccount.create(Fixtures.basicCarrierAccount()); + testCarrierAccountId = carrierAccount.getId(); // trigger deletion after test + return carrierAccount; + } + + private static CarrierAccount createUpsCarrierAccount() throws EasyPostException { + Map data = new HashMap<>(); + data.put("type", "UpsAccount"); + data.put("account_number", "123456789"); + + CarrierAccount carrierAccount = vcr.client.carrierAccount.create(data); + testCarrierAccountId = carrierAccount.getId(); // trigger deletion after test + return carrierAccount; + } + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("carrier_account", TestUtils.ApiKey.PRODUCTION); + } + + /** + * Clean up test attributes after each unit test. + */ + @AfterEach + public void cleanup() { + if (testCarrierAccountId != null) { + try { + CarrierAccount carrierAccount = vcr.client.carrierAccount.retrieve(testCarrierAccountId); + vcr.client.carrierAccount.delete(carrierAccount.getId()); + testCarrierAccountId = null; + } catch (Exception e) { + // in case we try to delete something that's already been deleted + } + } + } + + /** + * Test creating a carrier account. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + CarrierAccount carrierAccount = createBasicCarrierAccount(); + + assertInstanceOf(CarrierAccount.class, carrierAccount); + assertTrue(carrierAccount.getId().startsWith("ca_")); + assertEquals("DhlEcsAccount", carrierAccount.getType()); + } + + /** + * Test creating a carrier account with a custom workflow. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateWithCustomWorkflow() throws EasyPostException { + vcr.setUpTest("create_with_custom_workflow"); + + Map data = new HashMap<>(); + data.put("type", "FedexAccount"); + data.put("registration_data", ImmutableMap.of("some", "data")); + + try { + CarrierAccount carrierAccount = vcr.client.carrierAccount.create(data); + testCarrierAccountId = carrierAccount.getId(); // clean up after test, should never get here + } catch (InvalidRequestError e) { + // We're sending bad data to the API, so we expect an error + assertEquals(422, e.getStatusCode()); + // We expect one of the sub-errors to be regarding a missing field + FieldError fieldError = (FieldError) e.getErrors().get(0); + assertEquals("shipping_streets", fieldError.getField()); + assertEquals("must be present and a string", fieldError.getMessage()); + } + } + + + /** + * Test creating a UPS carrier account. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateWithUPS() throws EasyPostException { + vcr.setUpTest("create_with_ups"); + + CarrierAccount carrierAccount = createUpsCarrierAccount(); + + assertInstanceOf(CarrierAccount.class, carrierAccount); + assertTrue(carrierAccount.getId().startsWith("ca_")); + assertEquals("UpsAccount", carrierAccount.getType()); + } + + /** + * Test creating an Amazon carrier account. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateWithAmazon() throws EasyPostException { + vcr.setUpTest("create_with_amazon"); + + Map data = new HashMap<>(); + data.put("type", "AmazonShippingAccount"); + + CarrierAccount carrierAccount = vcr.client.carrierAccount.create(data); + testCarrierAccountId = carrierAccount.getId(); // trigger deletion after test + + assertInstanceOf(CarrierAccount.class, carrierAccount); + assertTrue(carrierAccount.getId().startsWith("ca_")); + assertEquals("AmazonShippingAccount", carrierAccount.getType()); + } + + /** + * Test retrieving a carrier account. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + CarrierAccount carrierAccount = createBasicCarrierAccount(); + + CarrierAccount retrieveCarrierAccount = vcr.client.carrierAccount.retrieve(carrierAccount.getId()); + + assertInstanceOf(CarrierAccount.class, retrieveCarrierAccount); + assertTrue(retrieveCarrierAccount.getId().startsWith("ca_")); + assertTrue(carrierAccount.equals(retrieveCarrierAccount)); + } + + /** + * Test retrieving all carrier accounts. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + List carrierAccounts = vcr.client.carrierAccount.all(); + + assertTrue(carrierAccounts.stream().allMatch(carrier -> carrier != null)); + } + + /** + * Test updating a carrier account. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testUpdate() throws EasyPostException { + vcr.setUpTest("update"); + + CarrierAccount carrierAccount = createBasicCarrierAccount(); + + String testDescription = "My custom description"; + + Map updateParams = new HashMap<>(); + updateParams.put("description", testDescription); + + CarrierAccount updatedCarrierAccount = vcr.client.carrierAccount.update(carrierAccount.getId(), updateParams); + + assertInstanceOf(CarrierAccount.class, carrierAccount); + assertTrue(updatedCarrierAccount.getId().startsWith("ca_")); + assertEquals(testDescription, updatedCarrierAccount.getDescription()); + } + + /** + * Test updating an UPS account. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testUpdateUpsAccount() throws EasyPostException { + vcr.setUpTest("update_ups"); + + CarrierAccount carrierAccount = createUpsCarrierAccount(); + Map updateParams = new HashMap<>(); + updateParams.put("account_number", "987654321"); + + CarrierAccount updatedCarrierAccount = vcr.client.carrierAccount.update(carrierAccount.getId(), updateParams); + + assertInstanceOf(CarrierAccount.class, updatedCarrierAccount); + assertTrue(updatedCarrierAccount.getId().startsWith("ca_")); + assertEquals("UpsAccount", updatedCarrierAccount.getType()); + } + + /** + * Test deleting a carrier account. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testDelete() throws EasyPostException { + vcr.setUpTest("delete"); + + CarrierAccount carrierAccount = createBasicCarrierAccount(); + + assertDoesNotThrow(() -> vcr.client.carrierAccount.delete(carrierAccount.getId())); + } + + /** + * Test retrieving the carrier account types available. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testTypes() throws EasyPostException { + vcr.setUpTest("types"); + + List types = vcr.client.carrierType.all(); + + assertInstanceOf(List.class, types); + assertTrue(types.stream().allMatch(type -> type != null)); + } + + /** + * Test that the CarrierAccount fields are correctly deserialized from the API response. + * None of the demo carrier accounts used in the above tests have credentials or test credentials fields, + * so we need to use some mock data. + */ + @Test + public void testCarrierFieldsJsonDeserialization() { + String carrierAccountJson = "[{\"id\":\"ca_123\",\"object\":\"CarrierAccount\"," + + "\"fields\":{\"credentials\":{\"account_number\":{\"visibility\":\"visible\"," + + "\"label\":\"DHL Account Number\",\"value\":\"123456\"},\"country\":{\"visibility\":\"visible\"," + + "\"label\":\"Account Country Code (2 Letter)\",\"value\":\"US\"},\"site_id\":{\"visibility\":" + + "\"visible\",\"label\":\"Site ID (Optional)\",\"value\": null },\"password\":{\"visibility\":" + + "\"password\",\"label\":\"Password (Optional)\",\"value\":\"\"},\"is_reseller\":{\"visibility\":" + + "\"checkbox\",\"label\":\"Reseller Account? (check if yes)\",\"value\":null}}}}]"; + CarrierAccount[] carrierAccounts = Constants.Http.GSON.fromJson(carrierAccountJson, CarrierAccount[].class); + + CarrierAccount carrierAccount = carrierAccounts[0]; + assertEquals("ca_123", carrierAccount.getId()); + assertEquals("CarrierAccount", carrierAccount.getObject()); + assertEquals("DHL Account Number", + carrierAccount.getFields().getCredentials().get("account_number").getLabel()); + } + + /** + * Test that the CarrierAccount fields are correctly serialized to the API request. + */ + @Test + public void testCarrierFieldsJsonSerialization() { + MockedStatic requestMock = Mockito.mockStatic(Requestor.class); + + String carrierAccountJson = "[{\"id\":\"ca_123\",\"object\":\"CarrierAccount\",\"fields\":{\"credentials\":" + + "{\"account_number\":{\"visibility\":\"visible\",\"label\":\"DHL Account Number\"," + + "\"value\":\"123456\"},\"country\":{\"visibility\":\"visible\",\"label\":" + + "\"Account Country Code (2 Letter)\",\"value\":\"US\"},\"site_id\":{\"visibility\":\"visible\"," + + "\"label\":\"Site ID (Optional)\",\"value\": null },\"password\":{\"visibility\":\"password\"," + + "\"label\":\"Password (Optional)\",\"value\":\"\"},\"is_reseller\":{\"visibility\":\"checkbox\"," + + "\"label\":\"Reseller Account? (check if yes)\",\"value\":null}}}}]"; + CarrierAccount[] carrierAccounts = Constants.Http.GSON.fromJson(carrierAccountJson, CarrierAccount[].class); + CarrierAccount carrierAccount = carrierAccounts[0]; + + // Prepare a parameter set for creating a pickup, using the carrier account object + Map pickupData = Fixtures.basicPickup(); + pickupData.put("shipment", new Shipment()); + pickupData.put("carrier_accounts", new CarrierAccount[] { carrierAccount }); + + // Avoid making a real request to the API, interested in pre-request serialization, not interested in response + requestMock.when(() -> Requestor.request(Requestor.RequestMethod.POST, "pickups", pickupData, Shipment.class, + vcr.client)).thenReturn(new Pickup()); + + // This will throw an exception if the carrier account fields could not be serialized properly + assertDoesNotThrow(() -> vcr.client.pickup.create(pickupData)); + + // Close mock + requestMock.close(); + } +} diff --git a/src/test/java/com/easypost/CarrierMetadataTest.java b/src/test/java/com/easypost/CarrierMetadataTest.java new file mode 100644 index 000000000..e1ce57442 --- /dev/null +++ b/src/test/java/com/easypost/CarrierMetadataTest.java @@ -0,0 +1,63 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.CarrierMetadata; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class CarrierMetadataTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("carrier_metadata", TestUtils.ApiKey.TEST); + } + + /** + * Test retrieving all carrier metadata. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveCarrierMetadata() throws EasyPostException { + vcr.setUpTest("retrieve_carrier_metadata"); + + CarrierMetadata carrierMetadata = vcr.client.carrierMetadata.retrieve(); + + assertTrue(carrierMetadata.getCarriers().stream().anyMatch(carrier -> carrier.getName().equals("usps"))); + assertTrue(carrierMetadata.getCarriers().stream().anyMatch(carrier -> carrier.getName().equals("fedex"))); + } + + /** + * Test retrieving carrier metadata for a specific carrier. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveCarrierMetadataWithFilter() throws EasyPostException { + vcr.setUpTest("retrieve_carrier_metadata_with_filter"); + List carriers = Arrays.asList("usps"); + List types = Arrays.asList("service_levels", "predefined_packages"); + CarrierMetadata carrierMetadata = vcr.client.carrierMetadata.retrieve(carriers, types); + + assertTrue(carrierMetadata.getCarriers().stream() + .allMatch(carrier -> carrier.getName().equals("usps"))); + assertEquals(1, carrierMetadata.getCarriers().size()); + assertNotNull(carrierMetadata.getCarriers().get(0).getServiceLevels()); + assertNotNull(carrierMetadata.getCarriers().get(0).getPredefinedPackages()); + assertNull(carrierMetadata.getCarriers().get(0).getSupportedFeatures()); + } +} diff --git a/src/test/java/com/easypost/ClaimTest.java b/src/test/java/com/easypost/ClaimTest.java new file mode 100644 index 000000000..a762a98a5 --- /dev/null +++ b/src/test/java/com/easypost/ClaimTest.java @@ -0,0 +1,163 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.model.Claim; +import com.easypost.model.ClaimCollection; +import com.easypost.model.Shipment; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class ClaimTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("claim", TestUtils.ApiKey.TEST); + } + + /** + * Create a insured shipment object. + * @param amount the amount to insure the shipment. + * + * @return Shipment object + */ + private static Shipment createInsuredShipment(String amount) throws EasyPostException { + Shipment shipment = vcr.client.shipment.create(Fixtures.fullShipment()); + + HashMap params = new HashMap<>(); + params.put("rate", shipment.lowestRate()); + params.put("insurance", amount); + + return vcr.client.shipment.buy(shipment.getId(), params); + } + + /** + * Test creating a claim object. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + String amount = "100"; + Shipment shipment = ClaimTest.createInsuredShipment(amount); + HashMap claimData = Fixtures.basicClaim(); + claimData.put("amount", amount); + claimData.put("tracking_code", shipment.getTrackingCode()); + Claim claim = vcr.client.claim.create(claimData); + + assertInstanceOf(Claim.class, claim); + assertTrue(claim.getId().startsWith("clm_")); + } + + /** + * Test retrieving an claim object. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + String amount = "100"; + Shipment shipment = ClaimTest.createInsuredShipment(amount); + HashMap claimData = Fixtures.basicClaim(); + claimData.put("amount", amount); + claimData.put("tracking_code", shipment.getTrackingCode()); + Claim claim = vcr.client.claim.create(claimData); + + Claim retrievedClaim = vcr.client.claim.retrieve(claim.getId()); + + assertInstanceOf(Claim.class, retrievedClaim); + assertEquals(claim.getId(), retrievedClaim.getId()); + } + + /** + * Test retrieving all claim objects. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + ClaimCollection claimCollection = vcr.client.claim.all(params); + + List claims = claimCollection.getClaims(); + + assertTrue(claims.size() <= Fixtures.pageSize()); + assertNotNull(claimCollection.getHasMore()); + assertTrue(claims.stream().allMatch(claim -> claim != null)); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + ClaimCollection collection = vcr.client.claim.all(params); + + try { + ClaimCollection nextPage = vcr.client.claim.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getClaims().get(0).getId(); + String firstIdOfSecondPage = nextPage.getClaims().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Test cancelling a filed claim. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCancelClaim() throws EasyPostException { + vcr.setUpTest("cancel"); + + String amount = "100"; + Shipment shipment = ClaimTest.createInsuredShipment(amount); + HashMap claimData = Fixtures.basicClaim(); + claimData.put("amount", amount); + claimData.put("tracking_code", shipment.getTrackingCode()); + Claim claim = vcr.client.claim.create(claimData); + Claim cancelledClaim = vcr.client.claim.cancel(claim.getId()); + + assertInstanceOf(Claim.class, cancelledClaim); + assertTrue(cancelledClaim.getId().startsWith("clm_")); + assertEquals("cancelled", cancelledClaim.getStatus()); + } +} diff --git a/src/test/java/com/easypost/CustomerPortalTest.java b/src/test/java/com/easypost/CustomerPortalTest.java new file mode 100644 index 000000000..259eff0bf --- /dev/null +++ b/src/test/java/com/easypost/CustomerPortalTest.java @@ -0,0 +1,48 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.ChildUserCollection; +import com.easypost.model.CustomerPortalAccountLink; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.HashMap; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public final class CustomerPortalTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("customer_portal", TestUtils.ApiKey.PRODUCTION); + } + + /** + * Test creating a Portal Session. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateAccountLink() throws EasyPostException { + vcr.setUpTest("create_account_link"); + + HashMap userParams = new HashMap<>(); + userParams.put("page_size", Fixtures.pageSize()); + ChildUserCollection children = vcr.client.user.allChildren(userParams); + + HashMap params = new HashMap<>(); + params.put("session_type", "account_onboarding"); + params.put("user_id", children.getChildren().get(0).getId()); + params.put("refresh_url", "https://example.com/refresh"); + params.put("return_url", "https://example.com/return"); + CustomerPortalAccountLink accountLink = vcr.client.customerPortal.createAccountLink(params); + + assertEquals("CustomerPortalAccountLink", accountLink.getObject()); + } +} diff --git a/src/test/java/com/easypost/CustomsInfoTest.java b/src/test/java/com/easypost/CustomsInfoTest.java new file mode 100644 index 000000000..8fb25bb69 --- /dev/null +++ b/src/test/java/com/easypost/CustomsInfoTest.java @@ -0,0 +1,66 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.CustomsInfo; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class CustomsInfoTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("customs_info", TestUtils.ApiKey.TEST); + } + + /** + * Create a customs info object. + * + * @return CustomsInfo object. + */ + private static CustomsInfo createBasicCustomsInfo() throws EasyPostException { + return vcr.client.customsInfo.create(Fixtures.basicCustomsInfo()); + } + + /** + * Test creating a CustomsInfo. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + CustomsInfo customsInfo = createBasicCustomsInfo(); + + assertInstanceOf(CustomsInfo.class, customsInfo); + assertTrue(customsInfo.getId().startsWith("cstinfo_")); + assertEquals("NOEEI 30.37(a)", customsInfo.getEelPfc()); + } + + /** + * Test retrieving a CustomsInfo. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + CustomsInfo customsInfo = createBasicCustomsInfo(); + + CustomsInfo retrievedCustomsInfo = vcr.client.customsInfo.retrieve(customsInfo.getId()); + + assertInstanceOf(CustomsInfo.class, retrievedCustomsInfo); + assertTrue(customsInfo.equals(retrievedCustomsInfo)); + } +} diff --git a/src/test/java/com/easypost/CustomsItemTest.java b/src/test/java/com/easypost/CustomsItemTest.java new file mode 100644 index 000000000..a308d2e02 --- /dev/null +++ b/src/test/java/com/easypost/CustomsItemTest.java @@ -0,0 +1,66 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.CustomsItem; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class CustomsItemTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("customs_item", TestUtils.ApiKey.TEST); + } + + /** + * Create a customs item. + * + * @return CustomsItem object. + */ + private static CustomsItem createBasicCustomsItem() throws EasyPostException { + return vcr.client.customsItem.create(Fixtures.basicCustomsItem()); + } + + /** + * Test creating a CustomsItem. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + CustomsItem customsItem = createBasicCustomsItem(); + + assertInstanceOf(CustomsItem.class, customsItem); + assertTrue(customsItem.getId().startsWith("cstitem_")); + assertEquals(23.25, customsItem.getValue(), 0.01); + } + + /** + * Test retrieving a CustomsItem. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + CustomsItem customsItem = createBasicCustomsItem(); + + CustomsItem retrieveCustomsItem = vcr.client.customsItem.retrieve(customsItem.getId()); + + assertInstanceOf(CustomsItem.class, customsItem); + assertTrue(customsItem.equals(retrieveCustomsItem)); + } +} diff --git a/src/test/java/com/easypost/EasyPostResourceTest.java b/src/test/java/com/easypost/EasyPostResourceTest.java new file mode 100644 index 000000000..973b55783 --- /dev/null +++ b/src/test/java/com/easypost/EasyPostResourceTest.java @@ -0,0 +1,99 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.Address; +import com.google.common.collect.ImmutableList; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class EasyPostResourceTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("easypost_resource", TestUtils.ApiKey.TEST); + } + + /** + * Test string representation of an EasyPostResource. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testToString() throws EasyPostException { + vcr.setUpTest("to_string"); + + Address address = vcr.client.address.create(Fixtures.caAddress1()); + + String stringRepresentation = address.toString(); + List substringsToContain = new ArrayList(ImmutableList.of( + "<", + address.getClass().getName(), + "@", + "" + System.identityHashCode(address), // cast to string + " id=", + address.getId(), + ">" + )); + + // Regex matching doesn't work in run mode, only in debug mode (timing issue?) + boolean matches = false; + + for (String substring : substringsToContain) { + matches = stringRepresentation.contains(substring); + if (!matches) { + break; + } + } + + assertTrue(matches); + } + + /** + * Test pretty print of an EasyPostResource. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testPrettyPrint() throws EasyPostException { + vcr.setUpTest("pretty_print"); + + Address address = vcr.client.address.create(Fixtures.caAddress1()); + + String prettyPrint = address.prettyPrint(); + + List substringsToContain = new ArrayList(ImmutableList.of( + "<", + address.getClass().getName(), + "@", + "" + System.identityHashCode(address), // cast to string + " id=", + address.getId(), + ">", + " JSON: {", + "}" + )); + + // Regex matching doesn't work in run mode, only in debug mode (timing issue?) + boolean matches = false; + + for (String substring : substringsToContain) { + matches = prettyPrint.contains(substring); + if (!matches) { + break; + } + } + + assertTrue(matches); + } +} diff --git a/src/test/java/com/easypost/EasyPostTest.java b/src/test/java/com/easypost/EasyPostTest.java index 961ab4f15..24161c95d 100644 --- a/src/test/java/com/easypost/EasyPostTest.java +++ b/src/test/java/com/easypost/EasyPostTest.java @@ -1,1259 +1,58 @@ package com.easypost; -import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.*; - import com.easypost.exception.EasyPostException; -import com.easypost.model.*; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -public class EasyPostTest { - - static Map defaultFromAddress = new HashMap(); - static Map defaultToAddress = new HashMap(); - static Map defaultParcel = new HashMap(); - static Map defaultCustomsItem = new HashMap(); - static Map defaultCustomsInfo = new HashMap(); - static Map canadaToAddress = new HashMap(); - - static Shipment createDefaultShipmentDomestic() throws EasyPostException { - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - Shipment shipment = Shipment.create(shipmentMap); - return shipment; - } - - static Map orderShipment() throws EasyPostException { - Map shipmentMap = new HashMap(); - shipmentMap.put("parcel", defaultParcel); - return shipmentMap; - } - - @BeforeClass - public static void setUp() { - EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; // easypost public test key - - defaultFromAddress.put("name", "EasyPost"); - defaultFromAddress.put("street1", "164 Townsend St"); - defaultFromAddress.put("street2", "Unit 1"); - defaultFromAddress.put("city", "San Francisco"); - defaultFromAddress.put("state", "CA"); - defaultFromAddress.put("zip", "94107"); - defaultFromAddress.put("phone", "415-456-7890"); - - defaultToAddress.put("company", "Airport Shipping"); - defaultToAddress.put("street1", "601 Brasilia Avenue"); - defaultToAddress.put("city", "Kansas City"); - defaultToAddress.put("state", "MO"); - defaultToAddress.put("zip", "64153"); - defaultToAddress.put("phone", "314-924-0383"); - - defaultParcel.put("length", 10.8); - defaultParcel.put("width", 8.3); - defaultParcel.put("height", 6); - defaultParcel.put("weight", 10); - - defaultCustomsItem.put("description", "Item descrpition"); - defaultCustomsItem.put("origin_country", "US"); - defaultCustomsItem.put("quantity", 1); - defaultCustomsItem.put("value", 10.50); - defaultCustomsItem.put("weight", 9.9); - defaultCustomsItem.put("code", "123"); - defaultCustomsItem.put("currency", "USD"); - - List> customsItems = new ArrayList>(); - customsItems.add(defaultCustomsItem); - defaultCustomsInfo.put("customs_certify", true); - defaultCustomsInfo.put("customs_signer", "Shipping Manager"); - defaultCustomsInfo.put("contents_type", "merchandise"); - defaultCustomsInfo.put("non_delivery_option", "return"); - defaultCustomsInfo.put("restriction_type", "none"); - defaultCustomsInfo.put("customs_items", customsItems); - - canadaToAddress.put("company", "Canada Receiving"); - canadaToAddress.put("street1", "1 Larkspur Cres"); - canadaToAddress.put("city", "St. Albert"); - canadaToAddress.put("state", "AB"); - canadaToAddress.put("zip", "t8n2m4"); - canadaToAddress.put("country", "CA"); - } - - @Test - public void testShipmentWithTracker() throws EasyPostException { - // create and buy shipment - Shipment shipment = createDefaultShipmentDomestic(); - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - shipment = shipment.buy(shipment.lowestRate(buyCarriers)); - - assertNotNull(shipment.getTracker()); - } - - @Test - public void testShipmentWithPostageLabelWithOptions() throws EasyPostException { - // create and buy shipment - Map optionsMap = new HashMap(); - optionsMap.put("label_format", "ZPL"); - optionsMap.put("label_size", "4x6"); - - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - shipmentMap.put("options", optionsMap); - Shipment shipment = Shipment.create(shipmentMap); - - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - shipment = shipment.buy(shipment.lowestRate(buyCarriers)); - assertNotNull(shipment.getCreatedAt()); - assertNotNull(shipment.getUpdatedAt()); - assertNotNull(shipment.getFees()); - - PostageLabel label = shipment.getPostageLabel(); - - assertNotNull(label); - assertNotNull(label.getId()); - assertNotNull(label.getLabelUrl()); - assertNotNull(label.getCreatedAt()); - assertNotNull(label.getUpdatedAt()); - assertEquals(label.getLabelSize(), "4x6"); - assertEquals(label.getLabelFileType(), "application/zpl"); - - ArrayList fees = shipment.getFees(); - assertEquals(fees.size(), 2); - - Fee fee1 = fees.get(0); - assertEquals(fee1.getAmount(), 0.01, 0.001); - assertEquals(fee1.getCharged(), true); - assertEquals(fee1.getRefunded(), false); - assertEquals(fee1.getType(), "LabelFee"); - - Fee fee2 = fees.get(1); - assertEquals(fee2.getAmount(), 4.32, 0.001); - assertEquals(fee2.getCharged(), true); - assertEquals(fee2.getRefunded(), false); - assertEquals(fee2.getType(), "PostageFee"); - } - - @Test - public void testShipmentWithPostageLabelInline() throws EasyPostException { - // create and buy shipment with inline postage label - Map optionsMap = new HashMap(); - optionsMap.put("postage_label_inline", true); - - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - shipmentMap.put("options", optionsMap); - Shipment shipment = Shipment.create(shipmentMap); - - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - shipment = shipment.buy(shipment.lowestRate(buyCarriers)); - - PostageLabel label = shipment.getPostageLabel(); - - assertNotNull(label); - assertNotNull(label.getId()); - assertNotNull(label.getLabelFile()); - assertNull(label.getLabelUrl()); - } - - @Test - public void testShipmentWithPaymentOptions() throws EasyPostException { - // create and buy shipment - Map optionsMap = new HashMap(); - Map paymentMap = new HashMap(); - paymentMap.put("type", "SENDER"); - optionsMap.put("payment", paymentMap); - - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - shipmentMap.put("options", optionsMap); - Shipment shipment = Shipment.create(shipmentMap); - - assertNotNull(shipment.getOptions()); - assertTrue(shipment.getOptions().containsKey("payment")); - } - - @Test - public void testShipmentWithoutPaymentOptions() throws EasyPostException { - // create and buy shipment - Map optionsMap = new HashMap(); - optionsMap.put("label_format", "ZPL"); - - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - shipmentMap.put("options", optionsMap); - Shipment shipment = Shipment.create(shipmentMap); - - assertNotNull(shipment.getOptions()); - assertTrue(shipment.getOptions().containsKey("payment")); - } - - @Test - public void testShipmentWithInsurance() throws EasyPostException { - // create and buy shipment - Shipment shipment = createDefaultShipmentDomestic(); - - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - shipment = shipment.buy(shipment.lowestRate(buyCarriers)); - - Map insureMap = new HashMap(); - insureMap.put("amount", 100.00); - shipment = shipment.insure(insureMap); - - assertNotNull(shipment.getInsurance()); - } - - @Test - public void testCreateShipmentWithInsurance() throws EasyPostException { - // create and buy shipment - Shipment shipment = createDefaultShipmentDomestic(); - - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - shipment = shipment.buy(shipment.lowestRate(buyCarriers)); - } - - @Test - public void testTrackerCreateAndRetrieve() throws EasyPostException, ParseException { - // create test tracker - Map params = new HashMap(); - params.put("tracking_code", "EZ4000000004"); - params.put("carrier", "FedEx"); - Tracker tracker = Tracker.create(params); - - assertNotNull(tracker); - assertNotNull(tracker.getCreatedAt()); - assertNotNull(tracker.getUpdatedAt()); - assertNotNull(tracker.getFees()); - assertEquals(tracker.getFees().size(), 1); - - // This Est Delivery Date test confirms that the timestamps are within 1.5 seconds of each other - // (rather than exactly equal) - assertTrue( - "Est delivery dates aren't within expected timeframe", - Math.abs((new Date()).getTime() - tracker.getEstDeliveryDate().getTime()) < 1500); - - assertEquals("Weights don't match", 17.6, tracker.getWeight(), 0.0001); - assertEquals("Signed By doesn't match", "John Tester", tracker.getSignedBy()); - assertEquals( - "Service levels don't match", "FEDEX_GROUND", tracker.getCarrierDetail().getService()); - assertEquals( - "Containers don't match", "YOUR_PACKAGING", tracker.getCarrierDetail().getContainerType()); - - assertNotNull( - "Destination Location is null", tracker.getCarrierDetail().getDestinationLocation()); - assertNotNull( - "Initial Delivery Attempt is null", tracker.getCarrierDetail().getInitialDeliveryAttempt()); - - assertNotNull( - "Est delivery Date local is null", tracker.getCarrierDetail().getEstDeliveryDateLocal()); - assertNotNull( - "Est delivery Time local is null", tracker.getCarrierDetail().getEstDeliveryTimeLocal()); - assertNotNull("Created at is null", tracker.getCreatedAt()); - assertNotNull("Updated at is null", tracker.getUpdateAt()); - assertNotNull("PublicURL is not null", tracker.getPublicUrl()); - - Tracker retrieved = Tracker.retrieve(tracker.getId()); - - assertNotNull(retrieved); - assertEquals("Tracker ids are not the same", tracker.getId(), retrieved.getId()); - assertEquals("Tracker statuses are not the same", tracker.getStatus(), retrieved.getStatus()); - - assertNotNull(tracker.getCarrier()); - assertNotNull(retrieved.getCarrier()); - assertEquals("Tracker carriers are not the same", tracker.getCarrier(), retrieved.getCarrier()); - assertEquals( - "Tracker StatusDetail is not populated", - "arrived_at_destination", - tracker.getStatusDetail()); - - TrackingDetail trackingDetail = tracker.getTrackingDetails().get(0); - TrackingDetail retrievedDetail = tracker.getTrackingDetails().get(0); - - assertEquals("TrackingDetails are not the same", trackingDetail, retrievedDetail); - assertEquals( - "TrackingDetail StatusDetail is not populated", - "status_update", - trackingDetail.getStatusDetail()); - - TrackingLocation trackingLocation = trackingDetail.getTrackingLocation(); - TrackingLocation retrievedLocation = retrievedDetail.getTrackingLocation(); - - assertEquals("TrackingLocations are not the same", trackingLocation, retrievedLocation); - } - - @Test - public void testBatchTrackerCreate() throws EasyPostException { - List trackingCodes = new ArrayList(); - trackingCodes.add("EZ1000000001"); - trackingCodes.add("EZ2000000002"); - trackingCodes.add("EZ3000000003"); - - List> trackingCodeParams = new ArrayList>(); - HashMap code; - - for (int i = 0; i < trackingCodes.size(); i++) { - code = new HashMap(); - code.put("tracking_code", trackingCodes.get(i)); - code.put("carrier", "USPS"); - trackingCodeParams.add(code); +import com.easypost.exception.General.MissingParameterError; +import com.easypost.service.EasyPostClient; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +public final class EasyPostTest { + /** + * Test connection timeout getter and setter. + * + * @throws EasyPostException if any exception is thrown. + */ + @Test + public void testConnectionTimeout() throws EasyPostException { + EasyPostClient client = new EasyPostClient("fake_api_key", 1); + + assertEquals(1, client.getConnectionTimeoutMilliseconds()); } - Map createListParams = new HashMap(); - createListParams.put("trackers", trackingCodeParams); - - Tracker.createList(createListParams); - } - - @Test - public void testTrackerIndex() throws EasyPostException, ParseException { - // create test tracker - Map params = new HashMap(); - params.put("tracking_code", "EZ2000000002"); - params.put("carrier", "FedEx"); - Tracker tracker = Tracker.create(params); - - assertNotNull(tracker); - - // retrieve tracker by id - Tracker tracker2 = Tracker.retrieve(tracker.id); - - assertEquals("Tracker ids are not the same", tracker.getId(), tracker2.getId()); - - // retrieve all trackers by tracking_code - Map index_params = new HashMap(); - index_params.put("tracking_code", "EZ2000000002"); - TrackerCollection trackers = Tracker.all(index_params); - - assertEquals("Incorrect length received", trackers.getTrackers().size(), 30); - assertTrue("'has_more' should be true", trackers.getHasMore()); - assertEquals( - "Tracker ids in create response and all response are not the same", - trackers.getTrackers().get(0).id, - tracker.id); - - // create another test tracker - Tracker tracker3 = Tracker.create(params); - - assertNotSame("Tracker ids are not the same", tracker.id, tracker3.id); - - // retrieve all created since 'tracker' - Map index_params2 = new HashMap(); - index_params2.put("after_id", tracker.id); - TrackerCollection trackers2 = Tracker.all(index_params2); - - assertEquals("Incorrect length received", trackers2.getTrackers().size(), 1); - assertFalse("'has_more' should be true", trackers2.getHasMore()); - assertEquals( - "Tracker ids in create response and all response are not the same", - trackers2.getTrackers().get(0).id, - tracker3.id); - } - - @Test - public void testShipmentWithRateError() throws EasyPostException { - Map parcelMap = new HashMap(); - parcelMap.put("weight", 10); - parcelMap.put("predefined_package", "Pak"); - - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", parcelMap); - Shipment shipment = Shipment.create(shipmentMap); - - assertNotNull(shipment.getMessages()); - } - - @Test - public void testRateDeserialization() throws EasyPostException { - Shipment shipment = createDefaultShipmentDomestic(); - assertNotNull(shipment.getRates().get(0).getCarrierAccountId()); - assertNotNull(shipment.getRates().get(0).getCurrency()); - } - - @Test - public void testAddressResidentialOption() throws EasyPostException { - // shipment residential_to_address option - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - Map shipmentOptionsMap = new HashMap(); - shipmentOptionsMap.put("residential_to_address", 1); - shipmentMap.put("options", shipmentOptionsMap); - - Shipment shipment = Shipment.create(shipmentMap); - assertTrue(shipment.getToAddress().getResidential()); - } - - @Test - public void testAddressResidentialAttribute() throws EasyPostException { - // toAddress.residential flag - defaultToAddress.put("residential", 1); - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - - Shipment shipment = Shipment.create(shipmentMap); - assertTrue(shipment.getToAddress().getResidential()); - } - - @Test - public void testAddressVerifies() throws EasyPostException { - Map addressHash = new HashMap(); - addressHash.put("street1", "164 Townsend St"); - addressHash.put("street2", "Unit 1"); - addressHash.put("city", "San Francisco"); - addressHash.put("state", "CA"); - addressHash.put("zip", "19087"); - - Address address = Address.create(addressHash); - Address verified = address.verify(); - - assertNull("Verified Address has no error message", verified.getMessage()); - assertEquals("Address did not verify as expected", verified.getZip(), "94107-1990"); - - Address createdAndVerified = Address.createAndVerify(addressHash); - - assertNull("Verified Address has no error message", createdAndVerified.getMessage()); - assertEquals("Address did not verify as expected", createdAndVerified.getZip(), "94107-1990"); - } - - @Test - public void testAddressCreateWithVerifyPasses() throws EasyPostException { - Map addressHash = new HashMap(); - - List verificationList = new ArrayList(); - verificationList.add("delivery"); - addressHash.put("verify", verificationList); - - addressHash.put("street1", "118 2 St"); - addressHash.put("street2", "4"); - addressHash.put("city", "SF"); - addressHash.put("state", "CA"); - addressHash.put("zip", "94105"); - addressHash.put("country", "US"); - addressHash.put("company", "EasyPost"); - addressHash.put("phone", "415-123-4567"); - - Address address = Address.create(addressHash); - - assertNotNull("Id is null", address.getId()); - assertEquals("City did not verify", address.getCity(), "SAN FRANCISCO"); - - Map verifications = address.getVerifications(); - assertEquals("Verification did not succeed.", verifications.get("delivery").getSuccess(), true); - assertEquals( - "Verification had errors.", - verifications.get("delivery").getErrors(), - Collections.emptyList()); - assertNotNull("Address details is null.", verifications.get("delivery").getAddressDetail()); - assertEquals( - "Address details did not have TZ.", - verifications.get("delivery").getAddressDetail().getTimeZone(), - "America/Los_Angeles"); - } - - @Test - public void testAddressCreateWithVerifyFails() throws EasyPostException { - Map addressHash = new HashMap(); - - List verificationList = new ArrayList(); - verificationList.add("delivery"); - addressHash.put("verify", verificationList); - - addressHash.put("street1", "UNDELIVERABLE ST"); - addressHash.put("city", "SAN FRANCISCO"); - addressHash.put("state", "CA"); - addressHash.put("zip", "94105"); - addressHash.put("country", "US"); - addressHash.put("company", "EasyPost"); - addressHash.put("phone", "415-123-4567"); - - Address address = Address.create(addressHash); - - assertNotNull("Id is null", address.getId()); - assertEquals("City did not verify", address.getCity(), "SAN FRANCISCO"); - - Map verifications = address.getVerifications(); - assertEquals( - "Verification did not succeed.", verifications.get("delivery").getSuccess(), false); - - List errors = verifications.get("delivery").getErrors(); - - assertTrue("At least two errors are present", errors.size() >= 2); - assertEquals("Verification had a suggestion.", errors.get(0).getSuggestion(), null); - assertEquals( - "Verification error did not have a code.", errors.get(0).getCode(), "E.ADDRESS.NOT_FOUND"); - } - - @Rule public ExpectedException verifyStrictException = ExpectedException.none(); - - @Test - public void testAddressCreateWithVerifyStrictFails() throws EasyPostException { - Map addressHash = new HashMap(); + /** + * Test read timeout getter and setter. + * + * @throws EasyPostException if any exception is thrown. + */ + @Test + public void testRequestTimeout() throws EasyPostException { + EasyPostClient client = new EasyPostClient("fake_api_key", 1, 10); - List verificationList = new ArrayList(); - verificationList.add("delivery"); - addressHash.put("verify_strict", verificationList); - - addressHash.put("street1", "UNDELIVERABLE ST"); - addressHash.put("city", "SAN FRANCISCO"); - addressHash.put("state", "CA"); - addressHash.put("zip", "94105"); - addressHash.put("country", "US"); - addressHash.put("company", "EasyPost"); - addressHash.put("phone", "415-123-4567"); - - verifyStrictException.expect(com.easypost.exception.EasyPostException.class); - - Address address = Address.create(addressHash); - } - - @Rule public ExpectedException exception = ExpectedException.none(); - - @Test - public void testAddressErrorParses() throws EasyPostException { - Map addressHash = new HashMap(); - addressHash.put("street1", "118 Milky Way"); - addressHash.put("zip", "19087"); - - Address address = Address.create(addressHash); - - exception.expect(com.easypost.exception.EasyPostException.class); - address.verify(); - } - - @Test - public void testAddressErrorCatchAndInspect() throws EasyPostException { - try { - Map address = new HashMap(); - address.put("street1", "UNDELIVERABLE ST"); - address.put("city", "SAN FRANCISCO"); - address.put("state", "CA"); - address.put("zip", "94105"); - address.put("country", "US"); - address.put("company", "EasyPost"); - address.put("phone", "415-123-4567"); - - List verifications = new ArrayList(); - verifications.add("delivery"); - address.put("verify_strict", verifications); - - Address.create(address); - } catch (EasyPostException e) { - assertNotNull(e); - - assertThat(e.getMessage(), containsString("An error occured")); - assertThat(e.getMessage(), containsString("Response code: 422")); - assertThat( - e.getMessage(), - containsString( - "\"error\":{\"code\":\"ADDRESS.VERIFY.FAILURE\",\"message\":\"Unable to verify address.\"")); - } - } - - @Test - public void testBatchBuy() throws EasyPostException, InterruptedException { - List> shipments = new ArrayList>(); - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - shipmentMap.put("carrier", "USPS"); - shipmentMap.put("service", "Priority"); - shipments.add(shipmentMap); - - // create batch and wait until ready - Map batchMap = new HashMap(); - batchMap.put("shipments", shipments); - Batch batch = Batch.create(batchMap); - while (true) { - batch = batch.refresh(); - if ("created".equals(batch.getState())) { - break; - } - Thread.sleep(3000); - } - - batch.buy(); - while (true) { - batch = batch.refresh(); - if ("purchased".equals(batch.getState())) { - break; - } - Thread.sleep(3000); - } - - assertEquals("Batch state is not purchased.", batch.getState(), "purchased"); - } - - @Test - public void testBatchCreateScanForm() throws EasyPostException, InterruptedException { - // create and buy shipments - Shipment shipment1 = createDefaultShipmentDomestic(); - Shipment shipment2 = createDefaultShipmentDomestic(); - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - shipment1.buy(shipment1.lowestRate(buyCarriers)); - shipment2.buy(shipment2.lowestRate(buyCarriers)); - - // create batch and wait until ready - Batch batch = Batch.create(); - while (true) { - batch = batch.refresh(); - if ("created".equals(batch.getState())) { - break; - } - Thread.sleep(3000); + assertEquals(10, client.getReadTimeoutMilliseconds()); } - // add shipments to batch - List shipments = new ArrayList(); - shipments.add(shipment1); - shipments.add(shipment2); - batch.addShipments(shipments); + /** + * Test setting API base. + * + * @throws EasyPostException if any exception is thrown. + */ + @Test + public void testApiBase() throws EasyPostException { + EasyPostClient client = new EasyPostClient("fake_api_key", "https://api.easypostExample.com"); - // create manifest and wait for it to be ready - batch.createScanForm(); - while (true) { - batch = batch.refresh(); - if (batch.getScanForm() != null) { - break; - } - Thread.sleep(3000); + assertEquals("https://api.easypostExample.com", client.getApiBase()); } - ScanForm scanForm = batch.getScanForm(); - - assertNotNull(scanForm); - assertNotEquals(scanForm.getLabelUrl(), ""); - assertNotEquals(scanForm.getLabelFileType(), ""); - assertNotNull(scanForm.getBatchId()); - - shipment1 = Shipment.retrieve(shipment1.getId()); - assertNotNull(shipment1.getBatchId()); - assertEquals(shipment1.getBatchId(), batch.getId()); - - shipment2 = Shipment.retrieve(shipment2.getId()); - assertNotNull(shipment2.getBatchId()); - assertEquals(shipment2.getBatchId(), batch.getId()); - } - - @Test - @Ignore // The UserId is currently locked out - public void testPickup() throws EasyPostException, InterruptedException { - Shipment shipment = createDefaultShipmentDomestic(); - List buyCarriers = new ArrayList(); - buyCarriers.add("UPS"); - shipment = shipment.buy(shipment.lowestRate(buyCarriers)); - - DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); - - String reference = "internal_id_1234"; - String instructions = "Special pickup instructions"; - - Map pickupMap = new HashMap(); - pickupMap.put("address", defaultFromAddress); - pickupMap.put("shipment", shipment); - pickupMap.put("reference", reference); - pickupMap.put("min_datetime", df.format(new Date())); - pickupMap.put("max_datetime", df.format(new Date())); - pickupMap.put("is_account_address", true); - pickupMap.put("instructions", instructions); - - Pickup pickup = Pickup.create(pickupMap); - - assertNotNull(pickup); - assertEquals(pickup.getMessages().size(), 0); - assertEquals(pickup.getReference(), reference); - assertEquals(pickup.getInstructions(), instructions); - assertEquals(pickup.getStatus(), "unknown"); - assertTrue(pickup.getIsAccountAddress()); - - assertEquals(pickup.getPickupRates().get(0).getCarrier(), "UPS"); - assertEquals(pickup.getPickupRates().get(0).getService(), "Same-day Pickup"); - - Map buyMap = new HashMap(); - buyMap.put("carrier", pickup.getPickupRates().get(0).getCarrier()); - buyMap.put("service", pickup.getPickupRates().get(0).getService()); - pickup = pickup.buy(buyMap); - - assertNotNull(pickup); - assertEquals(pickup.getMessages().size(), 0); - assertEquals(pickup.getStatus(), "scheduled"); - - Map cancelMap = new HashMap(); - cancelMap.put("id", pickup.getId()); - pickup = pickup.cancel(cancelMap); - - assertNotNull(pickup); - assertEquals(pickup.getMessages().size(), 0); - assertEquals(pickup.getStatus(), "canceled"); - - Pickup retrieved = Pickup.retrieve(pickup.getId()); - pickup = pickup.refresh(); - - assertNotNull(pickup); - assertNotNull((retrieved)); - assertEquals(retrieved.getMessages().size(), 0); - assertEquals(retrieved.getId(), pickup.getId()); - assertEquals(retrieved.getStatus(), pickup.getStatus()); - } - - @Test - public void testOrder() throws EasyPostException { - // create and buy multi-shipment order - Map shipment_1 = orderShipment(); - Map shipment_2 = orderShipment(); - List> shipments = new ArrayList>(); - shipments.add(shipment_1); - shipments.add(shipment_2); - - Map orderParams = new HashMap(); - orderParams.put("shipments", shipments); - orderParams.put("from_address", defaultFromAddress); - orderParams.put("to_address", defaultToAddress); - Order order = Order.create(orderParams); - - Map buyParams = new HashMap(); - buyParams.put("carrier", "USPS"); - buyParams.put("service", "Priority"); - - order.buy(buyParams); - - assertNotNull(order.getShipments().get(0).getTracker()); - assertNotNull(order.getShipments().get(0).getPostageLabel().getLabelUrl()); - assertNotNull(order.getShipments().get(1).getPostageLabel().getLabelUrl()); - - assertEquals(order.getShipments().get(0).getOrderId(), order.getId()); - } - - @Test - public void testOrderNewRates() throws EasyPostException { - // create and buy multi-shipment order - Map shipment_1 = orderShipment(); - Map shipment_2 = orderShipment(); - List> shipments = new ArrayList>(); - shipments.add(shipment_1); - shipments.add(shipment_2); - - Map orderParams = new HashMap(); - orderParams.put("shipments", shipments); - orderParams.put("from_address", defaultFromAddress); - orderParams.put("to_address", defaultToAddress); - Order order = Order.create(orderParams); - - String rateId = order.getShipments().get(0).getRates().get(0).getId(); - assertNotNull("Original Rate ID is null", rateId); - - order.newRates(); - String newRateId = order.getShipments().get(0).getRates().get(0).getId(); - - assertNotNull("New Rate ID is null", newRateId); - assertNotEquals("New Rate ID and Old Rate ID are equal", newRateId, rateId); - } - - @Test - public void testCustomsInfo() throws EasyPostException { - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", canadaToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - shipmentMap.put("customs_info", defaultCustomsInfo); - Map shipmentOptionsMap = new HashMap(); - shipmentOptionsMap.put("suppress_etd", true); - shipmentMap.put("options", shipmentOptionsMap); - - Shipment shipment = Shipment.create(shipmentMap); - - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - shipment = shipment.buy(shipment.lowestRate(buyCarriers)); - - ///System.out.println("Shipment.getForms(): >>"+shipment.getForms()+"<<"); - /// java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 - /// Form does not exists. Invalid test - /* - assertTrue( - "Customs Form was not submitted electronically", - shipment.getForms().get(0).getSubmittedElectronically()); - */ - } - - @Test - public void testCustomsItem() throws EasyPostException { - Map customsItemMap = new HashMap(); - customsItemMap.put("description", "T-shirt"); - customsItemMap.put("quantity", 1); - customsItemMap.put("value", 10); - customsItemMap.put("weight", 5); - customsItemMap.put("origin_country", "us"); - customsItemMap.put("hs_tariff_number", "123456"); - customsItemMap.put("code", "123"); - customsItemMap.put("currency", "USD"); - - CustomsItem customsItem = CustomsItem.create(customsItemMap); - CustomsItem customsItem2 = CustomsItem.retrieve(customsItem.getId()); - - assertEquals(customsItem2.getDescription(), "T-shirt"); - assertEquals(customsItem2.getQuantity(), 1, 0.1); - assertEquals(customsItem2.getValue(), 10, 0.1); - assertEquals(customsItem2.getWeight(), 5, 0.1); - assertEquals(customsItem2.getOriginCountry(), "US"); - assertEquals(customsItem2.getHsTariffNumber(), "123456"); - assertEquals(customsItem2.getCurrency(), "USD"); - assertEquals(customsItem2.getCode(), "123"); - } - - @Test - public void testInsurance() throws EasyPostException { - Map insuraceMap = new HashMap(); - insuraceMap.put("to_address", defaultToAddress); - insuraceMap.put("from_address", defaultFromAddress); - insuraceMap.put("amount", 101.00); - insuraceMap.put("carrier", "USPS"); - insuraceMap.put("tracking_code", "EZ2000000002"); - - Insurance insurance = Insurance.create(insuraceMap); - assertNotNull("ID is null", insurance.getId()); - assertNotNull("Tracking Code is null", insurance.getTrackingCode()); - assertNotNull("To Address is null", insurance.getToAddress()); - assertNotNull("From Address is null", insurance.getFromAddress()); - assertNotNull("Tracker is null", insurance.getTracker()); - - Insurance insurance2 = Insurance.retrieve(insurance.getId()); - assertNotNull("ID is null", insurance2.getId()); - assertEquals( - "Create and Retrieve returned different ids", insurance.getId(), insurance2.getId()); - assertEquals( - "Create and Retrieve returned different tracking codes", - insurance.getTrackingCode(), - insurance2.getTrackingCode()); - - Map index_params = new HashMap(); - index_params.put("tracking_code", "EZ2000000002"); - index_params.put("page_size", "5"); - InsuranceCollection insurances = Insurance.all(index_params); - - assertTrue("Wrong page_size returned", insurances.getInsurances().size() == 5); - assertTrue("Insurances HasMore not set correctly", insurances.getHasMore()); - } - - @Test - public void testShipmentReport() throws EasyPostException { - // Define request params - Map paramMap = new HashMap(); - paramMap.put("type", "shipment"); - - // Create a shipment report - Report shipmentReport = Report.create(paramMap); - assertNotNull("ID is null", shipmentReport.getId()); - assertThat("ID is not a shipment report ID", shipmentReport.getId(), containsString("shprep_")); - - // Retrieve a shipment report - Report shipmentReport2 = Report.retrieve(shipmentReport.getId()); - assertNotNull("ID is null", shipmentReport2.getId()); - assertThat( - "ID is not a shipment report ID", shipmentReport2.getId(), containsString("shprep_")); - assertEquals( - "Create and Retrieve returned different ids", - shipmentReport.getId(), - shipmentReport2.getId()); - - // Index shipment reports - paramMap.put("page_size", "4"); - ReportCollection shipmentReports = Report.all(paramMap); - assertEquals("Page Size not respected", shipmentReports.getReports().size(), 4); - assertEquals("Does not have more", shipmentReports.getHasMore(), true); - } - - @Test - public void testTrackerReport() throws EasyPostException { - // Define request params - Map paramMap = new HashMap(); - paramMap.put("type", "tracker"); - - // Create a tracker report - Report trackerReport = Report.create(paramMap); - assertNotNull("ID is null", trackerReport.getId()); - assertThat("ID is not a tracker report ID", trackerReport.getId(), containsString("trkrep_")); - - // Retrieve a tracker report - Report trackerReport2 = Report.retrieve(trackerReport.getId()); - assertNotNull("ID is null", trackerReport2.getId()); - assertThat("ID is not a tracker report ID", trackerReport2.getId(), containsString("trkrep_")); - assertEquals( - "Create and Retrieve returned different ids", - trackerReport.getId(), - trackerReport2.getId()); - - // Index tracker reports - paramMap.put("page_size", "4"); - ReportCollection trackerReports = Report.all(paramMap); - assertEquals("Page Size not respected", trackerReports.getReports().size(), 4); - assertEquals("Does not have more", trackerReports.getHasMore(), true); - } - - @Test - public void testPaymentLogReport() throws EasyPostException { - // Define request params - Map paramMap = new HashMap(); - paramMap.put("type", "payment_log"); - - // Create a payment_log report - Report paymentLogReport = Report.create(paramMap); - assertNotNull("ID is null", paymentLogReport.getId()); - assertThat( - "ID is not a payment_log report ID", paymentLogReport.getId(), containsString("plrep_")); - - // Retrieve a payment_log report - Report paymentLogReport2 = Report.retrieve(paymentLogReport.getId()); - assertNotNull("ID is null", paymentLogReport2.getId()); - assertThat( - "ID is not a payment_log report ID", paymentLogReport2.getId(), containsString("plrep_")); - assertEquals( - "Create and Retrieve returned different ids", - paymentLogReport.getId(), - paymentLogReport2.getId()); - - // Index payment_log reports - paramMap.put("page_size", "4"); - ReportCollection paymentLogReports = Report.all(paramMap); - assertEquals("Page Size not respected", paymentLogReports.getReports().size(), 4); - assertEquals("Does not have more", paymentLogReports.getHasMore(), true); - } - - @Test - public void testWebhookCRUD() throws EasyPostException { - // Define request params - Map paramMap = new HashMap(); - String url = "https://example.com/" + UUID.randomUUID().toString(); - paramMap.put("url", url); - - // Create a webhook - Webhook webhook = Webhook.create(paramMap); - assertNotNull("ID is null", webhook.getId()); - assertEquals("mode is not test", webhook.getMode(), "test"); - assertEquals("URL is not correctly ser", webhook.getUrl(), url); - assertNull("disabledAt is not null", webhook.getDisabledAt()); - assertEquals("Class is not Webhook", webhook.getClass(), Webhook.class); - - // Retrieve a webhook - Webhook webhook2 = Webhook.retrieve(webhook.getId()); - assertNotNull("ID is null", webhook2.getId()); - assertEquals("Create and Retrieve returned different ids", webhook.getId(), webhook2.getId()); - - // Update a webhook (re-enable it) - Webhook webhook3 = webhook.update(); - assertNotNull("ID is null", webhook3.getId()); - assertEquals("Create and Update returned different ids", webhook.getId(), webhook3.getId()); - - // Index webhooks - WebhookCollection webhooks = Webhook.all(); - assertEquals( - "Create and Retrieve returned different ids", - webhook.getId(), - webhooks.getWebhooks().get(webhooks.getWebhooks().size() - 1).getId()); - - // Delete webhook - webhook.delete(); - try { - Webhook.retrieve(webhook.getId()); - assertFalse("Webhook did not delete", true); - } catch (EasyPostException e) { - assertThat(e.getMessage(), containsString("An error occured")); - assertThat(e.getMessage(), containsString("Response code: 404")); - assertThat( - e.getMessage(), - containsString( - "{\"error\":{\"code\":\"NOT_FOUND\",\"message\":\"The requested resource could not be found.\",\"errors\":[]}}")); + /** + * Test create EasyPostClient with invalid API key. + * + * @throws MissingParameterError if any required parameter is missing. + */ + @Test + public void testCreateEasyPostClientWithInvalidKey() throws MissingParameterError { + assertThrows(MissingParameterError.class, () -> new EasyPostClient(null)); + assertThrows(MissingParameterError.class, () -> new EasyPostClient(null)); } - } - - @Test - public void testScanForm() throws EasyPostException { - // create and buy shipment - Shipment shipment = createDefaultShipmentDomestic(); - List buyCarriers = new ArrayList(); - buyCarriers.add("USPS"); - shipment = shipment.buy(shipment.lowestRate(buyCarriers)); - - // create ScanForm - List shipments = new ArrayList(); - shipments.add(shipment); - Map paramMap = new HashMap(); - paramMap.put("shipments", shipments); - ScanForm scanForm = ScanForm.create(paramMap); - - assertNotNull("No ID returned", scanForm.getId()); - assertEquals( - "Shipment's tracking code not on Scan Form", - scanForm.getTrackingCodes().get(0), - shipment.getTrackingCode()); - - // retrieve ScanForm - ScanForm scanForm2 = ScanForm.retrieve(scanForm.getId()); - assertNotNull("No ID returned", scanForm2.getId()); - assertEquals("IDs do not match", scanForm2.getId(), scanForm.getId()); - - // index ScanForms - Map indexMap = new HashMap(); - indexMap.put("page_size", 2); - ScanFormCollection scanForms = ScanForm.all(indexMap); - assertEquals("IDs do not match", scanForms.getScanForms().get(0).getId(), scanForm.getId()); - } - - /* - //This test needs to have new set of dates to avoid "report already exists" error - @Test - public void testShipmentReportDates() throws EasyPostException { - // Define request params - Map paramMap = new HashMap(); - paramMap.put("type", "shipment"); - paramMap.put("start_date", "2017-10-01"); - paramMap.put("end_date", "2017-10-30"); - - // Create a shipment report - Report shipmentReport = Report.create(paramMap); - assertNotNull("ID is null", shipmentReport.getId()); - assertThat("ID is not a shipment report ID", shipmentReport.getId(), containsString("shprep_")); - - // Retrieve a shipment report - Report shipmentReport2 = Report.retrieve(shipmentReport.getId()); - assertNotNull("ID is null", shipmentReport2.getId()); - assertThat( - "ID is not a shipment report ID", shipmentReport2.getId(), containsString("shprep_")); - assertEquals( - "Create and Retrieve returned different ids", - shipmentReport.getId(), - shipmentReport2.getId()); - assertEquals("Incorrect ShipmentReport start_date", shipmentReport2.getStartDate().toString(), "Sun Oct 01 00:00:00 PDT 2017"); - assertEquals("Incorrect ShipmentReport end_date", shipmentReport2.getEndDate().toString(), "Mon Oct 30 00:00:00 PDT 2017"); - } - */ - - /* - // This test requires a FedExSameDayCity account - @Test - public void testShipmentMessageInRateError() throws EasyPostException { - EasyPost.apiKey = "KEY"; - Map address = new HashMap(); - address.put("street1", "UNDELIVERABLE ST"); - address.put("city", "SAN FRANCISCO"); - address.put("state", "CA"); - address.put("zip", "94105"); - address.put("country", "US"); - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", address); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - shipmentMap.put("carrier_accounts", "ca_123xyz"); // FedExSameDayCity carrier account id - Shipment shipment = Shipment.create(shipmentMap); - System.out.println(shipment.prettyPrint()); - List messages = shipment.getMessages(); - assertNotNull(messages); - assertEquals("Shipment message as an object did not parse.",messages.get(0).getMessage().toString(), - "{code=E.ADDRESS.NOT_FOUND, field=address, message=Address not found, suggestion=null}"); - } - */ - - /* - // This test requires a FedEx account - @Test - public void testShipmentWithForm() throws EasyPostException { - Map optionsMap = new HashMap(); - optionsMap.put("cod_amount", 10); - - Map shipmentMap = new HashMap(); - shipmentMap.put("to_address", defaultToAddress); - shipmentMap.put("from_address", defaultFromAddress); - shipmentMap.put("parcel", defaultParcel); - shipmentMap.put("options", optionsMap); - Shipment shipment = Shipment.create(shipmentMap); - - List buyCarriers = new ArrayList(); - buyCarriers.add("FEDEX"); - List buyServices = new ArrayList(); - buyServices.add("FEDEX_2_DAY"); - shipment.buy(shipment.lowestRate(buyCarriers, buyServices)); - - assertNotNull(shipment.getForms().get(0).getFormUrl()); - } - */ - - // // This test requires a production api key - // @Test - // public void testUserMethods() throws EasyPostException { - // EasyPost.apiKey = "KEY"; // easypost private production key - // - // User user = User.retrieveMe(); - // - // System.out.println(user.getPhoneNumber()); - // System.out.println(user.getRechargeAmount()); - // System.out.println(user.getSecondaryRechargeAmount()); - // - // user.setSecondaryRechargeAmount("$200.00"); - // - // Map userHash = new HashMap(); - // userHash.put("secondary_recharge_amount", 100000.00); - // - // user.update(userHash); - // - // System.out.println(user.getSecondaryRechargeAmount()); - // - // System.out.println(user.getRechargeThreshold()); - // } - - // // This test requires a production api key - // @Test - // public void testUserCreateAndDelete() throws EasyPostException { - // EasyPost.apiKey = "KEY"; // easypost private production key - // - // Map userHash = new HashMap(); - // userHash.put("name", "Chad DeVader"); - // userHash.put("password", "4theempire"); - // userHash.put("password_confirmation", "4theempire"); - // userHash.put("phone_number", "555-123-4321"); - // - // - // User child = User.create(userHash); - // - // assertEquals("Child's name is incorrect", child.getName(), "Chad DeVader"); - // assertNotNull("Child's email is not present", child.getEmail()); - // assertNotNull("Child's phone_number is not present", child.getPhoneNumber()); - // assertNotNull("Child's ID is not present", child.getId()); - // - // User fetchedChild = User.retrieve(child.getId()); - // assertEquals("Child's ID is not the same as FetchedChild's ID", fetchedChild.getId(), - // child.getId()); - // - // fetchedChild.delete(); - // - // try { - // User newFetchedChild = User.retrieve(child.getId()); - // assertNull("Child is not deleted", newFetchedChild); - // } catch (EasyPostException e) { - // assertThat(e.getMessage(), containsString("An error occured")); - // assertThat(e.getMessage(), containsString("Response code: 404")); - // assertThat(e.getMessage(), - // containsString("{\"error\":{\"code\":\"NOT_FOUND\",\"message\":\"The requested resource could - // not be found.\",\"errors\":[]}}")); - // } - // } - - // // This test requires a production api key - // @Test - // public void testUserCreateAndDeleteFailsOnParent() throws EasyPostException { - // EasyPost.apiKey = "KEY"; // easypost private production key - // - // User fetchedSelf = User.retrieveMe(); - // assertNotNull("Parent's ID is not present", fetchedSelf); - // - // try { - // fetchedSelf.delete(); - // assertFalse("User did not delete", true); - // } catch (EasyPostException e) { - // assertThat(e.getMessage(), containsString("An error occured")); - // assertThat(e.getMessage(), containsString("Response code: 404")); - // assertThat(e.getMessage(), - // containsString("{\"error\":{\"code\":\"NOT_FOUND\",\"message\":\"The requested resource could - // not be found.\",\"errors\":[]}}")); - // } - // } - - // // This test requires a production api key - // @Test - // public void testCarrierAccountMutability() throws EasyPostException { - // EasyPost.apiKey = "KEY"; // easypost private production key - // - // Map listHash = new HashMap(); - // listHash.put("type", "UpsAccount"); - // List carrierAccounts = CarrierAccount.all(listHash); - // assertNotNull(carrierAccounts); - // - // int originalNumCarrierAccounts = carrierAccounts.size(); - // - // String description = "A java client library test account"; - // String reference = "FedexJavaTest-1"; - // String accountNumber = "B2B2B2"; - // Map credentials = new HashMap(); - // credentials.put("account_number", accountNumber); - // credentials.put("user_id", "UPSDOTCOM_USERNAME"); - // credentials.put("password", "UPSDOTCOM_PASSWORD"); - // credentials.put("access_license_number", "UPS_ACCESS_LICENSE_NUMBER"); - // - // Map carrierParams = new HashMap(); - // carrierParams.put("type", "UpsAccount"); - // carrierParams.put("description", description); - // carrierParams.put("reference", reference); - // carrierParams.put("credentials", credentials); - // - // CarrierAccount carrierAccount = CarrierAccount.create(carrierParams); - // CarrierAccount retrieved = CarrierAccount.retrieve(carrierAccount.getId()); - // - // assertNotNull(retrieved); - // assertEquals(carrierAccount.getId(), retrieved.getId()); - // assertEquals(retrieved.getDescription(), description); - // assertEquals(retrieved.getReference(), reference); - // assertEquals(retrieved.getCredentials().get("account_number"), accountNumber); - // - // List updatedCarrierAccounts = CarrierAccount.all(listHash); - // assertNotNull(updatedCarrierAccounts); - // - // int updatedNumCarrierAccounts = updatedCarrierAccounts.size(); - // assertEquals(originalNumCarrierAccounts + 1, updatedNumCarrierAccounts); - // - // String newDescription = "A java client library test account that has been edited"; - // - // String newAccountNumber = "C3C3C3C3"; - // credentials.put("account_number", newAccountNumber); - // - // Map newParams = new HashMap(); - // newParams.put("description", newDescription); - // newParams.put("credentials", credentials); - // - // CarrierAccount mutated = retrieved.update(newParams); - // - // assertNotNull(mutated); - // assertEquals(carrierAccount.getId(), mutated.getId()); - // assertEquals(mutated.getDescription(), newDescription); - // assertEquals(mutated.getCredentials().get("account_number"), newAccountNumber); - // - // mutated.delete(); - // - // List deletedCarrierAccounts = CarrierAccount.all(listHash); - // assertNotNull(deletedCarrierAccounts); - // - // int finalNumCarrierAccounts = deletedCarrierAccounts.size(); - // assertEquals(originalNumCarrierAccounts, finalNumCarrierAccounts); - // } } diff --git a/src/test/java/com/easypost/EmbeddableTest.java b/src/test/java/com/easypost/EmbeddableTest.java new file mode 100644 index 000000000..8a6ed18a9 --- /dev/null +++ b/src/test/java/com/easypost/EmbeddableTest.java @@ -0,0 +1,46 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.ChildUserCollection; +import com.easypost.model.EmbeddablesSession; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.HashMap; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public final class EmbeddableTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("embeddable", TestUtils.ApiKey.PRODUCTION); + } + + /** + * Test creating an Embeddables Session. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateSession() throws EasyPostException { + vcr.setUpTest("create_session"); + + HashMap userParams = new HashMap<>(); + userParams.put("page_size", Fixtures.pageSize()); + ChildUserCollection children = vcr.client.user.allChildren(userParams); + + HashMap params = new HashMap<>(); + params.put("origin_host", "https://example.com"); + params.put("user_id", children.getChildren().get(0).getId()); + EmbeddablesSession session = vcr.client.embeddable.createSession(params); + + assertEquals("EmbeddablesSession", session.getObject()); + } +} diff --git a/src/test/java/com/easypost/EndShipperTest.java b/src/test/java/com/easypost/EndShipperTest.java new file mode 100644 index 000000000..d5bf350d5 --- /dev/null +++ b/src/test/java/com/easypost/EndShipperTest.java @@ -0,0 +1,124 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.EndShipper; +import com.easypost.model.EndShipperCollection; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class EndShipperTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("end_shipper", TestUtils.ApiKey.TEST); + } + + /** + * Create an EndShipper. + * + * @return EndShipper object. + */ + private static EndShipper createEndShipper() throws EasyPostException { + return vcr.client.endShipper.create(Fixtures.caAddress1()); + } + + /** + * Test creating an EndShipper object. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + EndShipper endShipper = createEndShipper(); + + assertInstanceOf(EndShipper.class, endShipper); + assertTrue(endShipper.getId().startsWith("es_")); + assertEquals("388 TOWNSEND ST APT 20", endShipper.getStreet1()); + } + + /** + * Test retrieving an EndShipper object. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + EndShipper endShipper = createEndShipper(); + + EndShipper retrievedEndShipper = vcr.client.endShipper.retrieve(endShipper.getId()); + + assertInstanceOf(EndShipper.class, retrievedEndShipper); + assertEquals(endShipper.getStreet1(), retrievedEndShipper.getStreet1()); + } + + /** + * Test retrieving all EndShipper objects. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + EndShipperCollection endShipperCollection = vcr.client.endShipper.all(params); + + List endShippers = endShipperCollection.getEndShippers(); + + assertTrue(endShippers.size() <= Fixtures.pageSize()); + assertNotNull(endShipperCollection.getHasMore()); + assertTrue(endShippers.stream().allMatch(endShipper -> endShipper != null)); + } + + /** + * Test updating an EndShipper object. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testUpdate() throws EasyPostException { + vcr.setUpTest("update"); + + EndShipper endShipper = createEndShipper(); + + String testName = "NEW NAME"; // all caps since server-side verification will auto-capitalize it in response + Map updateParams = new HashMap<>(); + updateParams.put("name", testName); + updateParams.put("company", "EasyPost"); + updateParams.put("street1", "388 Townsend St"); + updateParams.put("street2", "Apt 20"); + updateParams.put("city", "San Francisco"); + updateParams.put("state", "CA"); + updateParams.put("zip", "94107"); + updateParams.put("country", "US"); + updateParams.put("phone", "9999999999"); + updateParams.put("email", "test@example.com"); + + EndShipper updatedEndShipper = vcr.client.endShipper.update(endShipper.getId(), updateParams); + + assertInstanceOf(EndShipper.class, updatedEndShipper); + assertTrue(updatedEndShipper.getId().startsWith("es_")); + assertEquals(testName, updatedEndShipper.getName()); + } +} diff --git a/src/test/java/com/easypost/ErrorTest.java b/src/test/java/com/easypost/ErrorTest.java new file mode 100644 index 000000000..49e142a5f --- /dev/null +++ b/src/test/java/com/easypost/ErrorTest.java @@ -0,0 +1,228 @@ +package com.easypost; + +import com.easypost.exception.API.BadRequestError; +import com.easypost.exception.API.ForbiddenError; +import com.easypost.exception.API.GatewayTimeoutError; +import com.easypost.exception.API.InternalServerError; +import com.easypost.exception.API.InvalidRequestError; +import com.easypost.exception.API.MethodNotAllowedError; +import com.easypost.exception.API.NotFoundError; +import com.easypost.exception.API.PaymentError; +import com.easypost.exception.API.RateLimitError; +import com.easypost.exception.API.RedirectError; +import com.easypost.exception.API.ServiceUnavailableError; +import com.easypost.exception.API.TimeoutError; +import com.easypost.exception.API.UnauthorizedError; +import com.easypost.exception.API.UnknownApiError; +import com.easypost.exception.APIException; +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.model.FieldError; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.HashMap; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertThrows; + +public final class ErrorTest extends Requestor { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException if any exception is thrown. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("error", TestUtils.ApiKey.TEST); + } + + /** + * Tests that we assign properties of an error correctly. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testError() throws EasyPostException { + vcr.setUpTest("error"); + + APIException exception = assertThrows(InvalidRequestError.class, () -> vcr.client.shipment.create(null)); + + assertEquals(422, exception.getStatusCode()); + assertEquals("PARAMETER.REQUIRED", exception.getCode()); + assertEquals("Missing required parameter.", exception.getMessage()); + FieldError fieldError = (FieldError) exception.getErrors().get(0); + assertEquals("cannot be blank", fieldError.getMessage()); + assertEquals("shipment", fieldError.getField()); + } + + /** + * Tests that we assign properties of an error correctly when returned via the alternative format. + * NOTE: Claims (among other things) uses the alternative errors format. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testErrorAlternativeFormat() throws EasyPostException { + vcr.setUpTest("error_alternative_format"); + + HashMap claimData = Fixtures.basicClaim(); + claimData.put("tracking_code", "123"); // Intentionally pass a bad tracking code + + APIException exception = assertThrows(NotFoundError.class, () -> vcr.client.claim.create(claimData)); + + assertEquals(404, exception.getStatusCode()); + assertEquals("NOT_FOUND", exception.getCode()); + assertEquals("The requested resource could not be found.", exception.getMessage()); + assertEquals("No eligible insurance found with provided tracking code.", exception.getErrors().get(0)); + } + + /** + * Test every error type and make sure each error has the correct properties. + * + * @throws EasyPostException if any exception is thrown. + */ + @Test + public void testKnownApiException() throws EasyPostException { + HashMap> apiErrorsMap = new HashMap>(); + apiErrorsMap.put(300, RedirectError.class); + apiErrorsMap.put(301, RedirectError.class); + apiErrorsMap.put(302, RedirectError.class); + apiErrorsMap.put(303, RedirectError.class); + apiErrorsMap.put(304, RedirectError.class); + apiErrorsMap.put(305, RedirectError.class); + apiErrorsMap.put(306, RedirectError.class); + apiErrorsMap.put(307, RedirectError.class); + apiErrorsMap.put(308, RedirectError.class); + apiErrorsMap.put(400, BadRequestError.class); + apiErrorsMap.put(401, UnauthorizedError.class); + apiErrorsMap.put(402, PaymentError.class); + apiErrorsMap.put(403, ForbiddenError.class); + apiErrorsMap.put(404, NotFoundError.class); + apiErrorsMap.put(405, MethodNotAllowedError.class); + apiErrorsMap.put(408, TimeoutError.class); + apiErrorsMap.put(422, InvalidRequestError.class); + apiErrorsMap.put(429, RateLimitError.class); + apiErrorsMap.put(444, UnknownApiError.class); + apiErrorsMap.put(500, InternalServerError.class); + apiErrorsMap.put(503, ServiceUnavailableError.class); + apiErrorsMap.put(504, GatewayTimeoutError.class); + + for (Map.Entry> entry : apiErrorsMap.entrySet()) { + APIException exception = assertThrows(APIException.class, + () -> handleAPIError("{}", entry.getKey())); + + assertEquals(Constants.ErrorMessages.API_DID_NOT_RETURN_ERROR_DETAILS, exception.getMessage()); + assertEquals("NO RESPONSE CODE", exception.getCode()); + assertEquals(entry.getKey(), exception.getStatusCode()); + assertInstanceOf(entry.getValue(), exception); + } + } + + /** + * Test parsing error message. + * + * @throws EasyPostException if any exception is thrown. + */ + @Test + public void testExceptionErrorMessageParsing() throws EasyPostException { + String errorMessageStringJson = "{\n" + + " \"error\": {\n" + + " \"code\": \"ERROR_CODE\",\n" + + " \"message\": \"ERROR_MESSAGE_1\",\n" + + " \"errors\": []\n" + + " }\n" + + "}"; + EasyPostException exception = assertThrows(EasyPostException.class, + () -> handleAPIError(errorMessageStringJson, 400)); + + assertEquals("ERROR_MESSAGE_1", exception.getMessage()); + } + + /** + * Test parsing error message that is an array. + * + * @throws EasyPostException if any exception is thrown. + */ + @Test + public void testExceptionErrorArrayParsing() throws EasyPostException { + String errorMessageArrayJson = "{\n" + + " \"error\": {\n" + + " \"code\": \"ERROR_CODE\",\n" + + " \"message\": [\n" + + " \"ERROR_MESSAGE_1\",\n" + + " \"ERROR_MESSAGE_2\"\n" + + " ],\n" + + " \"errors\": []\n" + + " }\n" + + "}"; + EasyPostException exception = assertThrows(EasyPostException.class, + () -> handleAPIError(errorMessageArrayJson, 400)); + + assertEquals("ERROR_MESSAGE_1, ERROR_MESSAGE_2", exception.getMessage()); + } + + /** + * Test parsing error message that is an object. + * + * @throws EasyPostException is any exception thrown. + */ + @Test + public void testExceptionErrorObjectParsing() throws EasyPostException { + String errorMessageObjectJson = "{\n" + + " \"error\": {\n" + + " \"code\": \"UNPROCESSABLE_ENTITY\",\n" + + " \"message\": {\n" + + " \"errors\": [\n" + + " \"bad error.\",\n" + + " \"second bad error.\"\n" + + " ]\n" + + " },\n" + + " \"errors\": []\n" + + " }\n" + + "}"; + + EasyPostException exception = assertThrows(EasyPostException.class, + () -> handleAPIError(errorMessageObjectJson, 400)); + + assertEquals("bad error., second bad error.", exception.getMessage()); + } + + /** + * Test parsing error message that has really bad format. + * + * @throws EasyPostException if any exception is thrown. + */ + @Test + public void testExceptionErrorEdgeCaseParsing() throws EasyPostException { + String json = "{\n" + + " \"error\": {\n" + + " \"code\": \"UNPROCESSABLE_ENTITY\",\n" + + " \"message\": {\n" + + " \"errors\": [\n" + + " \"Bad format 1\",\n" + + " \"Bad format 2\"\n" + + " ],\n" + + " \"bad_data\": [\n" + + " {\n" + + " \"first_message\": \"Bad format 3\",\n" + + " \"second_message\": \"Bad format 4\",\n" + + " \"thrid_message\": \"Bad format 5\"\n" + + " }\n" + + " ]\n" + + " },\n" + + " \"errors\": []\n" + + " }\n" + + "}"; + + EasyPostException exception = assertThrows(EasyPostException.class, + () -> handleAPIError(json, 400)); + + assertEquals("Bad format 1, Bad format 2, Bad format 3, Bad format 4, Bad format 5", + exception.getMessage()); + } +} diff --git a/src/test/java/com/easypost/EventTest.java b/src/test/java/com/easypost/EventTest.java index bac6c73aa..3ce915261 100644 --- a/src/test/java/com/easypost/EventTest.java +++ b/src/test/java/com/easypost/EventTest.java @@ -1,18 +1,185 @@ package com.easypost; +import com.easypost.exception.APIException; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; import com.easypost.model.Event; -import com.easypost.net.EasyPostResource; -import org.junit.Test; +import com.easypost.model.EventCollection; +import com.easypost.model.Payload; +import com.easypost.model.Webhook; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertNull; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -public class EventTest { +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +public final class EventTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("event", TestUtils.ApiKey.TEST); + } + + /** + * Test retrieving all events. + * + * @throws EasyPostException when the request fails. + */ @Test - public void testEventWithNullPreviousAttributes() { - String eventJson = "{\"result\": {\"id\": \"rfnd_b550a6f968be4c61a2306e3c10c12345\", \"object\": \"Refund\", \"created_at\": \"2019-12-12T00:10:49Z\", \"updated_at\": \"2019-12-12T00:10:49Z\", \"tracking_code\": \"778827012345\", \"confirmation_number\": null, \"status\": \"refunded\", \"carrier\": \"FedEx\", \"shipment_id\": \"shp_b4fba1b233d94ecabfbb455ff9112345\"}, \"description\": \"refund.successful\", \"mode\": \"production\", \"previous_attributes\": null, \"pending_urls\": [\"hook_4ed7ff31c6974ff180e2463bb2912345\", \"hook_b43bc6d4eb3848bfaaee8e131f712345\"], \"completed_urls\": null, \"id\": \"evt_5786b354576049bb91e845b6d5712345\", \"user_id\": \"user_7b4c654836a743a492e59573a0512345\", \"status\": \"pending\", \"object\": \"Event\"}"; - Event event = EasyPostResource.gson.fromJson(eventJson, Event.class); - assertNull(event.getPreviousAttributes()); + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + EventCollection events = getBasicEventCollection(); + + List eventsList = events.getEvents(); + + assertTrue(eventsList.size() <= Fixtures.pageSize()); + assertNotNull(events.getHasMore()); + assertTrue(eventsList.stream().allMatch(event -> event != null)); } + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + EventCollection collection = vcr.client.event.all(params); + + try { + EventCollection nextPage = vcr.client.event.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getEvents().get(0).getId(); + String firstIdOfSecondPage = nextPage.getEvents().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Get an event collection. + * + * @return EventCollection object. + */ + private static EventCollection getBasicEventCollection() throws EasyPostException { + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + return vcr.client.event.all(params); + } + + /** + * Test retrieving an event. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + EventCollection eventCollection = getBasicEventCollection(); + List events = eventCollection.getEvents(); + Event event = events.get(0); + + Event retrievedEvent = vcr.client.event.retrieve(event.getId()); + + assertInstanceOf(Event.class, retrievedEvent); + // Must compare IDs since can't do whole-object comparisons currently + assertEquals(event.getId(), retrievedEvent.getId()); + } + + /** + * Test retrieving all payloads. + * + * @throws EasyPostException when the request fails. + * @throws InterruptedException when vcr recording fails. + */ + @Test + public void testEventRetrieveAllPayloads() throws EasyPostException, InterruptedException { + vcr.setUpTest("retrieve_all_payloads"); + + Map params = new HashMap<>(); + params.put("url", Fixtures.webhookUrl()); + Webhook webhook = vcr.client.webhook.create(params); + + List shipments = new ArrayList<>(); + shipments.add(Fixtures.basicShipment()); + + Map batchParams = new HashMap<>(); + batchParams.put("shipments", shipments); + vcr.client.batch.create(batchParams); + + if (vcr.isRecording()) { + Thread.sleep(5000); // Wait enough time for the batch to process before buying the shipment + } + + EventCollection events = getBasicEventCollection(); + + List eventsList = events.getEvents(); + List payloads = vcr.client.event.retrieveAllPayloads(eventsList.get(0).getId()); + assertTrue(payloads.stream().allMatch(payload -> payload != null)); + vcr.client.webhook.delete(webhook.getId()); + } + + /** + * Test retrieving a payload. + * + * @throws EasyPostException when the request fails. + * @throws InterruptedException when vcr recording fails. + */ + @Test + public void testEventRetrievePayload() throws EasyPostException, InterruptedException { + vcr.setUpTest("retrieve_payload"); + + Map params = new HashMap<>(); + params.put("url", Fixtures.webhookUrl()); + Webhook webhook = vcr.client.webhook.create(params); + + List shipments = new ArrayList<>(); + shipments.add(Fixtures.basicShipment()); + + Map batchParams = new HashMap<>(); + batchParams.put("shipments", shipments); + vcr.client.batch.create(batchParams); + + if (vcr.isRecording()) { + Thread.sleep(5000); // Wait enough time for the batch to process before buying the shipment + } + + EventCollection events = getBasicEventCollection(); + + APIException exception = assertThrows(APIException.class, + () -> vcr.client.event.retrievePayload(events.getEvents().get(0).getId(), + "payload_11111111111111111111111111111111")); // Need a valid-length, invalid payload ID here + + assertEquals(404, exception.getStatusCode()); + + vcr.client.webhook.delete(webhook.getId()); + } } diff --git a/src/test/java/com/easypost/FedExRegistrationTest.java b/src/test/java/com/easypost/FedExRegistrationTest.java new file mode 100644 index 000000000..ff0de37a7 --- /dev/null +++ b/src/test/java/com/easypost/FedExRegistrationTest.java @@ -0,0 +1,197 @@ +package com.easypost; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Map; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +import com.easypost.exception.EasyPostException; +import com.easypost.http.Requestor; +import com.easypost.http.Requestor.RequestMethod; +import com.easypost.model.FedExAccountValidationResponse; +import com.easypost.model.FedExRequestPinResponse; + +public final class FedExRegistrationTest { + private static TestUtils.VCR vcr; + private static MockedStatic requestMock = Mockito.mockStatic(Requestor.class); + + /** + * Setup the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("fedex_registration", TestUtils.ApiKey.PRODUCTION); + } + + /** + * Release the static mock once it has been used. + */ + @AfterAll + public static void cleanup() { + requestMock.close(); + } + + /** + * Test registering a billing address. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRegisterAddress() throws EasyPostException { + String fedexAccountNumber = "123456789"; + Map addressValidation = new java.util.HashMap<>(); + addressValidation.put("name", "BILLING NAME"); + addressValidation.put("street1", "1234 BILLING STREET"); + addressValidation.put("city", "BILLINGCITY"); + addressValidation.put("state", "ST"); + addressValidation.put("postal_code", "12345"); + addressValidation.put("country_code", "US"); + + Map easypostDetails = new java.util.HashMap<>(); + easypostDetails.put("carrier_account_id", "ca_123"); + + Map params = new java.util.HashMap<>(); + params.put("address_validation", addressValidation); + params.put("easypost_details", easypostDetails); + + String jsonResponse = "{\"email_address\":null,\"options\":[\"SMS\",\"CALL\",\"INVOICE\"]," + + "\"phone_number\":\"***-***-9721\"}"; + FedExAccountValidationResponse expectedResponse = Constants.Http.GSON.fromJson(jsonResponse, + FedExAccountValidationResponse.class); + + requestMock.when(() -> Requestor.request( + RequestMethod.POST, + String.format("fedex_registrations/%s/address", fedexAccountNumber), + params, + FedExAccountValidationResponse.class, + vcr.client)).thenReturn(expectedResponse); + + FedExAccountValidationResponse response = vcr.client.fedexRegistration.registerAddress(fedexAccountNumber, + params); + assertNull(response.getEmailAddress()); + assertTrue(response.getOptions().contains("SMS")); + assertTrue(response.getOptions().contains("CALL")); + assertTrue(response.getOptions().contains("INVOICE")); + assertEquals("***-***-9721", response.getPhoneNumber()); + } + + /** + * Test requesting a pin. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRequestPin() throws EasyPostException { + String fedexAccountNumber = "123456789"; + Map pinMethodMap = new java.util.HashMap<>(); + pinMethodMap.put("option", "SMS"); + Map params = new java.util.HashMap<>(); + params.put("pin_method", pinMethodMap); + + String jsonResponse = "{\"message\":\"sent secured Pin\"}"; + FedExRequestPinResponse pinResponse = Constants.Http.GSON.fromJson(jsonResponse, FedExRequestPinResponse.class); + + requestMock.when(() -> Requestor.request( + RequestMethod.POST, + String.format("fedex_registrations/%s/pin", + fedexAccountNumber), + params, + FedExRequestPinResponse.class, + vcr.client)) + .thenReturn(pinResponse); + + FedExRequestPinResponse response = vcr.client.fedexRegistration.requestPin(fedexAccountNumber, "SMS"); + assertEquals("sent secured Pin", response.getMessage()); + } + + /** + * Test validating a pin. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testValidatePin() throws EasyPostException { + String fedexAccountNumber = "123456789"; + Map pinValidation = new java.util.HashMap<>(); + pinValidation.put("pin_code", "123456"); + pinValidation.put("name", "BILLING NAME"); + + Map easypostDetails = new java.util.HashMap<>(); + easypostDetails.put("carrier_account_id", "ca_123"); + + Map params = new java.util.HashMap<>(); + params.put("pin_validation", pinValidation); + params.put("easypost_details", easypostDetails); + + String jsonResponse = "{\"id\":\"ca_123\",\"object\":\"CarrierAccount\",\"type\":\"FedexAccount\"," + + "\"credentials\":{\"account_number\":\"123456789\",\"mfa_key\":\"123456789-XXXXX\"}}"; + FedExAccountValidationResponse expectedResponse = Constants.Http.GSON.fromJson(jsonResponse, + FedExAccountValidationResponse.class); + + requestMock.when(() -> Requestor.request( + RequestMethod.POST, + String.format("fedex_registrations/%s/pin/validate", fedexAccountNumber), + params, + FedExAccountValidationResponse.class, + vcr.client)).thenReturn(expectedResponse); + + FedExAccountValidationResponse response = vcr.client.fedexRegistration.validatePin(fedexAccountNumber, params); + assertEquals("ca_123", response.getId()); + assertEquals("CarrierAccount", response.getObject()); + assertEquals("FedexAccount", response.getType()); + assertEquals("123456789", response.getCredentials().get("account_number")); + assertEquals("123456789-XXXXX", response.getCredentials().get("mfa_key")); + } + + /** + * Test submitting details about an invoice. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testSubmitInvoice() throws EasyPostException { + String fedexAccountNumber = "123456789"; + Map invoiceValidation = new java.util.HashMap<>(); + invoiceValidation.put("name", "BILLING NAME"); + invoiceValidation.put("invoice_number", "INV-12345"); + invoiceValidation.put("invoice_date", "2025-12-08"); + invoiceValidation.put("invoice_amount", "100.00"); + invoiceValidation.put("invoice_currency", "USD"); + + Map easypostDetails = new java.util.HashMap<>(); + easypostDetails.put("carrier_account_id", "ca_123"); + + Map params = new java.util.HashMap<>(); + params.put("invoice_validation", invoiceValidation); + params.put("easypost_details", easypostDetails); + + String jsonResponse = "{\"id\":\"ca_123\",\"object\":\"CarrierAccount\",\"type\":\"FedexAccount\"," + + "\"credentials\":{\"account_number\":\"123456789\",\"mfa_key\":\"123456789-XXXXX\"}}"; + FedExAccountValidationResponse expectedResponse = Constants.Http.GSON.fromJson(jsonResponse, + FedExAccountValidationResponse.class); + + requestMock.when(() -> Requestor.request( + RequestMethod.POST, + String.format("fedex_registrations/%s/invoice", fedexAccountNumber), + params, + FedExAccountValidationResponse.class, + vcr.client)).thenReturn(expectedResponse); + + FedExAccountValidationResponse response = vcr.client.fedexRegistration.submitInvoice(fedexAccountNumber, + params); + assertEquals("ca_123", response.getId()); + assertEquals("CarrierAccount", response.getObject()); + assertEquals("FedexAccount", response.getType()); + assertEquals("123456789", response.getCredentials().get("account_number")); + assertEquals("123456789-XXXXX", response.getCredentials().get("mfa_key")); + } +} diff --git a/src/test/java/com/easypost/Fixtures.java b/src/test/java/com/easypost/Fixtures.java new file mode 100644 index 000000000..a3a1b0546 --- /dev/null +++ b/src/test/java/com/easypost/Fixtures.java @@ -0,0 +1,403 @@ +package com.easypost; + +import com.easypost.fixtures.FixtureStructure; +import com.google.common.collect.ImmutableList; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.lang.reflect.Type; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.List; +import java.util.Objects; + +import com.easypost.fixtures.components.Billing; + +import static com.easypost.TestUtils.getSourceFileDirectory; +import static com.easypost.TestUtils.readFile; + +public abstract class Fixtures { + private static String readFixtureData() { + Path fixtureDataPath = Paths.get(getSourceFileDirectory(), + "examples/official/fixtures/client-library-fixtures.json"); + return readFile(fixtureDataPath); + } + + private static FixtureStructure getFixtureData() { + // load fixture data as a JSON string + String fixtureData = readFixtureData(); + if (fixtureData == null) { + return null; + } + + Gson gson = new Gson(); + Type type = new TypeToken() {}.getType(); + return gson.fromJson(fixtureData, type); + } + + /** + * Get the default page size for the API. + * + * @return The default page size for the API + */ + public static int pageSize() { + return Objects.requireNonNull(getFixtureData()).pageSizes.five; + } + + /** + * Get the default USPS carrier account ID. + * + * @return The default USPS carrier account ID + */ + public static String uspsCarrierAccountID() { + // Fallback to the EasyPost Java Client Library Test User USPS carrier account + return System.getenv("USPS_CARRIER_ACCOUNT_ID") != null ? System.getenv("USPS_CARRIER_ACCOUNT_ID") + : "ca_f09befdb2e9c410e95c7622ea912c18c"; + } + + /** + * Get the USPS carrier name. + * + * @return The USPS carrier name + */ + public static String usps() { + return Objects.requireNonNull(getFixtureData()).carrierStrings.usps; + } + + /** + * Get the default USPS service level. + * + * @return The default USPS service level + */ + public static String uspsService() { + return Objects.requireNonNull(getFixtureData()).serviceNames.usps.firstService; + } + + /** + * Get the default pickup service level. + * + * @return The default pickup service level + */ + public static String pickupService() { + return Objects.requireNonNull(getFixtureData()).serviceNames.usps.pickupService; + } + + /** + * Get the default report type. + * + * @return The default report type + */ + public static String reportType() { + return Objects.requireNonNull(getFixtureData()).reportTypes.shipment; + } + + /** + * Get the default report date. + * + * @return The default report date + */ + public static String reportDate() { + return "2022-05-04"; + } + + /** + * Get the first default address. + * + * @return The first default address + */ + public static HashMap caAddress1() { + return Objects.requireNonNull(getFixtureData()).addresses.caAddress1; + } + + /** + * Get the second default address. + * + * @return The second default address + */ + public static HashMap caAddress2() { + return Objects.requireNonNull(getFixtureData()).addresses.caAddress2; + } + + /** + * Get the default incorrect address. + * + * @return The default incorrect address + */ + public static HashMap incorrectAddress() { + return Objects.requireNonNull(getFixtureData()).addresses.incorrectAddress; + } + + /** + * Get the default parcel. + * + * @return The default parcel + */ + public static HashMap basicParcel() { + return Objects.requireNonNull(getFixtureData()).parcels.basic; + } + + /** + * Get the default customs item. + * + * @return The default customs item + */ + public static HashMap basicCustomsItem() { + return Objects.requireNonNull(getFixtureData()).customsItems.basic; + } + + /** + * Get the default customs info. + * + * @return The default customs info + */ + public static HashMap basicCustomsInfo() { + return Objects.requireNonNull(getFixtureData()).customsInfos.basic; + } + + /** + * Get the default tax identifier. + * + * @return The default tax identifier + */ + public static HashMap taxIdentifier() { + return Objects.requireNonNull(getFixtureData()).taxIdentifiers.basic; + } + + /** + * Get the default shipment. + * + * @return The default shipment + */ + public static HashMap basicShipment() { + return Objects.requireNonNull(getFixtureData()).shipments.basicDomestic; + } + + /** + * Get the default full shipment. + * + * @return The default full shipment + */ + public static HashMap fullShipment() { + return Objects.requireNonNull(getFixtureData()).shipments.full; + } + + /** + * Get the default one-call-buy shipment. + * + * @return The default one-call-buy shipment + */ + public static HashMap oneCallBuyShipment() { + HashMap values = new HashMap<>(); + values.put("to_address", caAddress1()); + values.put("from_address", caAddress2()); + values.put("parcel", basicParcel()); + values.put("service", uspsService()); + values.put("carrier_accounts", ImmutableList.of(uspsCarrierAccountID())); + values.put("carrier", usps()); + + return values; + } + + /** + * Get the default pickup. + * If you need to re-record cassettes, increment the date (see comment). + * + * @return The default pickup + */ + public static HashMap basicPickup() { + HashMap fixture = Objects.requireNonNull(getFixtureData()).pickups.basic; + + /* + * If you need to re-record cassettes, increment the date below and ensure it is one day in the future, + * USPS only does "next-day" pickups including Saturday but not Sunday or Holidays. + */ + String pickupDate = "2025-01-03"; + + fixture.put("min_datetime", pickupDate); + fixture.put("max_datetime", pickupDate); + + return fixture; + } + + /** + * Get the default carrier account. + * + * @return The default carrier account + */ + public static HashMap basicCarrierAccount() { + return Objects.requireNonNull(getFixtureData()).carrierAccounts.basic; + } + + /** + * Get the default claim. + * + * @return The default claim + */ + public static HashMap basicClaim() { + /* + * This fixture will require you to append a `tracking_code` and `amount`. + */ + return Objects.requireNonNull(getFixtureData()).claims.basic; + } + + /** + * Get the default insurance. + * + * @return The default insurance + */ + public static HashMap basicInsurance() { + /* + * This fixture will require you to append a `tracking_code` key with the + * shipment's tracking code. + */ + return Objects.requireNonNull(getFixtureData()).insurances.basic; + } + + /** + * Get the default order. + * + * @return The default order + */ + public static HashMap basicOrder() { + return Objects.requireNonNull(getFixtureData()).orders.basic; + } + + /** + * Get the bytes of the default event webhook body. + * + * @return The bytes of the default event webhook body + */ + public static byte[] eventBytes() { + String relativeFilePath = "examples/official/fixtures/event-body.json"; + String fullFilePath = Paths.get(getSourceFileDirectory(), relativeFilePath).toString(); + byte[] data = null; + + try { + data = Files.readAllLines(Paths.get(fullFilePath), StandardCharsets.UTF_8) + .get(0).getBytes(Charset.defaultCharset()); + } catch (IOException error) { + throw new UncheckedIOException(error); + } + + return data; + } + + /** + * Get the default webhook HMAC signature. + * + * @return The default webhook HMAC signature + */ + public static String webhookHmacSignature() { + return Objects.requireNonNull(getFixtureData()).webhooks.hmacSignature; + } + + /** + * Get the default webhook secret. + * + * @return The default webhook secret + */ + public static String webhookSecret() { + return Objects.requireNonNull(getFixtureData()).webhooks.secret; + } + + /** + * Get the default webhook URL. + * + * @return The default webhook URL + */ + public static String webhookUrl() { + return Objects.requireNonNull(getFixtureData()).webhooks.url; + } + + /** + * Get the default webhook custom headers. + * + * @return The default webhook custom headers + */ + public static List webhookCustomHeaders() { + return Objects.requireNonNull(getFixtureData()).webhooks.customHeaders; + } + + /** + * Get the default credit card details. + * + * @return The default credit card details + */ + public static HashMap creditCardDetails() { + /* + * The credit card details below are for a valid proxy card usable for tests + * only and cannot be used for real transactions. + * DO NOT alter these details with real credit card information. + */ + return Objects.requireNonNull(getFixtureData()).creditCards.test; + } + + /** + * Get the default RMA form options. + * + * @return The default RMA form options + */ + public static HashMap rmaFormOptions() { + return Objects.requireNonNull(getFixtureData()).formOptions.rma; + } + + /** + * Get the default referral user. + * + * @return The default referral user + */ + public static HashMap referralUser() { + return Objects.requireNonNull(getFixtureData()).users.referral; + } + + /** + * Get the default planned ship date. + * + * @return The default planned ship date + */ + public static String plannedShipDate() { + return "2024-08-18"; + } + + /** + * Get the default desired delivery date. + * + * @return The default desired delivery date + */ + public static String desiredDeliveryDate() { + return "2024-08-21"; + } + + /** + * Get the billing fixture data. + * + * @return The billing fixture data + */ + public static Billing billing() { + return Objects.requireNonNull(getFixtureData()).billing; + } + + /** + * Get the Luma ruleset name fixture data. + * + * @return The Luma ruleset name fixture data + */ + public static String lumaRulesetName() { + return Objects.requireNonNull(getFixtureData()).luma.rulesetName; + } + + /** + * Get the Luma planned ship date fixture data. + * + * @return The Luma planned ship date fixture data + */ + public static String lumaPlannedShipDate() { + return "2025-06-16"; + } +} diff --git a/src/test/java/com/easypost/HookTest.java b/src/test/java/com/easypost/HookTest.java new file mode 100644 index 000000000..3f275750f --- /dev/null +++ b/src/test/java/com/easypost/HookTest.java @@ -0,0 +1,185 @@ +package com.easypost; + +import com.easypost.exception.API.NotFoundError; +import com.easypost.exception.EasyPostException; +import com.easypost.hooks.RequestHookResponses; +import com.easypost.hooks.ResponseHookResponses; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import java.util.function.Function; + +public class HookTest { + private static TestUtils.VCR vcr; + + private static boolean hookHit = false; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("hook", TestUtils.ApiKey.TEST); + } + + /** + * Test failing a hook if we subscribed to a request hook. + * + * @param data The RequestHookResponses object representing the hook data. + * @return The result of the test. + */ + public static Object failIfSubscribedToRequest(RequestHookResponses data) { + fail("Test failed"); + + return false; + } + + /** + * Test failing a hook if we subscribed to a response hook. + * + * @param data The ResponseHookResponses object representing the hook data. + * @return The result of the test. + */ + public static Object failIfSubscribedToResponse(ResponseHookResponses data) { + fail("Test failed"); + + return false; + } + + /** + * Test subscribing a request hook. + * + * @param data The RequestHookResponses object representing the hook data. + * @return The result of the test. + */ + public static Object testRequestHooks(RequestHookResponses data) { + assertEquals("https://api.easypost.com/v2/parcels", data.getPath()); + assertEquals("POST", data.getMethod()); + assertNotNull(data.getHeaders()); + assertNotNull(data.getRequestBody()); + assertNotNull(data.getRequestTimestamp()); + assertNotNull(data.getRequestUuid()); + + return true; + } + + /** + * Test subscribing a response hook when an HTTP error occurs. + * + * @param data The ResponseHookResponses object representing the hook data. + * @return The result of the test. + */ + public static Object testResponseHookOnHttpError(ResponseHookResponses data) { + assertEquals("https://api.easypost.com/v2/parcels/par_123", data.getPath()); + assertEquals("GET", data.getMethod()); + assertEquals(404, data.getHttpStatus()); + assertNotNull(data.getHeaders()); + assertNotNull(data.getResponseBody()); + assertNotNull(data.getRequestTimestamp()); + assertNotNull(data.getRequestTimestamp()); + assertNotNull(data.getRequestUuid()); + + hookHit = true; + + return true; + } + + /** + * Test subscribing a response hook. + * + * @param data The ResponseHookResponses object representing the hook data. + * @return The result of the test. + */ + public static Object testResponseHooks(ResponseHookResponses data) { + assertEquals("https://api.easypost.com/v2/parcels", data.getPath()); + assertEquals("POST", data.getMethod()); + assertEquals(201, data.getHttpStatus()); + assertNotNull(data.getHeaders()); + assertNotNull(data.getResponseBody()); + assertNotNull(data.getRequestTimestamp()); + assertNotNull(data.getRequestTimestamp()); + assertNotNull(data.getRequestUuid()); + + return true; + } + + /** + * Test creating a Parcel with request hook subscribed. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateParcelWithRequestHook() throws EasyPostException { + vcr.setUpTest("create"); + Function requestHook = HookTest::testRequestHooks; + vcr.client.subscribeToRequestHook(requestHook); + vcr.client.parcel.create(Fixtures.basicParcel()); + } + + /** + * Test creating a Parcel with response hook subscribed. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateParcelWithResponseHook() throws EasyPostException { + vcr.setUpTest("create"); + Function requestHook = HookTest::testResponseHooks; + vcr.client.subscribeToResponseHook(requestHook); + vcr.client.parcel.create(Fixtures.basicParcel()); + } + + /** + * Test creating a Parcel with unsubscribed hooks. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testUnsubscribeHooks() throws EasyPostException { + vcr.setUpTest("create"); + + Function failedRequestHook = HookTest::failIfSubscribedToRequest; + + vcr.client.subscribeToRequestHook(failedRequestHook); + vcr.client.unsubscribeFromRequestHook(failedRequestHook); + + Function failedResponseHook = HookTest::failIfSubscribedToResponse; + + vcr.client.subscribeToResponseHook(failedResponseHook); + vcr.client.unsubscribeFromResponseHook(failedResponseHook); + + vcr.client.parcel.create(Fixtures.basicParcel()); + } + + /** + * Test that response hooks are still fired even if the HTTP call fails. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testResponseHookFiredOnHTTPError() throws EasyPostException { + vcr.setUpTest("http_error"); + + hookHit = false; + + Function requestHook = HookTest::testResponseHookOnHttpError; + + vcr.client.subscribeToResponseHook(requestHook); + + try { + vcr.client.parcel.retrieve("par_123"); + } catch (NotFoundError e) { + assertEquals(404, e.getStatusCode()); + } + + assertTrue(hookHit); + } +} diff --git a/src/test/java/com/easypost/InsuranceTest.java b/src/test/java/com/easypost/InsuranceTest.java new file mode 100644 index 000000000..5f6d783e0 --- /dev/null +++ b/src/test/java/com/easypost/InsuranceTest.java @@ -0,0 +1,152 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.model.Insurance; +import com.easypost.model.InsuranceCollection; +import com.easypost.model.Shipment; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class InsuranceTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("insurance", TestUtils.ApiKey.TEST); + } + + /** + * Create insurance object. + * + * @return Insurance object + */ + private static Insurance createBasicInsurance() throws EasyPostException { + Shipment shipment = vcr.client.shipment.create(Fixtures.oneCallBuyShipment()); + + HashMap params = Fixtures.basicInsurance(); + params.put("tracking_code", shipment.getTrackingCode()); + + return vcr.client.insurance.create(params); + } + + /** + * Test creating an insurance object. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Insurance insurance = createBasicInsurance(); + + assertInstanceOf(Insurance.class, insurance); + assertTrue(insurance.getId().startsWith("ins_")); + assertEquals("100.00000", insurance.getAmount()); + } + + /** + * Test retrieving an insurance object. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Insurance insurance = createBasicInsurance(); + + Insurance retrievedInsurance = vcr.client.insurance.retrieve(insurance.getId()); + + assertInstanceOf(Insurance.class, insurance); + // Must compare IDs since can't do whole-object comparisons currently + assertEquals(insurance.getId(), retrievedInsurance.getId()); + } + + /** + * Test retrieving all insurance objects. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + InsuranceCollection insuranceCollection = vcr.client.insurance.all(params); + + List insurances = insuranceCollection.getInsurances(); + + assertTrue(insurances.size() <= Fixtures.pageSize()); + assertNotNull(insuranceCollection.getHasMore()); + assertTrue(insurances.stream().allMatch(insurance -> insurance != null)); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + InsuranceCollection collection = vcr.client.insurance.all(params); + + try { + InsuranceCollection nextPage = vcr.client.insurance.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getInsurances().get(0).getId(); + String firstIdOfSecondPage = nextPage.getInsurances().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Test refunding an insurance. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRefundInsurance() throws EasyPostException { + vcr.setUpTest("refund"); + + HashMap params = Fixtures.basicInsurance(); + params.put("tracking_code", "EZ1000000001"); + Insurance insurance = vcr.client.insurance.create(params); + Insurance cancelledInsurance = vcr.client.insurance.refund(insurance.getId()); + + assertInstanceOf(Insurance.class, cancelledInsurance); + assertTrue(insurance.getId().startsWith("ins_")); + assertEquals("cancelled", cancelledInsurance.getStatus()); + assertEquals("Insurance was cancelled by the user.", cancelledInsurance.getMessages().get(0)); + } +} diff --git a/src/test/java/com/easypost/LumaTest.java b/src/test/java/com/easypost/LumaTest.java new file mode 100644 index 000000000..5527abb00 --- /dev/null +++ b/src/test/java/com/easypost/LumaTest.java @@ -0,0 +1,42 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.LumaInfo; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +public final class LumaTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("luma", TestUtils.ApiKey.TEST); + } + + /** + * Test that we get service recommendations from Luma based on your ruleset. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetPromise() throws EasyPostException { + vcr.setUpTest("get_promise"); + + Map shipmentData = Fixtures.basicShipment(); + shipmentData.put("ruleset_name", Fixtures.lumaRulesetName()); + shipmentData.put("planned_ship_date", Fixtures.lumaPlannedShipDate()); + + LumaInfo response = vcr.client.luma.getPromise(shipmentData); + + assertNotNull(response.getLumaSelectedRate()); + } +} diff --git a/src/test/java/com/easypost/OrderTest.java b/src/test/java/com/easypost/OrderTest.java new file mode 100644 index 000000000..1729f4533 --- /dev/null +++ b/src/test/java/com/easypost/OrderTest.java @@ -0,0 +1,196 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.Order; +import com.easypost.model.Rate; +import com.easypost.model.Shipment; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class OrderTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("order", TestUtils.ApiKey.TEST); + } + + /** + * Create an order. + * + * @return Order object + */ + private static Order createBasicOrder() throws EasyPostException { + return vcr.client.order.create(Fixtures.basicOrder()); + } + + /** + * Test creating an Order. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Order order = createBasicOrder(); + + assertInstanceOf(Order.class, order); + assertTrue(order.getId().startsWith("order_")); + assertNotNull(order.getRates()); + } + + /** + * Test retrieving an Order. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Order order = createBasicOrder(); + + Order retrievedOrder = vcr.client.order.retrieve(order.getId()); + + assertInstanceOf(Order.class, retrievedOrder); + // Must compare IDs since other elements of objects may be different + assertEquals(order.getId(), retrievedOrder.getId()); + } + + /** + * Test retrieving rates for an order. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetRates() throws EasyPostException { + vcr.setUpTest("get_rates"); + + Order order = createBasicOrder(); + + List rates = order.getRates(); + + assertNotNull(rates); + for (Rate rate : rates) { + assertInstanceOf(Rate.class, rate); + assertTrue(rate.getId().startsWith("rate_")); + } + } + + /** + * Test buying an Order with params. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuyWithParams() throws EasyPostException, InterruptedException { + vcr.setUpTest("buy_with_params"); + + Order order = createBasicOrder(); + + Map params = new HashMap<>(); + params.put("carrier", Fixtures.usps()); + params.put("service", Fixtures.uspsService()); + + Order boughtOrder = vcr.client.order.buy(order.getId(), params); + + List shipments = boughtOrder.getShipments(); + + assertInstanceOf(Order.class, order); + for (Shipment shipment : shipments) { + assertNotNull(shipment.getPostageLabel()); + } + } + + /** + * Test buying an Order with rate. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuyWithRate() throws EasyPostException, InterruptedException { + vcr.setUpTest("buy_with_rate"); + + Order order = createBasicOrder(); + + Order boughtOrder = vcr.client.order.buy(order.getId(), order.lowestRate()); + + List shipments = boughtOrder.getShipments(); + + assertInstanceOf(Order.class, order); + for (Shipment shipment : shipments) { + assertNotNull(shipment.getPostageLabel()); + } + } + + /** + * Test getting new rates of a order. + * + * @throws EasyPostException if an exception is thrown. + */ + @Test + public void testNewRate() throws EasyPostException { + vcr.setUpTest("new_rate"); + + Order order = createBasicOrder(); + + Order orderWithNewRate = vcr.client.order.newRates(order.getId()); + + List rates = orderWithNewRate.getRates(); + + assertInstanceOf(List.class, rates); + for (Rate rate : rates) { + assertInstanceOf(Rate.class, rate); + } + } + + /** + * Test getting the lowest rate of an Order. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testLowestRate() throws EasyPostException { + vcr.setUpTest("lowest_rate"); + + Order order = createBasicOrder(); + + // Test lowest rate with no filters + Rate lowestRate = order.lowestRate(); + assertEquals("GroundAdvantage", lowestRate.getService()); + assertEquals(11.40, lowestRate.getRate(), 0.01); + assertEquals("USPS", lowestRate.getCarrier()); + + // Test lowest rate with service filter (this rate is higher than the lowest but + // should filter) + List services = new ArrayList<>(Arrays.asList("Priority")); + Rate lowestRateService = order.lowestRate(null, services); + assertEquals("Priority", lowestRateService.getService()); + assertEquals(14.48, lowestRateService.getRate(), 0.01); + assertEquals("USPS", lowestRateService.getCarrier()); + + // Test lowest rate with carrier filter (should error due to bad carrier) + List carriers = new ArrayList<>(Arrays.asList("BAD CARRIER")); + assertThrows(EasyPostException.class, () -> { + order.lowestRate(carriers, null); + }); + } +} diff --git a/src/test/java/com/easypost/PaginatedCollectionTest.java b/src/test/java/com/easypost/PaginatedCollectionTest.java new file mode 100644 index 000000000..af56244a0 --- /dev/null +++ b/src/test/java/com/easypost/PaginatedCollectionTest.java @@ -0,0 +1,116 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.http.Requestor; +import com.easypost.model.AddressCollection; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +import java.util.HashMap; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class PaginatedCollectionTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the setup fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("paginated_collections", TestUtils.ApiKey.TEST); + } + + /** + * Test getting the next page of a paginated collection. + * This getNextPage method is implemented on a per-service, + * but rather than testing in each service, we'll test it once here. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + AddressCollection addresses = vcr.client.address.all(params); + + AddressCollection nextPage = vcr.client.address.getNextPage(addresses); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = addresses.getAddresses().get(0).getId(); + String firstIdOfSecondPage = nextPage.getAddresses().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } + + /** + * Test that the getNextPage method works with page limits. + * This method is implemented on a per-service, but rather than testing in each service, we'll test it once here.. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPageSizeLimit() throws EasyPostException { + vcr.setUpTest("next_page_size_limit"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + AddressCollection addresses = vcr.client.address.all(params); + + AddressCollection nextPage = vcr.client.address.getNextPage(addresses, Fixtures.pageSize()); + + assertNotNull(nextPage); + + assertTrue(nextPage.getAddresses().size() <= Fixtures.pageSize()); + } + + /** + * Test that the getNextPage method will throw an EndOfPaginationError when it reaches the end of the list. + * This method is implemented on a per-service, but rather than testing in each service, we'll test it once here. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPageReachEnd() throws EasyPostException { + vcr.setUpTest("next_page_reach_end"); + + final MockedStatic requestMock = Mockito.mockStatic(Requestor.class); + + String fakeData = "{ \"addresses\": [], \"has_more\": false }"; + AddressCollection fakeCollection = Constants.Http.GSON.fromJson(fakeData, AddressCollection.class); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + requestMock.when( + () -> Requestor.request(Requestor.RequestMethod.GET, "addresses", params, AddressCollection.class, + vcr.client)).thenReturn(fakeCollection); + + AddressCollection collection = vcr.client.address.all(params); + + boolean hitEnd = false; + + while (!hitEnd) { + try { + collection = vcr.client.address.getNextPage(collection); + } catch (EndOfPaginationError e) { // only catch the error we're expecting + hitEnd = true; + } + } + + assertTrue(hitEnd); + + requestMock.close(); + } +} diff --git a/src/test/java/com/easypost/ParcelTest.java b/src/test/java/com/easypost/ParcelTest.java new file mode 100644 index 000000000..8ffcab73e --- /dev/null +++ b/src/test/java/com/easypost/ParcelTest.java @@ -0,0 +1,66 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.Parcel; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class ParcelTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("parcel", TestUtils.ApiKey.TEST); + } + + /** + * Test creating a Parcel. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Parcel parcel = createBasicParcel(); + + assertInstanceOf(Parcel.class, parcel); + assertTrue(parcel.getId().startsWith("prcl_")); + assertEquals(15.4, parcel.getWeight(), 0.01); + } + + /** + * Create a parcel. + * + * @return Parcel object + */ + private static Parcel createBasicParcel() throws EasyPostException { + return vcr.client.parcel.create(Fixtures.basicParcel()); + } + + /** + * Test retrieving a Parcel. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Parcel parcel = createBasicParcel(); + + Parcel retrievedParcel = vcr.client.parcel.retrieve(parcel.getId()); + + assertInstanceOf(Parcel.class, retrievedParcel); + assertTrue(parcel.equals(retrievedParcel)); + } +} diff --git a/src/test/java/com/easypost/PaymentMethodTest.java b/src/test/java/com/easypost/PaymentMethodTest.java new file mode 100644 index 000000000..d355d98e3 --- /dev/null +++ b/src/test/java/com/easypost/PaymentMethodTest.java @@ -0,0 +1,38 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.PaymentMethod; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class PaymentMethodTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("payment_method", TestUtils.ApiKey.PRODUCTION); + } + + /** + * Test retrieving all payment methods. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + PaymentMethod paymentMethod = vcr.client.billing.retrievePaymentMethods(); + + assertInstanceOf(PaymentMethod.class, paymentMethod); + assertTrue(paymentMethod.getId().startsWith("cust_")); + } +} diff --git a/src/test/java/com/easypost/PickupTest.java b/src/test/java/com/easypost/PickupTest.java new file mode 100644 index 000000000..280f6e585 --- /dev/null +++ b/src/test/java/com/easypost/PickupTest.java @@ -0,0 +1,231 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.model.Pickup; +import com.easypost.model.PickupCollection; +import com.easypost.model.PickupRate; +import com.easypost.model.Shipment; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class PickupTest { + // Remember to bump the pickup date if you need to re-record the cassette + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("pickup", TestUtils.ApiKey.TEST); + } + + /** + * Create a pickup. + * + * @return Pickup object + */ + private static Pickup createBasicPickup() throws EasyPostException { + Shipment shipment = vcr.client.shipment.create(Fixtures.oneCallBuyShipment()); + + Map pickupData = Fixtures.basicPickup(); + pickupData.put("shipment", shipment); + + return vcr.client.pickup.create(pickupData); + } + + /** + * Test retrieving all shipments. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap(); + params.put("page_size", Fixtures.pageSize()); + + PickupCollection pickupCollection = vcr.client.pickup.all(params); + + List pickups = pickupCollection.getPickups(); + + assertTrue(pickups.size() <= Fixtures.pageSize()); + assertNotNull(pickupCollection.getHasMore()); + assertTrue(pickups.stream().allMatch(pickup -> pickup != null)); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + PickupCollection collection = vcr.client.pickup.all(params); + + try { + PickupCollection nextPage = vcr.client.pickup.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getPickups().get(0).getId(); + String firstIdOfSecondPage = nextPage.getPickups().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Test creating a pickup. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Pickup pickup = createBasicPickup(); + + assertInstanceOf(Pickup.class, pickup); + assertTrue(pickup.getId().startsWith("pickup_")); + assertNotNull(pickup.getPickupRates()); + } + + /** + * Test retrieving a pickup. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Pickup pickup = createBasicPickup(); + + Pickup retrievedPickup = vcr.client.pickup.retrieve(pickup.getId()); + + assertInstanceOf(Pickup.class, retrievedPickup); + assertTrue(pickup.equals(retrievedPickup)); + } + + /** + * Test buying a pickup. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuy() throws EasyPostException, InterruptedException { + vcr.setUpTest("buy"); + + Pickup pickup = createBasicPickup(); + + Map params = new HashMap(); + params.put("carrier", Fixtures.usps()); + params.put("service", Fixtures.pickupService()); + + Pickup boughtPickup = vcr.client.pickup.buy(pickup.getId(), params); + + assertInstanceOf(Pickup.class, boughtPickup); + assertTrue(boughtPickup.getId().startsWith("pickup_")); + assertNotNull(boughtPickup.getConfirmation()); + assertEquals("scheduled", boughtPickup.getStatus()); + } + + /** + * Test buying a pickup by specifying a pickup rate. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuyWithRate() throws EasyPostException { + vcr.setUpTest("buy_with_rate"); + + Pickup pickup = createBasicPickup(); + + Pickup boughtPickup = vcr.client.pickup.buy(pickup.getId(), pickup.lowestRate()); + + assertInstanceOf(Pickup.class, boughtPickup); + assertTrue(boughtPickup.getId().startsWith("pickup_")); + assertNotNull(boughtPickup.getConfirmation()); + assertEquals("scheduled", boughtPickup.getStatus()); + } + + /** + * Test cancelling a pickup. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCancel() throws EasyPostException, InterruptedException { + vcr.setUpTest("cancel"); + + Pickup pickup = createBasicPickup(); + + Map params = new HashMap<>(); + params.put("carrier", Fixtures.usps()); + params.put("service", Fixtures.pickupService()); + Pickup boughtPickup = vcr.client.pickup.buy(pickup.getId(), params); + + Pickup cancelledPickup = vcr.client.pickup.cancel(boughtPickup.getId()); + + assertInstanceOf(Pickup.class, cancelledPickup); + assertTrue(cancelledPickup.getId().startsWith("pickup_")); + assertEquals("canceled", cancelledPickup.getStatus()); + } + + /** + * Test getting the lowest rate of a pickup. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testLowestRate() throws EasyPostException { + vcr.setUpTest("lowest_rate"); + + Pickup pickup = createBasicPickup(); + + // Test lowest rate with no filters + PickupRate lowestRate = pickup.lowestRate(); + assertEquals("NextDay", lowestRate.getService()); + assertEquals(0.00, lowestRate.getRate(), 0.01); + assertEquals("USPS", lowestRate.getCarrier()); + + // Test lowest rate with service filter (should error due to bad service) + List services = new ArrayList<>(Arrays.asList("BAD SERVICE")); + assertThrows(EasyPostException.class, () -> { + pickup.lowestRate(null, services); + }); + + // Test lowest rate with carrier filter (should error due to bad carrier) + List carriers = new ArrayList<>(Arrays.asList("BAD CARRIER")); + assertThrows(EasyPostException.class, () -> { + pickup.lowestRate(carriers, null); + }); + } +} diff --git a/src/test/java/com/easypost/RateTest.java b/src/test/java/com/easypost/RateTest.java new file mode 100644 index 000000000..782eb6ce3 --- /dev/null +++ b/src/test/java/com/easypost/RateTest.java @@ -0,0 +1,42 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.Rate; +import com.easypost.model.Shipment; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public final class RateTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("rate", TestUtils.ApiKey.TEST); + } + + /** + * Test retrieving a rate. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Shipment shipment = vcr.client.shipment.create(Fixtures.basicShipment()); + Rate rate = shipment.getRates().get(0); + + Rate retrievedRate = vcr.client.rate.retrieve(rate.getId()); + + assertInstanceOf(Rate.class, rate); + assertTrue(rate.equals(retrievedRate)); + } +} diff --git a/src/test/java/com/easypost/ReferralCustomerTest.java b/src/test/java/com/easypost/ReferralCustomerTest.java new file mode 100644 index 000000000..fecd51a5e --- /dev/null +++ b/src/test/java/com/easypost/ReferralCustomerTest.java @@ -0,0 +1,218 @@ +package com.easypost; + +import com.easypost.exception.API.ExternalApiError; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.API.InvalidRequestError; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.exception.API.NotFoundError; +import com.easypost.model.PaymentMethod; +import com.easypost.model.PaymentMethodObject; +import com.easypost.model.ReferralCustomer; +import com.easypost.model.ReferralCustomerCollection; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class ReferralCustomerTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("referral_customer", TestUtils.ApiKey.PARTNER); + } + + /** + * Return the referral user key from the system environment. + * + * @return Referral user key. + */ + private static String referralUserKey() { + return TestUtils.getApiKey(TestUtils.ApiKey.REFERRAL); + } + + /** + * Create a referral. + * + * @return Referral object + */ + private static ReferralCustomer createReferral() throws EasyPostException { + return vcr.client.referralCustomer.create(Fixtures.referralUser()); + } + + /** + * Test creating a Referral object. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + ReferralCustomer referralUser = createReferral(); + + assertInstanceOf(ReferralCustomer.class, referralUser); + assertTrue(referralUser.getId().startsWith("user_")); + assertEquals("Test Referral", referralUser.getName()); + } + + /** + * Test updating a Referral object. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testUpdate() throws EasyPostException { + vcr.setUpTest("update"); + + ReferralCustomer referralUser = createReferral(); + + assertDoesNotThrow(() -> vcr.client.referralCustomer.updateEmail("email@example.com", referralUser.getId())); + } + + /** + * Test retrieving all Referral objects. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap(); + params.put("page_size", Fixtures.pageSize()); + + ReferralCustomerCollection referralCustomerCollection = vcr.client.referralCustomer.all(params); + + List referralUsers = referralCustomerCollection.getReferralCustomers(); + + assertTrue(referralUsers.size() <= Fixtures.pageSize()); + assertNotNull(referralCustomerCollection.getHasMore()); + assertTrue(referralUsers.stream().allMatch(referral -> referral != null)); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + ReferralCustomerCollection collection = vcr.client.referralCustomer.all(params); + + try { + ReferralCustomerCollection nextPage = + vcr.client.referralCustomer.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getReferralCustomers().get(0).getId(); + String firstIdOfSecondPage = nextPage.getReferralCustomers().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Test adding a credit card to a Referral user. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testReferralAddCreditCard() throws Exception { + vcr.setUpTest("referral_add_credit_card"); + + Map creditCardDetails = Fixtures.creditCardDetails(); + PaymentMethodObject creditCard = vcr.client.referralCustomer.addCreditCardToUser(referralUserKey(), + (String) creditCardDetails.get("number"), + Integer.parseInt((String) creditCardDetails.get("expiration_month")), + Integer.parseInt((String) creditCardDetails.get("expiration_year")), + (String) creditCardDetails.get("cvc"), PaymentMethod.Priority.PRIMARY); + + assertInstanceOf(PaymentMethodObject.class, creditCard); + assertTrue(creditCard.getId().startsWith("pm_")); + assertEquals(((String) Fixtures.creditCardDetails().get("number")).substring(12), creditCard.getLast4()); + } + + /** + * Test creating bad Stripe token with invalid input parameters. + * + * @throws Exception when the request fails. + */ + @Test + public void testCreateBadStripeToken() throws Exception { + vcr.setUpTest("create_bad_stripe_token"); + + assertThrows(ExternalApiError.class, + () -> vcr.client.referralCustomer.addCreditCardToUser(referralUserKey(), "1234", 1234, 1234, "1234", + PaymentMethod.Priority.PRIMARY)); + } + + /** + * Test adding a credit card from Stripe for a Referral user raises an error when it fails. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAddCreditCardFromStripe() throws EasyPostException { + vcr.setUpTest("add_credit_card_from_stripe"); + + NotFoundError exception = assertThrows(NotFoundError.class, () -> { + vcr.client.referralCustomer.addCreditCardFromStripe( + referralUserKey(), + Fixtures.billing().paymentMethodId, + PaymentMethod.Priority.PRIMARY + ); + }); + + assertEquals("Stripe::PaymentMethod does not exist for the specified reference_id", exception.getMessage()); + } + + /** + * Test adding a bank account from Stripe for a Referral user raises an error when it fails. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAddBankAccountFromStripe() throws EasyPostException { + vcr.setUpTest("add_bank_account_from_stripe"); + + InvalidRequestError exception = assertThrows(InvalidRequestError.class, () -> { + vcr.client.referralCustomer.addBankAccountFromStripe( + referralUserKey(), + Fixtures.billing().financialConnectionsId, + Fixtures.billing().mandateData, + PaymentMethod.Priority.PRIMARY + ); + }); + + assertEquals( + "account_holder_name must be present when creating a Financial Connections payment method", + exception.getMessage() + ); + } +} diff --git a/src/test/java/com/easypost/RefundTest.java b/src/test/java/com/easypost/RefundTest.java new file mode 100644 index 000000000..f0896c131 --- /dev/null +++ b/src/test/java/com/easypost/RefundTest.java @@ -0,0 +1,133 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.model.Refund; +import com.easypost.model.RefundCollection; +import com.easypost.model.Shipment; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class RefundTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("refund", TestUtils.ApiKey.TEST); + } + + /** + * Test creating a refund. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Shipment shipment = vcr.client.shipment.create(Fixtures.oneCallBuyShipment()); + + // We need to retrieve the shipment so that the tracking_code has time to + // populate + Shipment retrievedShipment = vcr.client.shipment.retrieve(shipment.getId()); + + Map params = new HashMap<>(); + params.put("carrier", Fixtures.usps()); + List trackingCodes = new ArrayList<>(); + trackingCodes.add(retrievedShipment.getTrackingCode()); + params.put("tracking_codes", trackingCodes); + + List refunds = vcr.client.refund.create(params); + + assertTrue(refunds.get(0).getId().startsWith("rfnd_")); + assertEquals("submitted", refunds.get(0).getStatus()); + } + + /** + * Test retrieving all refunds. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + RefundCollection refundCollection = vcr.client.refund.all(params); + + List refunds = refundCollection.getRefunds(); + + assertTrue(refunds.size() <= Fixtures.pageSize()); + assertNotNull(refundCollection.getHasMore()); + assertTrue(refunds.stream().allMatch(refund -> refund != null)); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + RefundCollection collection = vcr.client.refund.all(params); + + try { + RefundCollection nextPage = vcr.client.refund.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getRefunds().get(0).getId(); + String firstIdOfSecondPage = nextPage.getRefunds().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Test retrieving a refund. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + RefundCollection refundCollection = vcr.client.refund.all(params); + List refunds = refundCollection.getRefunds(); + + Refund retrievedRefund = vcr.client.refund.retrieve(refunds.get(0).getId()); + + assertInstanceOf(Refund.class, retrievedRefund); + assertTrue(refunds.get(0).equals(retrievedRefund)); + } +} diff --git a/src/test/java/com/easypost/ReportTest.java b/src/test/java/com/easypost/ReportTest.java new file mode 100644 index 000000000..79c3077e3 --- /dev/null +++ b/src/test/java/com/easypost/ReportTest.java @@ -0,0 +1,223 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.exception.General.MissingParameterError; +import com.easypost.model.Report; +import com.easypost.model.ReportCollection; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class ReportTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("report", TestUtils.ApiKey.TEST); + } + + /** + * Create a report. + * + * @return Report object + */ + private static Report createBasicReport() throws EasyPostException { + Map reportParams = new HashMap<>(); + + reportParams.put("start_date", Fixtures.reportDate()); + reportParams.put("end_date", Fixtures.reportDate()); + reportParams.put("type", Fixtures.reportType()); + + return vcr.client.report.create(reportParams); + } + + /** + * Create a advanced report. + * + * @param parameters Map of parameters for create a advanced report. + * @return Report object + */ + private static Report createAdvancedReport(Map parameters) throws EasyPostException { + parameters.put("start_date", Fixtures.reportDate()); + parameters.put("end_date", Fixtures.reportDate()); + parameters.put("type", Fixtures.reportType()); + + return vcr.client.report.create(parameters); + } + + /** + * Test creating a report. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateReport() throws EasyPostException { + vcr.setUpTest("create_report"); + + Report report = createBasicReport(); + + assertInstanceOf(Report.class, report); + assertTrue(report.getId().startsWith("shprep_")); + } + + /** + * Test creating a report with additional columns. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateReportWithAdditionalColumns() throws EasyPostException { + vcr.setUpTest("create_report_with_additional_columns"); + + Map reportWithAdditionalColumnsParams = new HashMap<>(); + + List additionalColumns = new ArrayList<>(); + additionalColumns.add("from_name"); + additionalColumns.add("from_company"); + reportWithAdditionalColumnsParams.put("additional_columns", additionalColumns); + + Report reportWithColumns = createAdvancedReport(reportWithAdditionalColumnsParams); + + // verify parameters by checking VCR cassette for correct URL + // Some reports take a long time to generate, so we won't be able to + // consistently pull the report + // There's unfortunately no way to check if the columns + // were included in the final report without parsing the CSV + // so we assume, if we haven't gotten an error by this point, we've made the API + // calls correctly + // any failure at this point is a server-side issue + assertInstanceOf(Report.class, reportWithColumns); + } + + /** + * Test creating a report with columns. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateReportWithColumns() throws EasyPostException { + vcr.setUpTest("create_report_with_columns"); + + Map reportWithAdditionalColumnsParams = new HashMap<>(); + + List columns = new ArrayList<>(); + columns.add("usps_zone"); + reportWithAdditionalColumnsParams.put("columns", columns); + + Report reportWithColumns = createAdvancedReport(reportWithAdditionalColumnsParams); + + // verify parameters by checking VCR cassette for correct URL + // Some reports take a long time to generate, so we won't be able to + // consistently pull the report + // There's unfortunately no way to check if the columns + // were included in the final report without parsing the CSV + // so we assume, if we haven't gotten an error by this point, we've made the API + // calls correctly + // any failure at this point is a server-side issue + assertInstanceOf(Report.class, reportWithColumns); + } + + /** + * Test retrieving shipment report. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveReport() throws EasyPostException { + vcr.setUpTest("retrieve_report"); + + Report report = createBasicReport(); + + Report retrievedReport = vcr.client.report.retrieve(report.getId()); + + assertInstanceOf(Report.class, retrievedReport); + assertEquals(report.getStartDate(), retrievedReport.getStartDate()); + assertEquals(report.getEndDate(), retrievedReport.getEndDate()); + } + + /** + * Test retrieving all reports. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all_reports"); + + Map params = new HashMap<>(); + + params.put("type", Fixtures.reportType()); + params.put("page_size", Fixtures.pageSize()); + + ReportCollection reports = vcr.client.report.all(params); + + List reportsList = reports.getReports(); + + assertTrue(reportsList.size() <= Fixtures.pageSize()); + assertNotNull(reports.getHasMore()); + assertTrue(reportsList.stream().allMatch(report -> report != null)); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + params.put("type", Fixtures.reportType()); + ReportCollection collection = vcr.client.report.all(params); + + try { + ReportCollection nextPage = vcr.client.report.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getReports().get(0).getId(); + String firstIdOfSecondPage = nextPage.getReports().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Test creating a report without type. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateReportWithoutType() throws EasyPostException { + Map reportParams = new HashMap<>(); + + reportParams.put("start_date", Fixtures.reportDate()); + reportParams.put("end_date", Fixtures.reportDate()); + + assertThrows(MissingParameterError.class, () -> vcr.client.report.create(reportParams)); + } +} diff --git a/src/test/java/com/easypost/ScanFormTest.java b/src/test/java/com/easypost/ScanFormTest.java new file mode 100644 index 000000000..c169d1c1c --- /dev/null +++ b/src/test/java/com/easypost/ScanFormTest.java @@ -0,0 +1,133 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.model.ScanForm; +import com.easypost.model.ScanFormCollection; +import com.easypost.model.Shipment; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class ScanFormTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("scan_form", TestUtils.ApiKey.TEST); + } + + /** + * Test creating a scan form. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + ScanForm scanForm = getBasicScanForm(); + + assertInstanceOf(ScanForm.class, scanForm); + assertTrue(scanForm.getId().startsWith("sf_")); + } + + /** + * Create a ScanForm. + * + * @return ScanForm object + */ + private static ScanForm getBasicScanForm() throws EasyPostException { + Shipment shipment = vcr.client.shipment.create(Fixtures.oneCallBuyShipment()); + + List shipments = new ArrayList<>(); + shipments.add(shipment); + + Map params = new HashMap<>(); + params.put("shipments", shipments); + + ScanForm scanForm = vcr.client.scanForm.create(params); + return scanForm; + } + + /** + * Test retrieving a scan form. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + ScanForm scanForm = getBasicScanForm(); + + ScanForm retrievedScanForm = vcr.client.scanForm.retrieve(scanForm.getId()); + + assertInstanceOf(ScanForm.class, retrievedScanForm); + assertTrue(scanForm.equals(retrievedScanForm)); + } + + /** + * Test retrieving all scan form. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + ScanFormCollection scanForms = vcr.client.scanForm.all(params); + List scanFormsList = scanForms.getScanForms(); + + assertTrue(scanFormsList.size() <= Fixtures.pageSize()); + assertNotNull(scanForms.getHasMore()); + assertTrue(scanFormsList.stream().allMatch(scanForm -> scanForm != null)); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + ScanFormCollection collection = vcr.client.scanForm.all(params); + + try { + ScanFormCollection nextPage = vcr.client.scanForm.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getScanForms().get(0).getId(); + String firstIdOfSecondPage = nextPage.getScanForms().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } +} diff --git a/src/test/java/com/easypost/ShipmentTest.java b/src/test/java/com/easypost/ShipmentTest.java new file mode 100644 index 000000000..18360718a --- /dev/null +++ b/src/test/java/com/easypost/ShipmentTest.java @@ -0,0 +1,770 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.model.Address; +import com.easypost.model.EndShipper; +import com.easypost.model.EstimatedDeliveryDate; +import com.easypost.model.Form; +import com.easypost.model.Parcel; +import com.easypost.model.Rate; +import com.easypost.model.RecommendShipDateForShipmentResult; +import com.easypost.model.Shipment; +import com.easypost.model.ShipmentCollection; +import com.easypost.model.SmartRate; +import com.easypost.model.SmartRateAccuracy; +import com.easypost.utils.Utilities; +import com.google.common.collect.ImmutableList; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class ShipmentTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("shipment", TestUtils.ApiKey.TEST); + } + + /** + * Create a basic shipment. + * + * @return Shipment object + */ + private static Shipment createBasicShipment() throws EasyPostException { + return vcr.client.shipment.create(Fixtures.basicShipment()); + } + + /** + * Test creating a shipment. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Shipment shipment = createFullShipment(); + + assertInstanceOf(Shipment.class, shipment); + assertTrue(shipment.getId().startsWith("shp_")); + assertNotNull(shipment.getRates()); + assertEquals("PNG", shipment.getOptions().get("label_format")); + assertEquals("123", shipment.getOptions().get("invoice_number")); + assertEquals("123", shipment.getReference()); + } + + /** + * Create a full shipment. + * + * @return Shipment object + */ + private static Shipment createFullShipment() throws EasyPostException { + return vcr.client.shipment.create(Fixtures.fullShipment()); + } + + /** + * Test retrieving a shipment. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Shipment shipment = createFullShipment(); + + Shipment retrievedShipment = vcr.client.shipment.retrieve(shipment.getId()); + + assertInstanceOf(Shipment.class, retrievedShipment); + assertTrue(shipment.equals(retrievedShipment)); + } + + /** + * Test retrieving all shipments. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap(); + params.put("page_size", Fixtures.pageSize()); + + ShipmentCollection shipmentCollection = vcr.client.shipment.all(params); + + List shipments = shipmentCollection.getShipments(); + + assertTrue(shipments.size() <= Fixtures.pageSize()); + assertNotNull(shipmentCollection.getHasMore()); + assertTrue(shipments.stream().allMatch(shipment -> shipment != null)); + } + + /** + * Test the parameter handoff when retrieving all shipments. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAllParameterHandOff() throws EasyPostException { + vcr.setUpTest("all_parameter_hand_off"); + + boolean includeChildren = true; + boolean purchased = false; + + Map params = new HashMap(); + params.put("page_size", Fixtures.pageSize()); + + params.put("include_children", includeChildren); + params.put("purchased", purchased); + + ShipmentCollection shipmentCollection = vcr.client.shipment.all(params); + + assertEquals(includeChildren, shipmentCollection.getIncludeChildren()); + assertEquals(purchased, shipmentCollection.getPurchased()); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + ShipmentCollection collection = vcr.client.shipment.all(params); + + try { + ShipmentCollection nextPage = vcr.client.shipment.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getShipments().get(0).getId(); + String firstIdOfSecondPage = nextPage.getShipments().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Test the parameter handoff when constructing the next page parameter map. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPageParameterHandOff() throws EasyPostException { + vcr.setUpTest("get_next_page_parameter_hand_off"); + + boolean includeChildren = true; + boolean purchased = false; + + Map params = new HashMap(); + params.put("page_size", Fixtures.pageSize()); + + params.put("include_children", includeChildren); + params.put("purchased", purchased); + + ShipmentCollection shipmentCollection = vcr.client.shipment.all(params); + + // Can't access protected method directly, need to make a temporary extended + // class, yay + // Downside, ShipmentCollection and Shipment are no longer final because they + // need to be extended + final class ExtendedShipmentCollection extends ShipmentCollection { + + ExtendedShipmentCollection(ShipmentCollection shipmentCollection) { + setPurchased(shipmentCollection.getPurchased()); + setIncludeChildren(shipmentCollection.getIncludeChildren()); + } + + @Override + public List getShipments() { + + final class ExtendedShipment extends Shipment { + @Override + public String getId() { + return "shp_123"; + } + } + + return new ArrayList(ImmutableList.of(new ExtendedShipment())); + } + + public Map getNextPageParams() throws EndOfPaginationError { + return super.buildNextPageParameters(getShipments(), null); + } + } + + ExtendedShipmentCollection extendedShipmentCollection = new ExtendedShipmentCollection(shipmentCollection); + Map nextPageParams = extendedShipmentCollection.getNextPageParams(); + + assertEquals(includeChildren, nextPageParams.get("include_children")); + assertEquals(purchased, nextPageParams.get("purchased")); + } + + /** + * Test buying a shipment with lowest rate. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuyWithRate() throws EasyPostException { + vcr.setUpTest("buy_with_rate"); + + Shipment shipment = createBasicShipment(); + + Shipment boughtShipment = vcr.client.shipment.buy(shipment.getId(), shipment.lowestRate()); + + assertNotNull(boughtShipment.getPostageLabel()); + } + + /** + * Test buying a shipment with params. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuyWithParams() throws EasyPostException { + vcr.setUpTest("buy_with_params"); + + Shipment shipment = createBasicShipment(); + HashMap buyMap = new HashMap(); + buyMap.put("rate", shipment.lowestRate()); + buyMap.put("insurance", 249.99); + + Shipment boughtShipment = vcr.client.shipment.buy(shipment.getId(), buyMap); + + assertNotNull(boughtShipment.getPostageLabel()); + } + + /** + * Test generating a new rate for a shipment. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRegenerateRates() throws EasyPostException { + vcr.setUpTest("regenerate_rates"); + + Shipment shipment = createFullShipment(); + + Shipment shipmentWithNewRates = vcr.client.shipment.newRates(shipment.getId()); + + List rates = shipmentWithNewRates.getRates(); + + assertNotNull(rates); + assertInstanceOf(List.class, rates); + for (Rate rate : rates) { + assertInstanceOf(Rate.class, rate); + } + } + + /** + * Test converting a label for a shipment. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testConvertLabel() throws EasyPostException { + vcr.setUpTest("convert_label"); + + Shipment shipment = createOneCallBuyShipment(); + + Map params = new HashMap<>(); + params.put("file_format", "ZPL"); + + Shipment shipmentWithLabel = vcr.client.shipment.label(shipment.getId(), params); + + assertNotNull(shipmentWithLabel.getPostageLabel().getLabelZplUrl()); + } + + /** + * Create a one-call-buy shipment. + * + * @return Shipment object + */ + private static Shipment createOneCallBuyShipment() throws EasyPostException { + return vcr.client.shipment.create(Fixtures.oneCallBuyShipment()); + } + + /** + * Test insuring a Shipment. + *

+ * If the shipment was purchased with a USPS rate, it must have had its + * insurance set to `0` when bought + * so that USPS doesn't automatically insure it so we could manually insure it + * here. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testInsure() throws EasyPostException { + vcr.setUpTest("insure"); + + Map shipmentData = Fixtures.oneCallBuyShipment(); + // Set to 0 so USPS doesn't insure this automatically and we can insure the + // shipment manually. + shipmentData.put("insurance", 0); + + Map insuranceData = new HashMap<>(); + insuranceData.put("amount", "100"); + + Shipment shipment = vcr.client.shipment.create(shipmentData); + + Shipment shipmentWithInsurance = vcr.client.shipment.insure(shipment.getId(), insuranceData); + + assertEquals("100.00", shipmentWithInsurance.getInsurance()); + } + + /** + * Test refunding a Shipment. + *

+ * Refunding a test shipment must happen within seconds of the shipment being + * created as test shipments naturally + * follow a flow of created -> delivered to cycle through tracking events in + * test mode - as such anything older + * than a few seconds in test mode may not be refundable. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRefund() throws EasyPostException { + vcr.setUpTest("refund"); + + Shipment shipment = createOneCallBuyShipment(); + + Shipment refundedShipment = vcr.client.shipment.refund(shipment.getId()); + + assertEquals("submitted", refundedShipment.getRefundStatus()); + } + + /** + * Test getting SmartRates from a shipment. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testSmartRate() throws EasyPostException { + vcr.setUpTest("smart_rate"); + + Shipment shipment = createBasicShipment(); + + assertNotNull(shipment.getRates()); + Rate rate = shipment.getRates().get(0); + + List smartRates = vcr.client.shipment.smartRates(shipment.getId()); + assertInstanceOf(List.class, smartRates); + SmartRate smartRate = smartRates.get(0); + + assertEquals(rate.getId(), smartRate.getId()); + assertNotNull(smartRate.getTimeInTransit().getPercentile50()); + assertNotNull(smartRate.getTimeInTransit().getPercentile75()); + assertNotNull(smartRate.getTimeInTransit().getPercentile85()); + assertNotNull(smartRate.getTimeInTransit().getPercentile90()); + assertNotNull(smartRate.getTimeInTransit().getPercentile95()); + assertNotNull(smartRate.getTimeInTransit().getPercentile97()); + assertNotNull(smartRate.getTimeInTransit().getPercentile99()); + } + + /** + * Test creating a Shipment with empty or null objects and arrays. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateEmptyObjects() throws EasyPostException { + vcr.setUpTest("create_empty_objects"); + + Map shipmentData = Fixtures.basicShipment(); + + Map customsInfo = new HashMap<>(); + + customsInfo.put("customs_items", new ArrayList()); + shipmentData.put("customs_info", customsInfo); + + shipmentData.put("options", null); + shipmentData.put("tax_identifiers", null); + shipmentData.put("reference", ""); + + Shipment shipment = vcr.client.shipment.create(shipmentData); + + assertInstanceOf(Shipment.class, shipment); + assertTrue(shipment.getId().startsWith("shp_")); + + assertNotNull(shipment.getOptions()); // The EasyPost API populates some default values here + assertEquals(0, shipment.getCustomsInfo().getCustomsItems().size()); + assertNull(shipment.getReference()); + assertNull(shipment.getTaxIdentifiers()); + } + + /** + * Test creating a Shipment with `tax_identifiers`. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateTaxIdentifiers() throws EasyPostException { + vcr.setUpTest("create_tax_identifiers"); + + Map shipmentData = Fixtures.basicShipment(); + + List taxIdentifiers = new ArrayList<>(); + taxIdentifiers.add(Fixtures.taxIdentifier()); + shipmentData.put("tax_identifiers", taxIdentifiers); + + Shipment shipmentWithTaxIdentifiers = vcr.client.shipment.create(shipmentData); + + assertInstanceOf(Shipment.class, shipmentWithTaxIdentifiers); + assertTrue(shipmentWithTaxIdentifiers.getId().startsWith("shp_")); + assertEquals("IOSS", shipmentWithTaxIdentifiers.getTaxIdentifiers().get(0).getTaxIdType()); + } + + /** + * Test creating a shipment when only IDs are used. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateWithIds() throws EasyPostException { + vcr.setUpTest("create_with_ids"); + + // VCR will overwrite the first address recording if the parameters are the + // exact same, + // which will cause us to lose the response from the first address creation and + // cause the replay to fail. + // So wee need to use two different addresses here. + Address fromAddress = vcr.client.address.create(Fixtures.caAddress1()); + Address toAddress = vcr.client.address.create(Fixtures.caAddress2()); + Parcel parcel = vcr.client.parcel.create(Fixtures.basicParcel()); + + Map shipmentData = Fixtures.basicShipment(); + shipmentData.put("from_address", Collections.singletonMap("id", fromAddress.getId())); + shipmentData.put("to_address", Collections.singletonMap("id", toAddress.getId())); + shipmentData.put("parcel", Collections.singletonMap("id", parcel.getId())); + + Shipment shipment = vcr.client.shipment.create(shipmentData); + + assertInstanceOf(Shipment.class, shipment); + assertTrue(shipment.getId().startsWith("shp_")); + assertTrue(shipment.getToAddress().getId().startsWith("adr_")); + assertTrue(shipment.getFromAddress().getId().startsWith("adr_")); + assertTrue(shipment.getParcel().getId().startsWith("prcl_")); + assertEquals("388 Townsend St", shipment.getFromAddress().getStreet1()); + } + + /** + * Test getting the lowest rate of a shipment. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testLowestRate() throws EasyPostException { + vcr.setUpTest("lowest_rate"); + + Shipment shipment = createFullShipment(); + + // Test lowest rate with no filters + Rate lowestRate = shipment.lowestRate(); + assertEquals("GroundAdvantage", lowestRate.getService()); + assertEquals(5.93, lowestRate.getRate(), 0.01); + assertEquals("USPS", lowestRate.getCarrier()); + + // Test lowest rate with service filter (this rate is higher than the lowest but + // should filter) + List service = new ArrayList<>(Arrays.asList("Priority")); + Rate lowestRateService = shipment.lowestRate(null, service); + assertEquals("Priority", lowestRateService.getService()); + assertEquals(6.90, lowestRateService.getRate(), 0.01); + assertEquals("USPS", lowestRateService.getCarrier()); + + // Test lowest rate with carrier filter (should error due to bad carrier) + List carrier = new ArrayList<>(Arrays.asList("BAD CARRIER")); + assertThrows(EasyPostException.class, () -> { + shipment.lowestRate(carrier, null); + }); + } + + /** + * Test getting the lowest SmartRate of a shipment. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testInstanceLowestSmartRate() throws EasyPostException { + vcr.setUpTest("lowest_smartrate"); + + Shipment shipment = createBasicShipment(); + SmartRate lowestSmartRateFilters = vcr.client.shipment.lowestSmartRate(shipment.getId(), 3, + SmartRateAccuracy.Percentile90); + + // Test lowest smartrate with valid filters + assertEquals("GroundAdvantage", lowestSmartRateFilters.getService()); + assertEquals(5.93, lowestSmartRateFilters.getRate(), 0.01); + assertEquals("USPS", lowestSmartRateFilters.getCarrier()); + + // Test lowest smartrate with invalid filters (should error due to strict + // delivery days) + assertThrows(EasyPostException.class, () -> { + vcr.client.shipment.lowestSmartRate(shipment.getId(), 0, SmartRateAccuracy.Percentile90); + }); + } + + /** + * Test getting smart rates for a shipment. + * + * @throws EasyPostException if an exception is thrown. + */ + @Test + public void testGetSmartRate() throws EasyPostException { + vcr.setUpTest("get_smartrate_list"); + + Shipment shipment = createBasicShipment(); + + List rates = vcr.client.shipment.smartRates(shipment.getId()); + + assertInstanceOf(List.class, rates); + + for (SmartRate rate : rates) { + assertInstanceOf(SmartRate.class, rate); + } + } + + /** + * Test retriving lowest smart rate. + * + * @throws EasyPostException if an exception is thrown. + */ + @Test + public void testFindLowestSmartRate() throws EasyPostException { + vcr.setUpTest("get_lowest_smartrate"); + + Shipment shipment = createBasicShipment(); + + List rates = vcr.client.shipment.smartRates(shipment.getId()); + SmartRate lowestSmartRate = vcr.client.shipment.findLowestSmartRate(rates, 3, SmartRateAccuracy.Percentile85); + + assertEquals("GroundAdvantage", lowestSmartRate.getService()); + assertEquals(5.93, lowestSmartRate.getRate(), 0.01); + assertEquals("USPS", lowestSmartRate.getCarrier()); + } + + /** + * Test getting the lowest smartrate from a list of smartrates. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testStaticLowestSmartRates() throws EasyPostException { + vcr.setUpTest("lowest_smartrate_list"); + + Shipment shipment = createBasicShipment(); + List smartRates = vcr.client.shipment.smartRates(shipment.getId()); + + // Test lowest smartrate with valid filters + SmartRate lowestSmartRate = Utilities.findLowestSmartRate(smartRates, 3, SmartRateAccuracy.Percentile90); + assertEquals("GroundAdvantage", lowestSmartRate.getService()); + assertEquals(5.93, lowestSmartRate.getRate(), 0.01); + assertEquals("USPS", lowestSmartRate.getCarrier()); + + // Test lowest smartrate with invalid filters (should error due to strict + // delivery days) + assertThrows(EasyPostException.class, () -> { + Utilities.findLowestSmartRate(smartRates, 0, SmartRateAccuracy.Percentile90); + }); + } + + /** + * Test generating a form from a shipment. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGenerateForm() throws EasyPostException { + vcr.setUpTest("generate_form_with"); + + Shipment shipment = createOneCallBuyShipment(); + String formType = "return_packing_slip"; + + Shipment shipmentWithForm = vcr.client.shipment.generateForm(shipment.getId(), formType); + + assertTrue(shipmentWithForm.getForms().size() > 0); + + Form form = shipmentWithForm.getForms().get(0); + + assertEquals(formType, form.getFormType()); + assertTrue(form.getFormUrl() != null); + } + + /** + * Test generating a form from a shipment with option. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGenerateFormWithOption() throws EasyPostException { + vcr.setUpTest("generate_form_with_option"); + + Shipment shipment = createOneCallBuyShipment(); + String formType = "return_packing_slip"; + + Shipment shipmentWithForm = vcr.client.shipment.generateForm(shipment.getId(), formType, + Fixtures.rmaFormOptions()); + + assertTrue(shipmentWithForm.getForms().size() > 0); + + Form form = shipmentWithForm.getForms().get(0); + + assertEquals(formType, form.getFormType()); + assertTrue(form.getFormUrl() != null); + } + + /** + * Test buying a shipment with an EndShipper ID with lowest rate. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuyShipmentWithEndShipperIdWithRate() throws EasyPostException { + vcr.setUpTest("buy_shipment_with_end_shipper_id_with_rate"); + + EndShipper endShipper = vcr.client.endShipper.create(Fixtures.caAddress1()); + + Shipment shipment = vcr.client.shipment.create(Fixtures.basicShipment()); + Shipment boughtShipment = vcr.client.shipment.buy(shipment.getId(), shipment.lowestRate(), endShipper.getId()); + + assertNotNull(boughtShipment.getPostageLabel()); + } + + /** + * Test buying a shipment with an EndShipper ID with params. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuyShipmentWithEndShipperId() throws EasyPostException { + vcr.setUpTest("buy_shipment_with_end_shipper_id_with_rate_with_params"); + + EndShipper endShipper = vcr.client.endShipper.create(Fixtures.caAddress1()); + + Shipment shipment = vcr.client.shipment.create(Fixtures.basicShipment()); + HashMap buyMap = new HashMap(); + buyMap.put("rate", shipment.lowestRate()); + buyMap.put("insurance", 249.99); + + Shipment boughtShipment = vcr.client.shipment.buy(shipment.getId(), buyMap, endShipper.getId()); + + assertNotNull(boughtShipment.getPostageLabel()); + } + + /** + * Tests that we retrieve time-in-transit data for each of the Rates of a + * Shipment. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveEstimatedDeliveryDate() throws EasyPostException { + vcr.setUpTest("retrieve_estimated_delivery_date"); + + Shipment shipment = vcr.client.shipment.create(Fixtures.basicShipment()); + + List estimatedDeliveryDates = vcr.client.shipment + .retrieveEstimatedDeliveryDate(shipment.getId(), Fixtures.plannedShipDate()); + for (EstimatedDeliveryDate estimatedDeliveryDate : estimatedDeliveryDates) { + assertNotNull(estimatedDeliveryDate.getEasypostTimeInTransitData()); + assertNotNull(estimatedDeliveryDate.getEasypostTimeInTransitData().getEasypostEstimatedDeliveryDate()); + assertNotNull(estimatedDeliveryDate.getEasypostTimeInTransitData().getDaysInTransit()); + assertNotNull(estimatedDeliveryDate.getEasypostTimeInTransitData().getDaysInTransit().getPercentile99()); + } + } + + /** + * Test that we retrieve SmartRates when providing a shipment and desired + * delivery date. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveRecommendDate() throws EasyPostException { + vcr.setUpTest("retrieve_recommend_date"); + + Shipment shipment = vcr.client.shipment.create(Fixtures.basicShipment()); + + List estimatedDeliveryDates = vcr.client.shipment + .recommendShipDate(shipment.getId(), Fixtures.desiredDeliveryDate()); + for (RecommendShipDateForShipmentResult estimatedDeliveryDate : estimatedDeliveryDates) { + assertNotNull(estimatedDeliveryDate.getEasypostTimeInTransitData()); + } + } + + /** + * Test that we create and buy a Shipment with Luma. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreateAndBuyLuma() throws EasyPostException { + vcr.setUpTest("create_and_buy_luma"); + + Map shipmentData = Fixtures.oneCallBuyShipment(); + shipmentData.remove("service"); + shipmentData.put("ruleset_name", Fixtures.lumaRulesetName()); + shipmentData.put("planned_ship_date", Fixtures.lumaPlannedShipDate()); + + Shipment shipment = vcr.client.shipment.createAndBuyLuma(shipmentData); + + assertNotNull(shipment.getPostageLabel()); + } + + /** + * Test that we buy a Shipment with Luma. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testBuyLuma() throws EasyPostException { + vcr.setUpTest("buy_luma"); + + Shipment shipment = vcr.client.shipment.create(Fixtures.basicShipment()); + + Map params = new HashMap(); + params.put("ruleset_name", Fixtures.lumaRulesetName()); + params.put("planned_ship_date", Fixtures.lumaPlannedShipDate()); + + Shipment boughtShipment = vcr.client.shipment.buyLuma( + shipment.getId(), + params + ); + + assertNotNull(boughtShipment.getPostageLabel()); + } +} diff --git a/src/test/java/com/easypost/SmartRateTest.java b/src/test/java/com/easypost/SmartRateTest.java new file mode 100644 index 000000000..a51c913a5 --- /dev/null +++ b/src/test/java/com/easypost/SmartRateTest.java @@ -0,0 +1,70 @@ +package com.easypost; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.DeliveryDateForZipPairEstimate; +import com.easypost.model.EstimateDeliveryDateForZipPairResult; +import com.easypost.model.RecommendShipDateForZipPairResult; +import com.easypost.model.ShipDateForZipPairRecommendation; + +public class SmartRateTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("smart_rate", TestUtils.ApiKey.TEST); + } + + /** + * Test that we retrieve SmartRates when provided a from/to zip and desired delivery date. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveRecommendShipDate() throws EasyPostException { + vcr.setUpTest("retrieve_recommend_ship_date"); + Map params = new HashMap(); + params.put("from_zip", Fixtures.caAddress1().get("zip")); + params.put("to_zip", Fixtures.caAddress2().get("zip")); + params.put("desired_delivery_date", Fixtures.desiredDeliveryDate()); + params.put("carriers", Collections.singletonList(Fixtures.usps())); + + RecommendShipDateForZipPairResult results = vcr.client.smartRate.recommendShipDate(params); + for (ShipDateForZipPairRecommendation entry : results.getResults()) { + assertNotNull(entry.getEasypostTimeInTransitData()); + } + } + + /** + * Test that we retrieve SmartRates when provided a from/to zip and planned ship date. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveEstimatedDeliveryDate() throws EasyPostException { + vcr.setUpTest("retrieve_estimated_delivery_date"); + Map params = new HashMap(); + params.put("from_zip", Fixtures.caAddress1().get("zip")); + params.put("to_zip", Fixtures.caAddress2().get("zip")); + params.put("planned_ship_date", Fixtures.plannedShipDate()); + params.put("carriers", Collections.singletonList(Fixtures.usps())); + + EstimateDeliveryDateForZipPairResult results = vcr.client.smartRate.estimateDeliveryDate(params); + for (DeliveryDateForZipPairEstimate entry : results.getResults()) { + assertNotNull(entry.getEasypostTimeInTransitData()); + } + } +} diff --git a/src/test/java/com/easypost/TestUtils.java b/src/test/java/com/easypost/TestUtils.java new file mode 100644 index 000000000..2f4b04237 --- /dev/null +++ b/src/test/java/com/easypost/TestUtils.java @@ -0,0 +1,250 @@ +package com.easypost; + +import com.easypost.easyvcr.AdvancedSettings; +import com.easypost.easyvcr.Cassette; +import com.easypost.easyvcr.CensorElement; +import com.easypost.easyvcr.Censors; +import com.easypost.easyvcr.ExpirationActions; +import com.easypost.easyvcr.MatchRules; +import com.easypost.easyvcr.Mode; +import com.easypost.easyvcr.TimeFrame; +import com.easypost.exception.General.MissingParameterError; +import com.easypost.service.EasyPostClient; +import com.google.common.collect.ImmutableList; + +import javax.net.ssl.HttpsURLConnection; +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.function.Function; + +public abstract class TestUtils { + public enum ApiKey { + TEST, + PRODUCTION, + REFERRAL, + PARTNER + } + + private static final String API_KEY_FAILED_TO_PULL = "couldNotPullApiKey"; + private static final String CASSETTES_PATH = "src/test/cassettes"; + private static final List HEADER_CENSORS = ImmutableList.of("Authorization", "User-Agent"); + private static final List QUERY_CENSORS = ImmutableList.of("card[cvc]", "card[number]"); + private static final List BODY_CENSORS = + ImmutableList.of("api_keys", "client_ip", "credentials", "key", "keys", "phone_number", "phone", + "test_credentials"); + private static final List BODY_ELEMENTS_TO_IGNORE_ON_MATCH = + ImmutableList.of(new CensorElement("createdAt", false), new CensorElement("updatedAt", false)); + + /** + * Get the directory where the program is currently executing. + * + * @return The directory where the program is currently executing + */ + public static String getSourceFileDirectory() { + try { + return Paths.get("").toAbsolutePath().toString(); + } catch (Exception e) { + return ""; + } + } + + /** + * Read the contents of a file. + * + * @param path The path to the file + * @return The contents of the file + */ + public static String readFile(Path path) { + List data; + try { + data = java.nio.file.Files.readAllLines(path); + } catch (IOException ignored) { + return null; + } + if (data.isEmpty()) { + return null; + } + StringBuilder contents = new StringBuilder(); + for (String line : data) { + contents.append(line); + } + return contents.toString(); + } + + /** + * Get an API key from the environment. + * + * @param apiKey Type of API key to get + * @return the API key from the environment + */ + public static String getApiKey(ApiKey apiKey) { + String keyName = ""; + switch (apiKey) { + case TEST: + keyName = "EASYPOST_TEST_API_KEY"; + break; + case PRODUCTION: + keyName = "EASYPOST_PROD_API_KEY"; + break; + case REFERRAL: + keyName = "REFERRAL_CUSTOMER_PROD_API_KEY"; + break; + case PARTNER: + keyName = "PARTNER_USER_PROD_API_KEY"; + break; + default: + break; + } + + String value = System.getenv(keyName); + value = (value != null && !value.isEmpty()) ? value : API_KEY_FAILED_TO_PULL; // if can't pull from environment, + // will use a fake key. Won't + // matter on replay. + return value; + } + + public static final class VCR { + private final com.easypost.easyvcr.VCR vcr; + private String testCassettesFolder; + private String apiKey; + EasyPostClient client; + + /** + * Get whether the VCR is recording. + * + * @return true if recording, false otherwise. + */ + public boolean isRecording() { + return vcr.getMode() == Mode.Record; + } + + /** + * Constructor. + * + * @throws MissingParameterError if a required parameter is missing. + */ + public VCR() throws MissingParameterError { + this(null, ApiKey.TEST); + } + + /** + * Constructor. + * + * @param testCassettesFolder The folder where the cassettes will be stored. + * @throws MissingParameterError if a required parameter is missing. + */ + public VCR(String testCassettesFolder) throws MissingParameterError { + this(testCassettesFolder, ApiKey.TEST); + } + + /** + * Constructor. + * + * @param testCassettesFolder The folder where the cassettes will be stored. + * @param apiKey The API key to use. + * @throws MissingParameterError if a required parameter is missing. + */ + public VCR(String testCassettesFolder, ApiKey apiKey) throws MissingParameterError { + this(testCassettesFolder, getApiKey(apiKey)); + } + + /** + * Constructor. + * + * @param apiKey The API key to use. + * @throws MissingParameterError if a required parameter is missing. + */ + public VCR(ApiKey apiKey) throws MissingParameterError { + this(null, apiKey); + } + + /** + * Constructor. + * + * @param testCassettesFolder The folder where the cassettes will be stored. + * @param apiKey The API key to use. + * @throws MissingParameterError if a required parameter is missing. + */ + public VCR(String testCassettesFolder, String apiKey) throws MissingParameterError { + AdvancedSettings advancedSettings = new AdvancedSettings(); + advancedSettings.matchRules = + new MatchRules().byMethod().byFullUrl().byBody(BODY_ELEMENTS_TO_IGNORE_ON_MATCH); + advancedSettings.censors = new Censors("REDACTED").censorHeadersByKeys(HEADER_CENSORS) + .censorQueryParametersByKeys(QUERY_CENSORS).censorBodyElementsByKeys(BODY_CENSORS); + + advancedSettings.timeFrame = TimeFrame.months12(); + advancedSettings.whenExpired = ExpirationActions.Warn; + + vcr = new com.easypost.easyvcr.VCR(advancedSettings); + + this.apiKey = apiKey; + this.client = new EasyPostClient(apiKey); + this.testCassettesFolder = + Paths.get(getSourceFileDirectory(), CASSETTES_PATH).toString(); // create the "cassettes" folder + + if (testCassettesFolder != null) { + this.testCassettesFolder = Paths.get(this.testCassettesFolder, testCassettesFolder) + .toString(); // create test group folder in cassettes folder + } + + // if folder doesn't exist, create it + File directory = new File(this.testCassettesFolder); + if (!directory.exists()) { + directory.mkdirs(); + } + } + + /** + * Set up the VCR for a unit test. + * + * @param cassetteName The name of the cassette to use. + * @throws MissingParameterError if a required parameter is missing. + */ + public void setUpTest(String cassetteName) throws MissingParameterError { + setUpTest(cassetteName, ""); + } + + /** + * Set up the VCR for a unit test. + * + * @param cassetteName The name of the cassette to use. + * @param overrideApiKey The API key to use. + * @throws MissingParameterError if a required parameter is missing. + */ + public void setUpTest(String cassetteName, String overrideApiKey) throws MissingParameterError { + // override api key if needed + client = new EasyPostClient(overrideApiKey.isEmpty() ? this.apiKey : overrideApiKey); + + // set up cassette + Cassette cassette = new Cassette(testCassettesFolder, cassetteName); + + String filePath = Paths.get(testCassettesFolder, cassetteName + ".json").toString(); + File cassetteFile = new File(filePath); + + // add cassette to vcr + vcr.insert(cassette); + + if (!cassetteFile.exists()) { + // if cassette doesn't exist, switch to record mode + vcr.record(); + } else { + // if cassette exists, switch to replay mode + vcr.replay(); + } + + Function vcrUrlFunction = (url) -> { + try { + return vcr.getHttpUrlConnection(url).openConnectionSecure(); + } catch (Exception vcrException) { + throw new RuntimeException(vcrException); + } + }; + + // set VCR to be used during requests + EasyPost._vcrUrlFunction = vcrUrlFunction; + } + } +} diff --git a/src/test/java/com/easypost/ThreadTest.java b/src/test/java/com/easypost/ThreadTest.java index 75d9f1d9f..1d19199ae 100644 --- a/src/test/java/com/easypost/ThreadTest.java +++ b/src/test/java/com/easypost/ThreadTest.java @@ -1,124 +1,147 @@ package com.easypost; -import com.easypost.model.*; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.Rule; -import org.junit.rules.ExpectedException; +import com.easypost.exception.EasyPostException; +import com.easypost.model.Order; +import com.easypost.service.EasyPostClient; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; -import java.text.ParseException; +import java.util.ArrayList; import java.util.HashMap; -import java.util.Map; import java.util.List; -import java.util.ArrayList; -import java.util.Date; -import java.text.DateFormat; -import java.text.SimpleDateFormat; +import java.util.Map; -import java.lang.InterruptedException; +import static org.junit.jupiter.api.Assertions.assertEquals; + +public final class ThreadTest { + private static Map defaultFromAddress = new HashMap(); + private static Map defaultToAddress = new HashMap(); + private static Map defaultParcel = new HashMap(); + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setUp() throws EasyPostException { + vcr = new TestUtils.VCR("thread", TestUtils.ApiKey.TEST); + + defaultFromAddress.put("name", "EasyPost"); + defaultFromAddress.put("street1", "164 Townsend St"); + defaultFromAddress.put("street2", "Unit 1"); + defaultFromAddress.put("city", "San Francisco"); + defaultFromAddress.put("state", "CA"); + defaultFromAddress.put("zip", "94107"); + defaultFromAddress.put("phone", "415-456-7890"); + + defaultToAddress.put("company", "Airport Shipping"); + defaultToAddress.put("street1", "601 Brasilia Avenue"); + defaultToAddress.put("city", "Kansas City"); + defaultToAddress.put("state", "MO"); + defaultToAddress.put("zip", "64153"); + defaultToAddress.put("phone", "314-924-0383"); + + defaultParcel.put("length", 10.8); + defaultParcel.put("width", 8.3); + defaultParcel.put("height", 6); + defaultParcel.put("weight", 10); + } -import com.easypost.exception.EasyPostException; + /** + * Test thread to create order. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testThreadOrderCreation() throws EasyPostException, InterruptedException { + vcr.setUpTest("thread_order_creation"); + + // create a default set of shipment and order params to feed to the threads + Map shipment1 = orderShipment(); + List> shipments = new ArrayList>(); + shipments.add(shipment1); + Map orderParams = new HashMap(); + orderParams.put("shipments", shipments); + orderParams.put("from_address", defaultFromAddress); + orderParams.put("to_address", defaultToAddress); + + // divide up the orders among the threads + List> orderBatch1 = new ArrayList>(); + List> orderBatch2 = new ArrayList>(); + orderBatch1.add(orderParams); + orderBatch1.add(orderParams); + orderBatch2.add(orderParams); + orderBatch2.add(orderParams); + + System.out.println("Starting CreateOrders threads."); + List threads = new ArrayList(); + threads.add(new Thread(new CreateOrders(orderBatch1))); + threads.add(new Thread(new CreateOrders(orderBatch2))); + + for (Thread thread : threads) { + thread.start(); + } + for (Thread thread : threads) { + thread.join(); + } + System.out.println("Done CreateOrders threads!"); -import static org.junit.Assert.*; - -public class ThreadTest { - static Map defaultFromAddress = new HashMap(); - static Map defaultToAddress = new HashMap(); - static Map defaultParcel = new HashMap(); - - static Map orderShipment() throws EasyPostException { - Map shipmentMap = new HashMap(); - shipmentMap.put("parcel", defaultParcel); - return shipmentMap; - } - - @BeforeClass - public static void setUp() { - EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; - - defaultFromAddress.put("name", "EasyPost"); - defaultFromAddress.put("street1", "164 Townsend St"); - defaultFromAddress.put("street2", "Unit 1"); - defaultFromAddress.put("city", "San Francisco"); - defaultFromAddress.put("state", "CA"); - defaultFromAddress.put("zip", "94107"); - defaultFromAddress.put("phone", "415-456-7890"); - - defaultToAddress.put("company", "Airport Shipping"); - defaultToAddress.put("street1", "601 Brasilia Avenue"); - defaultToAddress.put("city", "Kansas City"); - defaultToAddress.put("state", "MO"); - defaultToAddress.put("zip", "64153"); - defaultToAddress.put("phone", "314-924-0383"); - - defaultParcel.put("length", 10.8); - defaultParcel.put("width", 8.3); - defaultParcel.put("height", 6); - defaultParcel.put("weight", 10); - } - - private static class CreateOrders implements Runnable { - List> orders; - - public CreateOrders(List> orders) { - this.orders = orders; + // for more information on threads including adding timeouts and interrupts see: + // http://docs.oracle.com/javase/tutorial/essential/concurrency/index.html } - public void run() { - try { - for (int i = 0; i < this.orders.size(); i++) { - System.out.format("Thread %s: starting order creation...%n", - Thread.currentThread().getName()); + static Map orderShipment() throws EasyPostException { + Map shipmentMap = new HashMap(); + shipmentMap.put("parcel", defaultParcel); + return shipmentMap; + } - Order order = Order.create(this.orders.get(i)); - // save order id to database or buy now + /** + * Test creating orders. + */ + private static class CreateOrders implements Runnable { + private List> orders; - System.out.format("Thread %s: created order %s%n", - Thread.currentThread().getName(), - order.getId()); + CreateOrders(List> orders) { + this.orders = orders; } - } catch(EasyPostException e) { - System.out.println("EasyPost Exception caught creating order."); - } - } - } - - @Test - public void testThreadOrderCreation() throws EasyPostException, InterruptedException { - - // create a default set of shipment and order params to feed to the threads - Map shipment_1 = orderShipment(); - List> shipments = new ArrayList>(); - shipments.add(shipment_1); - Map orderParams = new HashMap(); - orderParams.put("shipments", shipments); - orderParams.put("from_address", defaultFromAddress); - orderParams.put("to_address", defaultToAddress); - - // divide up the orders among the threads - List> orderBatch1 = new ArrayList>(); - List> orderBatch2 = new ArrayList>(); - orderBatch1.add(orderParams); - orderBatch1.add(orderParams); - orderBatch2.add(orderParams); - orderBatch2.add(orderParams); - - System.out.println("Starting CreateOrders threads."); - List threads = new ArrayList(); - threads.add(new Thread(new CreateOrders(orderBatch1))); - threads.add(new Thread(new CreateOrders(orderBatch2))); - - for (Thread thread : threads) { - thread.start(); - } - for (Thread thread : threads) { - thread.join(); - } - System.out.println("Done CreateOrders threads!"); - // for more information on threads including adding timeouts and interrupts see: - // http://docs.oracle.com/javase/tutorial/essential/concurrency/index.html + @Override + public void run() { + try { + for (int i = 0; i < this.orders.size(); i++) { + System.out.format("Thread %s: starting order creation...%n", Thread.currentThread().getName()); + + EasyPostClient client = new EasyPostClient(System.getenv("EASYPOST_TEST_API_KEY")); + Order order = client.order.create(this.orders.get(i)); + // save order id to database or buy now + + System.out.format("Thread %s: created order %s%n", Thread.currentThread().getName(), order.getId()); + } + } catch (EasyPostException e) { + System.out.println("EasyPost Exception caught creating order."); + } + } + } - } + /** + * Test create multiple EasyPostClient with different API keys. + * + * @throws EasyPostException if an exception is thrown. + */ + @Test + public void testMultipleClients() throws EasyPostException { + EasyPostClient clientOne = new EasyPostClient("fake_api_key_1", 22222, 33333); + EasyPostClient clientTwo = new EasyPostClient("fake_api_key_2", 55555); + + assertEquals("fake_api_key_1", clientOne.getApiKey()); + assertEquals(22222, clientOne.getConnectionTimeoutMilliseconds()); + assertEquals(33333, clientOne.getReadTimeoutMilliseconds()); + + assertEquals("fake_api_key_2", clientTwo.getApiKey()); + assertEquals(55555, clientTwo.getConnectionTimeoutMilliseconds()); + assertEquals(Constants.Http.DEFAULT_READ_TIMEOUT_MILLISECONDS, clientTwo.getReadTimeoutMilliseconds()); + } } - diff --git a/src/test/java/com/easypost/TrackerTest.java b/src/test/java/com/easypost/TrackerTest.java new file mode 100644 index 000000000..f673781ad --- /dev/null +++ b/src/test/java/com/easypost/TrackerTest.java @@ -0,0 +1,246 @@ +package com.easypost; + +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.model.Tracker; +import com.easypost.model.TrackerCollection; +import com.google.common.collect.ImmutableList; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +public final class TrackerTest { + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("tracker", TestUtils.ApiKey.TEST); + } + + /** + * Test creating a tracker. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Tracker tracker = createBasicTracker(); + + assertInstanceOf(Tracker.class, tracker); + assertTrue(tracker.getId().startsWith("trk_")); + assertEquals("pre_transit", tracker.getStatus()); + } + + /** + * Create a tracker. + * + * @return Tracker object + */ + private static Tracker createBasicTracker() throws EasyPostException { + Map params = new HashMap<>(); + params.put("carrier", Fixtures.usps()); + params.put("tracking_code", "EZ1000000001"); + + return vcr.client.tracker.create(params); + } + + /** + * Test retrieving a tracker. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Tracker tracker = createBasicTracker(); + + Tracker retrievedTracker = vcr.client.tracker.retrieve(tracker.getId()); + + assertInstanceOf(Tracker.class, tracker); + assertTrue(retrievedTracker.getId().startsWith("trk_")); + assertEquals(tracker.getId(), retrievedTracker.getId()); + } + + /** + * Test retrieving all trackers. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + TrackerCollection trackers = vcr.client.tracker.all(params); + + List trackersList = trackers.getTrackers(); + + assertTrue(trackersList.size() <= Fixtures.pageSize()); + assertNotNull(trackers.getHasMore()); + assertTrue(trackersList.stream().allMatch(tracker -> tracker != null)); + } + + /** + * Test the parameter handoff when retrieving all trackers. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAllParameterHandOff() throws EasyPostException { + vcr.setUpTest("all_parameter_hand_off"); + + String trackingCode = "something"; + String carrier = "something else"; + + Map params = new HashMap(); + params.put("page_size", Fixtures.pageSize()); + + params.put("tracking_code", trackingCode); + params.put("carrier", carrier); + + TrackerCollection trackerCollection = vcr.client.tracker.all(params); + + assertEquals(trackingCode, trackerCollection.getTrackingCode()); + assertEquals(carrier, trackerCollection.getCarrier()); + } + + /** + * Test retrieving the next page. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + TrackerCollection collection = vcr.client.tracker.all(params); + + try { + TrackerCollection nextPage = vcr.client.tracker.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getTrackers().get(0).getId(); + String firstIdOfSecondPage = nextPage.getTrackers().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } + + /** + * Test the parameter handoff when constructing the next page parameter map. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPageParameterHandOff() throws EasyPostException { + vcr.setUpTest("get_next_page_parameter_hand_off"); + + String trackingCode = "something"; + String carrier = "something else"; + + Map params = new HashMap(); + params.put("page_size", Fixtures.pageSize()); + + params.put("tracking_code", trackingCode); + params.put("carrier", carrier); + + TrackerCollection trackerCollection = vcr.client.tracker.all(params); + + // Can't access protected method directly, need to make a temporary extended class, yay + // Downside, TrackerCollection and Tracker are no longer final because they need to be extended + final class ExtendedTrackerCollection extends TrackerCollection { + + ExtendedTrackerCollection(TrackerCollection trackerCollection) { + setTrackingCode(trackerCollection.getTrackingCode()); + setCarrier(trackerCollection.getCarrier()); + } + + @Override + public List getTrackers() { + + final class ExtendedTracker extends Tracker { + @Override + public String getId() { + return "trk_123"; + } + } + + return new ArrayList(ImmutableList.of(new ExtendedTracker())); + } + + public Map getNextPageParams() throws EndOfPaginationError { + return super.buildNextPageParameters(getTrackers(), null); + } + } + + ExtendedTrackerCollection extendedShipmentCollection = new ExtendedTrackerCollection(trackerCollection); + Map nextPageParams = extendedShipmentCollection.getNextPageParams(); + + assertEquals(trackingCode, nextPageParams.get("tracking_code")); + assertEquals(carrier, nextPageParams.get("carrier")); + } + + /** + * Test retrieving a batch of trackers. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveBatch() throws EasyPostException { + vcr.setUpTest("retrieve_batch"); + + Tracker tracker = createBasicTracker(); + + Map params = new HashMap<>(); + params.put("tracking_codes", ImmutableList.of(tracker.getTrackingCode())); + + TrackerCollection trackers = vcr.client.tracker.retrieveBatch(params); + + List trackersList = trackers.getTrackers(); + + assertTrue(trackersList.stream().allMatch(singleTracker -> singleTracker != null)); + } + + /** + * Test deleting a tracker. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testDelete() throws EasyPostException { + vcr.setUpTest("delete"); + + Tracker tracker = createBasicTracker(); + + // Nothing gets returned here, simply ensure no error gets raised + vcr.client.tracker.delete(tracker.getId()); + } +} diff --git a/src/test/java/com/easypost/UserTest.java b/src/test/java/com/easypost/UserTest.java index cb7574f59..b33ee2bcf 100644 --- a/src/test/java/com/easypost/UserTest.java +++ b/src/test/java/com/easypost/UserTest.java @@ -1,64 +1,236 @@ -/* package com.easypost; -import com.easypost.model.*; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.Rule; -import org.junit.rules.ExpectedException; +import com.easypost.exception.EasyPostException; +import com.easypost.exception.General.EndOfPaginationError; +import com.easypost.model.Brand; +import com.easypost.model.ChildUserCollection; +import com.easypost.model.User; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; -import java.text.ParseException; import java.util.HashMap; -import java.util.Map; import java.util.List; -import java.util.ArrayList; -import java.util.Date; -import java.text.DateFormat; -import java.text.SimpleDateFormat; +import java.util.Map; -import java.lang.InterruptedException; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; -import com.easypost.exception.EasyPostException; +public final class UserTest { + private static String testUserId = null; + private static TestUtils.VCR vcr; -import static org.junit.Assert.*; + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setUp() throws EasyPostException { + vcr = new TestUtils.VCR("user", TestUtils.ApiKey.PRODUCTION); + } -public class UserTest { + /** + * Clean up test attributes after each unit test. + */ + @AfterEach + public void cleanup() { + if (testUserId != null) { + try { + User user = vcr.client.user.retrieve(testUserId); + vcr.client.user.delete(user.getId()); + testUserId = null; + } catch (Exception e) { + // in case we try to delete something that's already been deleted + } + } + } - @BeforeClass - public static void setUp() { - EasyPost.apiKey = "PROD_KEY"; // PROD KEY REQUIRED - } + /** + * Test creating a child user. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); - @Test - public void testRetrieveMe() throws EasyPostException { - User me = User.retrieveMe(); + User user = createUser(); - assertNotNull(me.getName()); - assertNotNull(me.getEmail()); - } + assertInstanceOf(User.class, user); + assertTrue(user.getId().startsWith("user_")); + assertEquals("Test User", user.getName()); + } - @Test - public void testCreateChild() throws EasyPostException { - User child = User.create(); - assertNotNull(child.getName()); - assertNotNull(child.getEmail()); + /** + * Create a user. + * + * @return User object + */ + private static User createUser() throws EasyPostException { + Map params = new HashMap<>(); + params.put("name", "Test User"); + User user = vcr.client.user.create(params); + testUserId = user.getId(); // trigger deletion after test + return user; + } - List childKeys = child.apiKeys(); - assertNotNull(childKeys.get(0).getKey()); // one is test and one is prod - assertNotNull(childKeys.get(1).getKey()); // check getMode() - } + /** + * Test retrieving a user. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); - @Test - public void testEditUser() throws EasyPostException { - User me = User.retrieveMe(); + User authenticatedUser = retrieveMe(); - Map params = new HashMap(); - params.put("name", "New Name2736"); - me.update(params); + String userId = authenticatedUser.getId(); - assertEquals("User was not updated successfully", "New Name2736", me.getName()); - System.out.println(me.prettyPrint()); - } -} -*/ + User user = vcr.client.user.retrieve(userId); + + assertInstanceOf(User.class, user); + assertTrue(user.getId().startsWith("user_")); + assertEquals(userId, user.getId()); + } + + /** + * Retrieve current user. + * + * @return User object + */ + private static User retrieveMe() throws EasyPostException { + return vcr.client.user.retrieveMe(); + } + + /** + * Test retrieving user itself. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieveMe() throws EasyPostException { + vcr.setUpTest("retrieve_me"); + + User user = vcr.client.user.retrieveMe(); + + assertInstanceOf(User.class, user); + assertTrue(user.getId().startsWith("user_")); + } + + /** + * Test updating a user. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testUpdate() throws EasyPostException { + vcr.setUpTest("update"); + + User user = createUser(); + + String testName = "New Name"; + Map params = new HashMap<>(); + + params.put("name", testName); + + User updatedUser = vcr.client.user.update(user.getId(), params); + + assertInstanceOf(User.class, updatedUser); + assertTrue(updatedUser.getId().startsWith("user_")); + assertEquals(testName, updatedUser.getName()); + } + + /** + * Test deleting a user. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testDelete() throws EasyPostException { + vcr.setUpTest("delete"); + + User user = createUser(); + assertDoesNotThrow(() -> vcr.client.user.delete(user.getId())); + } + + /** + * Test updating a brand. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testUpdateBrand() throws EasyPostException { + vcr.setUpTest("update_brand"); + + User user = createUser(); + + String color = "#123456"; + + Map params = new HashMap<>(); + params.put("color", color); + + Brand brand = vcr.client.user.updateBrand(user.getId(), params); + + assertInstanceOf(Brand.class, brand); + assertTrue(brand.getId().startsWith("brd_")); + assertEquals(color, brand.getColor()); + } + + /** + * Test retrieving a paginated list of children. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAllChildren() throws EasyPostException { + vcr.setUpTest("all_children"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + + ChildUserCollection children = vcr.client.user.allChildren(params); + + List childrenList = children.getChildren(); + + assertTrue(childrenList.size() <= Fixtures.pageSize()); + assertNotNull(children.getHasMore()); + assertTrue(childrenList.stream().allMatch(children_user -> children_user != null)); + } + + /** + * Test retrieving the next page of child users. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testGetNextPage() throws EasyPostException { + vcr.setUpTest("get_next_page"); + + Map params = new HashMap<>(); + params.put("page_size", Fixtures.pageSize()); + ChildUserCollection collection = vcr.client.user.allChildren(params); + + try { + ChildUserCollection nextPage = vcr.client.user.getNextPage(collection, Fixtures.pageSize()); + + assertNotNull(nextPage); + + String firstIdOfFirstPage = collection.getChildren().get(0).getId(); + String firstIdOfSecondPage = nextPage.getChildren().get(0).getId(); + + assertNotEquals(firstIdOfFirstPage, firstIdOfSecondPage); + } catch (EndOfPaginationError e) { // There's no next page, that's not a failure + assertTrue(true); + } catch (Exception e) { // Any other exception is a failure + fail(); + } + } +} diff --git a/src/test/java/com/easypost/WebhookTest.java b/src/test/java/com/easypost/WebhookTest.java new file mode 100644 index 000000000..c35f2400f --- /dev/null +++ b/src/test/java/com/easypost/WebhookTest.java @@ -0,0 +1,209 @@ +package com.easypost; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import com.easypost.exception.EasyPostException; +import com.easypost.model.Event; +import com.easypost.model.Webhook; +import com.easypost.model.WebhookCustomHeader; +import com.easypost.utils.Utilities; +import com.google.common.collect.ImmutableMap; + +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +public final class WebhookTest { + private static String testWebhookId = null; + private static TestUtils.VCR vcr; + + /** + * Set up the testing environment for this file. + * + * @throws EasyPostException when the request fails. + */ + @BeforeAll + public static void setup() throws EasyPostException { + vcr = new TestUtils.VCR("webhook", TestUtils.ApiKey.TEST); + } + + /** + * Clean up test attributes after each unit test. + */ + @AfterEach + public void cleanup() { + if (testWebhookId != null) { + try { + vcr.client.webhook.delete(testWebhookId); + testWebhookId = null; + } catch (Exception e) { + // in case we try to delete something that's already been deleted + } + } + } + + /** + * Create a webhook. + * + * @return Webhook object + */ + private static Webhook createBasicWebhook() throws EasyPostException { + Map params = new HashMap<>(); + params.put("url", Fixtures.webhookUrl()); + params.put("webhook_secret", Fixtures.webhookSecret()); + params.put("custom_headers", Fixtures.webhookCustomHeaders()); + + Webhook webhook = vcr.client.webhook.create(params); + testWebhookId = webhook.getId(); // trigger deletion after test + return webhook; + } + + /** + * Test creating a webhook. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testCreate() throws EasyPostException { + vcr.setUpTest("create"); + + Webhook webhook = createBasicWebhook(); + + assertInstanceOf(Webhook.class, webhook); + assertTrue(webhook.getId().startsWith("hook_")); + assertEquals(Fixtures.webhookUrl(), webhook.getUrl()); + WebhookCustomHeader customHeader = webhook.getCustomHeaders().get(0); + assertEquals("test", customHeader.getName()); + assertEquals("header", customHeader.getValue()); + } + + /** + * Test retrieving a webhook. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testRetrieve() throws EasyPostException { + vcr.setUpTest("retrieve"); + + Webhook webhook = createBasicWebhook(); + + Webhook retrievedWebhook = vcr.client.webhook.retrieve(webhook.getId()); + + assertInstanceOf(Webhook.class, retrievedWebhook); + assertTrue(webhook.equals(retrievedWebhook)); + } + + /** + * Test retrieving all webhooks. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testAll() throws EasyPostException { + vcr.setUpTest("all"); + + createBasicWebhook(); + + List webhooks = vcr.client.webhook.all(); + + assertTrue(webhooks.size() > 0); + assertTrue(webhooks.stream().allMatch(webhook -> webhook != null)); + // Test that deserialization worked by accessing a field with an underscore + for (Webhook webhook : webhooks) { + assertTrue(webhook.getCreatedAt() != null); + } + } + + /** + * Test updating a webhook. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testUpdate() throws EasyPostException { + vcr.setUpTest("update"); + + Webhook webhook = createBasicWebhook(); + Map params = new HashMap<>(); + params.put("webhook_secret", Fixtures.webhookSecret()); + params.put("custom_headers", Fixtures.webhookCustomHeaders()); + + Webhook updatedWebhook = vcr.client.webhook.update(webhook.getId(), params); + + assertInstanceOf(Webhook.class, updatedWebhook); + WebhookCustomHeader customHeader = updatedWebhook.getCustomHeaders().get(0); + assertEquals("test", customHeader.getName()); + assertEquals("header", customHeader.getValue()); + } + + /** + * Test deleting a webhook. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testDelete() throws EasyPostException { + vcr.setUpTest("delete"); + + Webhook webhook = createBasicWebhook(); + Webhook retrievedWebhook = vcr.client.webhook.retrieve(webhook.getId()); + + assertDoesNotThrow(() -> vcr.client.webhook.delete(retrievedWebhook.getId())); + + testWebhookId = null; // need to disable post-test deletion for test to work + } + + /** + * Test validating a webhook. + * + * @throws EasyPostException when the request fails. + */ + @Test + public void testValidateWebhook() throws EasyPostException { + Map headers = ImmutableMap.of("X-Hmac-Signature", + Fixtures.webhookHmacSignature()); + + Event event = Utilities.validateWebhook(Fixtures.eventBytes(), headers, Fixtures.webhookSecret()); + + assertEquals("tracker.updated", event.getDescription()); + assertEquals(614.4, event.getResult().get("weight")); // Ensure we convert floats properly + } + + /** + * Test validating a webhook. + */ + @Test + public void testValidateWebhookInvalidSecret() { + String webhookSecret = "invalid_secret"; + Map headers = ImmutableMap.of("X-Hmac-Signature", "some-signature"); + + assertThrows(EasyPostException.class, () -> { + Utilities.validateWebhook(Fixtures.eventBytes(), headers, webhookSecret); + }); + } + + /** + * Test validating a webhook. + */ + @Test + public void testValidateWebhookMissingSecret() { + String webhookSecret = "123"; + Map headers = ImmutableMap.of("some-header", "some-value"); + + assertThrows(EasyPostException.class, () -> { + Utilities.validateWebhook(Fixtures.eventBytes(), headers, webhookSecret); + }); + } +} diff --git a/src/test/java/com/easypost/fixtures/FixtureStructure.java b/src/test/java/com/easypost/fixtures/FixtureStructure.java new file mode 100644 index 000000000..ea4fc94b9 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/FixtureStructure.java @@ -0,0 +1,91 @@ +package com.easypost.fixtures; + +import com.easypost.fixtures.components.Addresses; +import com.easypost.fixtures.components.Billing; +import com.easypost.fixtures.components.CarrierAccounts; +import com.easypost.fixtures.components.CarrierStrings; +import com.easypost.fixtures.components.Claims; +import com.easypost.fixtures.components.CreditCards; +import com.easypost.fixtures.components.CustomsInfos; +import com.easypost.fixtures.components.CustomsItems; +import com.easypost.fixtures.components.FormOptions; +import com.easypost.fixtures.components.Insurances; +import com.easypost.fixtures.components.Luma; +import com.easypost.fixtures.components.Orders; +import com.easypost.fixtures.components.PageSizes; +import com.easypost.fixtures.components.Parcels; +import com.easypost.fixtures.components.Pickups; +import com.easypost.fixtures.components.ReportTypes; +import com.easypost.fixtures.components.ServiceNames; +import com.easypost.fixtures.components.Shipments; +import com.easypost.fixtures.components.TaxIdentifiers; +import com.easypost.fixtures.components.Users; +import com.easypost.fixtures.components.Webhooks; +import com.google.gson.annotations.SerializedName; + +public final class FixtureStructure { + + @SerializedName ("addresses") + public Addresses addresses; + + @SerializedName ("billing") + public Billing billing; + + @SerializedName ("carrier_accounts") + public CarrierAccounts carrierAccounts; + + @SerializedName ("carrier_strings") + public CarrierStrings carrierStrings; + + @SerializedName ("claims") + public Claims claims; + + @SerializedName ("credit_cards") + public CreditCards creditCards; + + @SerializedName ("customs_infos") + public CustomsInfos customsInfos; + + @SerializedName ("customs_items") + public CustomsItems customsItems; + + @SerializedName ("form_options") + public FormOptions formOptions; + + @SerializedName ("insurances") + public Insurances insurances; + + @SerializedName ("luma") + public Luma luma; + + @SerializedName ("orders") + public Orders orders; + + @SerializedName ("page_sizes") + public PageSizes pageSizes; + + @SerializedName ("parcels") + public Parcels parcels; + + @SerializedName ("pickups") + public Pickups pickups; + + @SerializedName ("report_types") + public ReportTypes reportTypes; + + @SerializedName ("service_names") + public ServiceNames serviceNames; + + @SerializedName ("shipments") + public Shipments shipments; + + @SerializedName ("tax_identifiers") + public TaxIdentifiers taxIdentifiers; + + @SerializedName ("users") + public Users users; + + @SerializedName ("webhooks") + public Webhooks webhooks; + +} diff --git a/src/test/java/com/easypost/fixtures/components/Addresses.java b/src/test/java/com/easypost/fixtures/components/Addresses.java new file mode 100644 index 000000000..302a30b28 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Addresses.java @@ -0,0 +1,16 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class Addresses { + @SerializedName ("ca_address_1") + public HashMap caAddress1; + + @SerializedName ("ca_address_2") + public HashMap caAddress2; + + @SerializedName ("incorrect") + public HashMap incorrectAddress; +} diff --git a/src/test/java/com/easypost/fixtures/components/Billing.java b/src/test/java/com/easypost/fixtures/components/Billing.java new file mode 100644 index 000000000..b7432c7a0 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Billing.java @@ -0,0 +1,20 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class Billing { + @SerializedName ("payment_method_id") + public String paymentMethodId; + + @SerializedName ("financial_connections_id") + public String financialConnectionsId; + + @SerializedName ("mandate_data") + public HashMap mandateData; + + @SerializedName ("priority") + public String priority; + +} diff --git a/src/test/java/com/easypost/fixtures/components/CarrierAccounts.java b/src/test/java/com/easypost/fixtures/components/CarrierAccounts.java new file mode 100644 index 000000000..ce3594f77 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/CarrierAccounts.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class CarrierAccounts { + @SerializedName ("basic") + public HashMap basic; + +} diff --git a/src/test/java/com/easypost/fixtures/components/CarrierStrings.java b/src/test/java/com/easypost/fixtures/components/CarrierStrings.java new file mode 100644 index 000000000..af70594d1 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/CarrierStrings.java @@ -0,0 +1,8 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +public final class CarrierStrings { + @SerializedName ("usps") + public String usps; +} diff --git a/src/test/java/com/easypost/fixtures/components/Claims.java b/src/test/java/com/easypost/fixtures/components/Claims.java new file mode 100644 index 000000000..616d532c4 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Claims.java @@ -0,0 +1,10 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class Claims { + @SerializedName ("basic") + public HashMap basic; +} diff --git a/src/test/java/com/easypost/fixtures/components/CreditCards.java b/src/test/java/com/easypost/fixtures/components/CreditCards.java new file mode 100644 index 000000000..7580b9d44 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/CreditCards.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class CreditCards { + @SerializedName ("test") + public HashMap test; + +} diff --git a/src/test/java/com/easypost/fixtures/components/CustomsInfos.java b/src/test/java/com/easypost/fixtures/components/CustomsInfos.java new file mode 100644 index 000000000..85d4fd035 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/CustomsInfos.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class CustomsInfos { + @SerializedName ("basic") + public HashMap basic; + +} diff --git a/src/test/java/com/easypost/fixtures/components/CustomsItems.java b/src/test/java/com/easypost/fixtures/components/CustomsItems.java new file mode 100644 index 000000000..79ab7386b --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/CustomsItems.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class CustomsItems { + @SerializedName ("basic") + public HashMap basic; + +} diff --git a/src/test/java/com/easypost/fixtures/components/FormOptions.java b/src/test/java/com/easypost/fixtures/components/FormOptions.java new file mode 100644 index 000000000..ab687749a --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/FormOptions.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class FormOptions { + @SerializedName ("rma") + public HashMap rma; + +} diff --git a/src/test/java/com/easypost/fixtures/components/Insurances.java b/src/test/java/com/easypost/fixtures/components/Insurances.java new file mode 100644 index 000000000..82ef07273 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Insurances.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class Insurances { + @SerializedName ("basic") + public HashMap basic; + +} diff --git a/src/test/java/com/easypost/fixtures/components/Luma.java b/src/test/java/com/easypost/fixtures/components/Luma.java new file mode 100644 index 000000000..d79be36ce --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Luma.java @@ -0,0 +1,9 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +public final class Luma { + @SerializedName ("ruleset_name") + public String rulesetName; + +} diff --git a/src/test/java/com/easypost/fixtures/components/Orders.java b/src/test/java/com/easypost/fixtures/components/Orders.java new file mode 100644 index 000000000..2b7791fa2 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Orders.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class Orders { + @SerializedName ("basic") + public HashMap basic; + +} diff --git a/src/test/java/com/easypost/fixtures/components/PageSizes.java b/src/test/java/com/easypost/fixtures/components/PageSizes.java new file mode 100644 index 000000000..07ff56423 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/PageSizes.java @@ -0,0 +1,24 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +public final class PageSizes { + @SerializedName ("one_result") + public int one; + + @SerializedName ("five_results") + public int five; + + @SerializedName ("ten_results") + public int ten; + + @SerializedName ("twenty_results") + public int twenty; + + @SerializedName ("fifty_results") + public int fifty; + + @SerializedName ("one_hundred_results") + public int oneHundred; + +} diff --git a/src/test/java/com/easypost/fixtures/components/Parcels.java b/src/test/java/com/easypost/fixtures/components/Parcels.java new file mode 100644 index 000000000..c0499e863 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Parcels.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class Parcels { + @SerializedName ("basic") + public HashMap basic; + +} diff --git a/src/test/java/com/easypost/fixtures/components/Pickups.java b/src/test/java/com/easypost/fixtures/components/Pickups.java new file mode 100644 index 000000000..34f379e3e --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Pickups.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class Pickups { + @SerializedName ("basic") + public HashMap basic; + +} diff --git a/src/test/java/com/easypost/fixtures/components/ReportTypes.java b/src/test/java/com/easypost/fixtures/components/ReportTypes.java new file mode 100644 index 000000000..aa9d52317 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/ReportTypes.java @@ -0,0 +1,9 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +public final class ReportTypes { + @SerializedName ("shipment") + public String shipment; + +} diff --git a/src/test/java/com/easypost/fixtures/components/ServiceNames.java b/src/test/java/com/easypost/fixtures/components/ServiceNames.java new file mode 100644 index 000000000..94dc74836 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/ServiceNames.java @@ -0,0 +1,9 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +public final class ServiceNames { + @SerializedName ("usps") + public ServiceNamesUsps usps; + +} diff --git a/src/test/java/com/easypost/fixtures/components/ServiceNamesUsps.java b/src/test/java/com/easypost/fixtures/components/ServiceNamesUsps.java new file mode 100644 index 000000000..17bbca12b --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/ServiceNamesUsps.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +public final class ServiceNamesUsps { + @SerializedName ("first_service") + public String firstService; + + @SerializedName ("pickup_service") + public String pickupService; +} diff --git a/src/test/java/com/easypost/fixtures/components/Shipments.java b/src/test/java/com/easypost/fixtures/components/Shipments.java new file mode 100644 index 000000000..5cc767dc2 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Shipments.java @@ -0,0 +1,14 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class Shipments { + @SerializedName ("basic_domestic") + public HashMap basicDomestic; + + @SerializedName ("full") + public HashMap full; + +} diff --git a/src/test/java/com/easypost/fixtures/components/TaxIdentifiers.java b/src/test/java/com/easypost/fixtures/components/TaxIdentifiers.java new file mode 100644 index 000000000..2e68f8074 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/TaxIdentifiers.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class TaxIdentifiers { + @SerializedName ("basic") + public HashMap basic; + +} diff --git a/src/test/java/com/easypost/fixtures/components/Users.java b/src/test/java/com/easypost/fixtures/components/Users.java new file mode 100644 index 000000000..9224c1c4b --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Users.java @@ -0,0 +1,11 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.HashMap; + +public final class Users { + @SerializedName ("referral") + public HashMap referral; + +} diff --git a/src/test/java/com/easypost/fixtures/components/Webhooks.java b/src/test/java/com/easypost/fixtures/components/Webhooks.java new file mode 100644 index 000000000..c2456c8d3 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Webhooks.java @@ -0,0 +1,20 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public final class Webhooks { + @SerializedName ("hmac_signature") + public String hmacSignature; + + @SerializedName ("secret") + public String secret; + + @SerializedName ("url") + public String url; + + @SerializedName ("custom_headers") + public List customHeaders; + +} diff --git a/src/test/java/com/easypost/fixtures/components/package-info.java b/src/test/java/com/easypost/fixtures/components/package-info.java new file mode 100644 index 000000000..b17b317bd --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/package-info.java @@ -0,0 +1,9 @@ +/** + * Fixture substructures for unit tests for the EasyPost API Java client library. + * + * @author EasyPost developers + * @version 1.0 + * @see EasyPost API documentation + * @since 1.0 + */ +package com.easypost.fixtures.components; diff --git a/src/test/java/com/easypost/fixtures/package-info.java b/src/test/java/com/easypost/fixtures/package-info.java new file mode 100644 index 000000000..573dd11eb --- /dev/null +++ b/src/test/java/com/easypost/fixtures/package-info.java @@ -0,0 +1,9 @@ +/** + * Fixture structures for unit tests for the EasyPost API Java client library. + * + * @author EasyPost developers + * @version 1.0 + * @see EasyPost API documentation + * @since 1.0 + */ +package com.easypost.fixtures; diff --git a/src/test/java/com/easypost/package-info.java b/src/test/java/com/easypost/package-info.java new file mode 100644 index 000000000..ece1cc4be --- /dev/null +++ b/src/test/java/com/easypost/package-info.java @@ -0,0 +1,9 @@ +/** + * Unit tests for the EasyPost API Java client library. + * + * @author EasyPost developers + * @version 1.0 + * @see EasyPost API documentation + * @since 1.0 + */ +package com.easypost;