diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d088a62..ec4b239c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Next Release + +- Adds new `Claim` service for filing claims on EasyPost shipments and insurances + ## v7.3.0 (2024-07-12) - Adds new `shipment.recommendShipDate`, `smartrate.recommendShipDate`, and `smartrate.estimateDeliveryDate` functions diff --git a/composer.json b/composer.json index a4e4f115..da389365 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "squizlabs/php_codesniffer": "^3.7", "roave/security-advisories": "dev-latest", "rregeer/phpunit-coverage-check": "^0.3.1", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.11" }, "scripts": { "coverage": "XDEBUG_MODE=coverage ./bin/phpunit --coverage-html clover.html --coverage-clover build/logs/clover.xml && ./bin/coverage-check build/logs/clover.xml 85 --only-percentage", diff --git a/examples b/examples index b9fde9be..b1f3d75c 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit b9fde9bead7750256bc986802841ce7576eee0a4 +Subproject commit b1f3d75c324c2894a6d5c622ee0b31bcc6e1acb3 diff --git a/lib/EasyPost/Claim.php b/lib/EasyPost/Claim.php new file mode 100644 index 00000000..915c6fd7 --- /dev/null +++ b/lib/EasyPost/Claim.php @@ -0,0 +1,29 @@ + BillingService::class, 'carrierAccount' => CarrierAccountService::class, 'carrierMetadata' => CarrierMetadataService::class, + 'claim' => ClaimService::class, 'customsInfo' => CustomsInfoService::class, 'customsItem' => CustomsItemService::class, 'endShipper' => EndShipperService::class, diff --git a/lib/EasyPost/Service/ClaimService.php b/lib/EasyPost/Service/ClaimService.php new file mode 100644 index 00000000..bf274ec4 --- /dev/null +++ b/lib/EasyPost/Service/ClaimService.php @@ -0,0 +1,70 @@ +getNextPageResources(self::serviceModelClassName(self::class), $claims, $pageSize); + } + + /** + * Cancel a claim object. + * + * @param string $id + * @return mixed + */ + public function cancel(string $id): mixed + { + $response = Requestor::request($this->client, 'post', "/claims/{$id}/cancel"); + + return InternalUtil::convertToEasyPostObject($this->client, $response); + } +} diff --git a/lib/EasyPost/Util/InternalUtil.php b/lib/EasyPost/Util/InternalUtil.php index 6ab2cfe2..7701cb7d 100644 --- a/lib/EasyPost/Util/InternalUtil.php +++ b/lib/EasyPost/Util/InternalUtil.php @@ -8,6 +8,7 @@ use EasyPost\Brand; use EasyPost\CarrierAccount; use EasyPost\CarrierDetail; +use EasyPost\Claim; use EasyPost\Constant\Constants; use EasyPost\CustomsInfo; use EasyPost\CustomsItem; @@ -43,6 +44,7 @@ 'Brand' => Brand::class, 'CarrierAccount' => CarrierAccount::class, 'CarrierDetail' => CarrierDetail::class, + 'Claim' => Claim::class, 'CustomsInfo' => CustomsInfo::class, 'CustomsItem' => CustomsItem::class, 'EndShipper' => EndShipper::class, diff --git a/lib/easypost.php b/lib/easypost.php index 772276d6..f55a7cf5 100644 --- a/lib/easypost.php +++ b/lib/easypost.php @@ -61,6 +61,7 @@ require_once(dirname(__FILE__) . '/EasyPost/Brand.php'); require_once(dirname(__FILE__) . '/EasyPost/CarrierAccount.php'); require_once(dirname(__FILE__) . '/EasyPost/CarrierDetail.php'); +require_once(dirname(__FILE__) . '/EasyPost/Claim.php'); require_once(dirname(__FILE__) . '/EasyPost/CustomsInfo.php'); require_once(dirname(__FILE__) . '/EasyPost/CustomsItem.php'); require_once(dirname(__FILE__) . '/EasyPost/EndShipper.php'); @@ -96,6 +97,7 @@ require_once(dirname(__FILE__) . '/EasyPost/Service/BatchService.php'); require_once(dirname(__FILE__) . '/EasyPost/Service/BillingService.php'); require_once(dirname(__FILE__) . '/EasyPost/Service/CarrierAccountService.php'); +require_once(dirname(__FILE__) . '/EasyPost/Service/ClaimService.php'); require_once(dirname(__FILE__) . '/EasyPost/Service/CustomsInfoService.php'); require_once(dirname(__FILE__) . '/EasyPost/Service/CustomsItemService.php'); require_once(dirname(__FILE__) . '/EasyPost/Service/EndShipperService.php'); diff --git a/test/EasyPost/ClaimTest.php b/test/EasyPost/ClaimTest.php new file mode 100644 index 00000000..afcd7c2d --- /dev/null +++ b/test/EasyPost/ClaimTest.php @@ -0,0 +1,154 @@ +shipment->create(Fixture::fullShipment()); + return self::$client->shipment->buy( + $shipment->id, + [ + 'rate' => $shipment->lowestRate(), + 'insurance' => $amount, + ] + ); + } + + + /** + * Test creating an claim object. + */ + public function testCreate(): void + { + TestUtil::setupCassette('claim/create.yml'); + $amount = '100'; + $purchasedShipment = self::createAndBuyShipment($amount); + + $claimData = Fixture::basicClaimData(); + $claimData['tracking_code'] = $purchasedShipment->tracking_code; + $claimData['amount'] = $amount; + + $claim = self::$client->claim->create($claimData); + + $this->assertInstanceOf(Claim::class, $claim); + $this->assertStringMatchesFormat('clm_%s', $claim->id); + } + + /** + * Test retrieving an claim object. + */ + public function testRetrieve(): void + { + TestUtil::setupCassette('claim/retrieve.yml'); + $amount = '100'; + $purchasedShipment = self::createAndBuyShipment($amount); + + $claimData = Fixture::basicClaimData(); + $claimData['tracking_code'] = $purchasedShipment->tracking_code; + $claimData['amount'] = $amount; + + $claim = self::$client->claim->create($claimData); + $retrievedClaim = self::$client->claim->retrieve($claim->id); + + $this->assertInstanceOf(Claim::class, $claim); + $this->assertStringMatchesFormat('clm_%s', $claim->id); + $this->assertEquals($claim->id, $retrievedClaim->id); + } + + /** + * Test retrieving all claims. + */ + public function testAll(): void + { + TestUtil::setupCassette('claim/all.yml'); + + $claim = self::$client->claim->all([ + 'page_size' => Fixture::pageSize(), + ]); + + $claimArray = $claim['claims']; + + $this->assertLessThanOrEqual($claimArray, Fixture::pageSize()); + $this->assertNotNull($claim['has_more']); + $this->assertContainsOnlyInstancesOf(Claim::class, $claimArray); + } + + /** + * Test retrieving next page. + */ + public function testGetNextPage(): void + { + TestUtil::setupCassette('claim/getNextPage.yml'); + + try { + $claims = self::$client->claim->all([ + 'page_size' => Fixture::pageSize(), + ]); + $nextPage = self::$client->claim->getNextPage($claims, Fixture::pageSize()); + + $firstIdOfFirstPage = $claims['claims'][0]->id; + $secondIdOfSecondPage = $nextPage['claims'][0]->id; + + $this->assertNotEquals($firstIdOfFirstPage, $secondIdOfSecondPage); + $this->assertNotNull($nextPage['_params']); + } catch (EndOfPaginationException $error) { + // There's no second page, that's not a failure + $this->assertTrue(true); + } catch (Exception $error) { + throw $error; + } + } + + /** + * Test cancelling a filed claim. + */ + public function testRefund(): void + { + TestUtil::setupCassette('claim/cancel.yml'); + $amount = '100'; + $purchasedShipment = self::createAndBuyShipment($amount); + + $claimData = Fixture::basicClaimData(); + $claimData['tracking_code'] = $purchasedShipment->tracking_code; + $claimData['amount'] = $amount; + + $claim = self::$client->claim->create($claimData); + $cancelledClaim = self::$client->claim->cancel($claim->id); + + $this->assertInstanceOf(Claim::class, $cancelledClaim); + $this->assertStringMatchesFormat('clm_%s', $cancelledClaim->id); + $this->assertEquals('cancelled', $cancelledClaim->status); + } +} diff --git a/test/EasyPost/Fixture.php b/test/EasyPost/Fixture.php index c30300da..8948e591 100644 --- a/test/EasyPost/Fixture.php +++ b/test/EasyPost/Fixture.php @@ -229,13 +229,27 @@ public static function rmaFormOtions(): array return self::readFixtureData()['form_options']['rma']; } + /** + * @return string + */ public static function plannedShipDate(): string { return '2024-07-16'; } + /** + * @return string + */ public static function desiredDeliveryDate(): string { return '2024-07-16'; } + + /** + * @return array + */ + public static function basicClaimData(): array + { + return self::readFixtureData()['claims']['basic']; + } } diff --git a/test/cassettes/claim/all.yml b/test/cassettes/claim/all.yml new file mode 100644 index 00000000..75c091ff --- /dev/null +++ b/test/cassettes/claim/all.yml @@ -0,0 +1,79 @@ + +- + request: + method: GET + url: 'https://api.easypost.com/v2/claims?page_size=5' + headers: + Host: api.easypost.com + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + response: + status: + code: 200 + message: OK + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 98f5fae766a00b65e79a82a7001933ca + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '2252' + x-runtime: '0.039310' + x-node: bigweb43nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-canary: direct + x-proxied: ['intlb4nuq c0f5e722d1', 'extlb1nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"claims":[{"approved_amount":null,"attachments":["https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/379d4f0d76c847adabddde44f53f397d.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/d55632462ea34ac3a8419cd735e12708.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/0df078001f3849c982cc00fca02f738a.png"],"check_delivery_address":null,"contact_email":"test@example.com","created_at":"2024-07-23T19:56:49","description":"Test description","history":[{"status":"submitted","status_detail":"Claim was created.","timestamp":"2024-07-23T19:56:49"}],"id":"clm_097ed5afc86d45149655a63fd31bc810","insurance_amount":"100.00","insurance_id":"ins_6d1b3e02c4e041b08b00254e3c45ca79","mode":"test","object":"Claim","payment_method":"easypost_wallet","recipient_name":null,"requested_amount":"100.00","salvage_value":null,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","status":"submitted","status_detail":"Claim was created.","status_timestamp":"2024-07-23T19:56:49","tracking_code":"9400100110368066400960","type":"damage","updated_at":"2024-07-23T19:56:49"},{"approved_amount":null,"attachments":["https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/aef24e0390f149a1b7e933c5cd384091.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/0451fbe7ec9c445288393e18add66a57.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/3c421000878e47d590d74fad69dc832b.png"],"check_delivery_address":null,"contact_email":"test@example.com","created_at":"2024-07-23T19:48:27","description":"Test description","history":[{"status":"submitted","status_detail":"Claim was created.","timestamp":"2024-07-23T19:48:27"}],"id":"clm_097efe4128e44a15986ebc4bf2467c14","insurance_amount":"100.00","insurance_id":"ins_9651e894aafb450ead9cc2e44b76a53b","mode":"test","object":"Claim","payment_method":"easypost_wallet","recipient_name":null,"requested_amount":"100.00","salvage_value":null,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","status":"submitted","status_detail":"Claim was created.","status_timestamp":"2024-07-23T19:48:27","tracking_code":"9400100110368066399110","type":"damage","updated_at":"2024-07-23T19:48:27"}],"has_more":false}' + curl_info: + url: 'https://api.easypost.com/v2/claims?page_size=5' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 707 + request_size: 295 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.49138 + namelookup_time: 0.031302 + connect_time: 0.168599 + pretransfer_time: 0.322452 + size_upload: 0.0 + size_download: 2252.0 + speed_download: 4583.0 + speed_upload: 0.0 + download_content_length: 2252.0 + upload_content_length: 0.0 + starttransfer_time: 0.491177 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.131 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63836 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 322380 + connect_time_us: 168599 + namelookup_time_us: 31302 + pretransfer_time_us: 322452 + redirect_time_us: 0 + starttransfer_time_us: 491177 + total_time_us: 491380 + effective_method: GET + capath: '' + cainfo: '' + index: 0 diff --git a/test/cassettes/claim/cancel.yml b/test/cassettes/claim/cancel.yml new file mode 100644 index 00000000..11ea246f --- /dev/null +++ b/test/cassettes/claim/cancel.yml @@ -0,0 +1,319 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/shipments' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"shipment":{"from_address":{"name":"Jack Sparrow","street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","email":"test@example.com","phone":"5555555555"},"to_address":{"name":"Elizabeth Swan","street1":"179 N Harbor Dr","city":"Redondo Beach","state":"CA","zip":"90277","country":"US","email":"test@example.com","phone":"5555555555"},"parcel":{"length":"10","width":"8","height":"4","weight":"15.4"},"customs_info":{"eel_pfc":"NOEEI 30.37(a)","customs_certify":"true","customs_signer":"Steve Brule","contents_type":"merchandise","restriction_type":"none","non_delivery_option":"return","customs_items":[{"description":"Sweet shirts","quantity":"2","weight":"11","value":"23.25","hs_tariff_number":"654321","origin_country":"US"}]},"options":{"label_format":"PNG","invoice_number":"123"},"reference":"123"}}' + response: + status: + code: 201 + message: Created + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 483169fc66a00bdfe79a82ea001a73de + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + location: /api/v2/shipments/shp_2664316df809459887cd1035e4a4f7fa + content-type: 'application/json; charset=utf-8' + content-length: '6016' + x-runtime: '0.464826' + x-node: bigweb43nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-canary: direct + x-proxied: ['intlb4nuq c0f5e722d1', 'extlb2nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"created_at":"2024-07-23T20:00:31Z","is_return":false,"messages":[{"carrier":"DhlEcs","carrier_account_id":"ca_5e8c4f41363b432594441dbf98e4032e","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_23d193562e8e459bbd937c2aad3dd092","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cb65fc8581184ea38a3108f9e9d1e81c","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cd846680a6f74c23891086de730769d6","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_91e6857e8cb6455180f8ef8a3db8baaa","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"}],"mode":"test","options":{"label_format":"PNG","invoice_number":"123","currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":"123","status":"unknown","tracking_code":null,"updated_at":"2024-07-23T20:00:32Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":{"id":"cstinfo_6d85760c3cc44b89b0c4fb61ba021341","object":"CustomsInfo","created_at":"2024-07-23T20:00:31Z","updated_at":"2024-07-23T20:00:31Z","contents_explanation":null,"contents_type":"merchandise","customs_certify":true,"customs_signer":"Steve Brule","eel_pfc":"NOEEI 30.37(a)","non_delivery_option":"return","restriction_comments":null,"restriction_type":"none","mode":"test","declaration":null,"customs_items":[{"id":"cstitem_afed36cac8564c9592b20423b3b2f62e","object":"CustomsItem","created_at":"2024-07-23T20:00:31Z","updated_at":"2024-07-23T20:00:31Z","description":"Sweet shirts","hs_tariff_number":"654321","origin_country":"US","quantity":2,"value":"23.25","weight":11,"code":null,"mode":"test","manufacturer":null,"currency":null,"eccn":null,"printed_commodity_identifier":null}]},"from_address":{"id":"adr_376f22c7492e11efbb52ac1f6bc53342","object":"Address","created_at":"2024-07-23T20:00:31+00:00","updated_at":"2024-07-23T20:00:31+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"insurance":null,"order_id":null,"parcel":{"id":"prcl_499f435f95624cb4815b99ce5df87ca0","object":"Parcel","created_at":"2024-07-23T20:00:31Z","updated_at":"2024-07-23T20:00:31Z","length":10,"width":8,"height":4,"predefined_package":null,"weight":15.4,"mode":"test"},"postage_label":null,"rates":[{"id":"rate_c3b8896a0cb04c7796d4f4d0dbdb5926","object":"Rate","created_at":"2024-07-23T20:00:32Z","updated_at":"2024-07-23T20:00:32Z","mode":"test","service":"Express","carrier":"USPS","rate":"33.10","currency":"USD","retail_rate":"37.90","retail_currency":"USD","list_rate":"33.10","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_e68c3c3c530941c080ff1a7323562970","object":"Rate","created_at":"2024-07-23T20:00:32Z","updated_at":"2024-07-23T20:00:32Z","mode":"test","service":"Priority","carrier":"USPS","rate":"6.90","currency":"USD","retail_rate":"9.80","retail_currency":"USD","list_rate":"8.25","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_8e162fe9fd6f4475b51e77af9b84ab4d","object":"Rate","created_at":"2024-07-23T20:00:32Z","updated_at":"2024-07-23T20:00:32Z","mode":"test","service":"GroundAdvantage","carrier":"USPS","rate":"5.93","currency":"USD","retail_rate":"8.45","retail_currency":"USD","list_rate":"6.40","list_currency":"USD","billing_type":"easypost","delivery_days":3,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":3,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"}],"refund_status":null,"scan_form":null,"selected_rate":null,"tracker":null,"to_address":{"id":"adr_376ca903492e11ef86f2ac1f6bc539ae","object":"Address","created_at":"2024-07-23T20:00:31+00:00","updated_at":"2024-07-23T20:00:31+00:00","name":"Elizabeth Swan","company":null,"street1":"179 N Harbor Dr","street2":null,"city":"Redondo Beach","state":"CA","zip":"90277","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"usps_zone":4,"return_address":{"id":"adr_376f22c7492e11efbb52ac1f6bc53342","object":"Address","created_at":"2024-07-23T20:00:31+00:00","updated_at":"2024-07-23T20:00:31+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"buyer_address":{"id":"adr_376ca903492e11ef86f2ac1f6bc539ae","object":"Address","created_at":"2024-07-23T20:00:31+00:00","updated_at":"2024-07-23T20:00:31+00:00","name":"Elizabeth Swan","company":null,"street1":"179 N Harbor Dr","street2":null,"city":"Redondo Beach","state":"CA","zip":"90277","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"forms":[],"fees":[],"id":"shp_2664316df809459887cd1035e4a4f7fa","object":"Shipment"}' + curl_info: + url: 'https://api.easypost.com/v2/shipments' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 778 + request_size: 1172 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.967563 + namelookup_time: 0.003001 + connect_time: 0.129966 + pretransfer_time: 0.272535 + size_upload: 864.0 + size_download: 6016.0 + speed_download: 6217.0 + speed_upload: 892.0 + download_content_length: 6016.0 + upload_content_length: 864.0 + starttransfer_time: 0.967483 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.130 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63857 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 272387 + connect_time_us: 129966 + namelookup_time_us: 3001 + pretransfer_time_us: 272535 + redirect_time_us: 0 + starttransfer_time_us: 967483 + total_time_us: 967563 + effective_method: POST + capath: '' + cainfo: '' + index: 0 +- + request: + method: POST + url: 'https://api.easypost.com/v2/shipments/shp_2664316df809459887cd1035e4a4f7fa/buy' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"rate":{"id":"rate_8e162fe9fd6f4475b51e77af9b84ab4d"},"insurance":"100"}' + response: + status: + code: 200 + message: OK + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 483169fb66a00be0e79a82eb001a758d + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '8235' + x-runtime: '0.821095' + x-node: bigweb40nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb3nuq c0f5e722d1', 'extlb2nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"created_at":"2024-07-23T20:00:31Z","is_return":false,"messages":[{"carrier":"DhlEcs","carrier_account_id":"ca_5e8c4f41363b432594441dbf98e4032e","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_23d193562e8e459bbd937c2aad3dd092","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cb65fc8581184ea38a3108f9e9d1e81c","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cd846680a6f74c23891086de730769d6","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_91e6857e8cb6455180f8ef8a3db8baaa","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"}],"mode":"test","options":{"label_format":"PNG","invoice_number":"123","currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":"123","status":"unknown","tracking_code":"9400100110368066401769","updated_at":"2024-07-23T20:00:33Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":{"id":"cstinfo_6d85760c3cc44b89b0c4fb61ba021341","object":"CustomsInfo","created_at":"2024-07-23T20:00:31Z","updated_at":"2024-07-23T20:00:31Z","contents_explanation":null,"contents_type":"merchandise","customs_certify":true,"customs_signer":"Steve Brule","eel_pfc":"NOEEI 30.37(a)","non_delivery_option":"return","restriction_comments":null,"restriction_type":"none","mode":"test","declaration":null,"customs_items":[{"id":"cstitem_afed36cac8564c9592b20423b3b2f62e","object":"CustomsItem","created_at":"2024-07-23T20:00:31Z","updated_at":"2024-07-23T20:00:31Z","description":"Sweet shirts","hs_tariff_number":"654321","origin_country":"US","quantity":2,"value":"23.25","weight":11,"code":null,"mode":"test","manufacturer":null,"currency":null,"eccn":null,"printed_commodity_identifier":null}]},"from_address":{"id":"adr_376f22c7492e11efbb52ac1f6bc53342","object":"Address","created_at":"2024-07-23T20:00:31+00:00","updated_at":"2024-07-23T20:00:31+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"insurance":"100.00","order_id":null,"parcel":{"id":"prcl_499f435f95624cb4815b99ce5df87ca0","object":"Parcel","created_at":"2024-07-23T20:00:31Z","updated_at":"2024-07-23T20:00:31Z","length":10,"width":8,"height":4,"predefined_package":null,"weight":15.4,"mode":"test"},"postage_label":{"object":"PostageLabel","id":"pl_dc45aed2d36845379b44ba38a8a7cefe","created_at":"2024-07-23T20:00:33Z","updated_at":"2024-07-23T20:00:33Z","date_advance":0,"integrated_form":"none","label_date":"2024-07-23T20:00:33Z","label_resolution":300,"label_size":"4x6","label_type":"default","label_file_type":"image\/png","label_url":"https:\/\/easypost-files.s3.us-west-2.amazonaws.com\/files\/postage_label\/20240723\/e8e797b192dd9440c59ca7da9680fd3b1a.png","label_pdf_url":null,"label_zpl_url":null,"label_epl2_url":null,"label_file":null},"rates":[{"id":"rate_c3b8896a0cb04c7796d4f4d0dbdb5926","object":"Rate","created_at":"2024-07-23T20:00:32Z","updated_at":"2024-07-23T20:00:32Z","mode":"test","service":"Express","carrier":"USPS","rate":"33.10","currency":"USD","retail_rate":"37.90","retail_currency":"USD","list_rate":"33.10","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_e68c3c3c530941c080ff1a7323562970","object":"Rate","created_at":"2024-07-23T20:00:32Z","updated_at":"2024-07-23T20:00:32Z","mode":"test","service":"Priority","carrier":"USPS","rate":"6.90","currency":"USD","retail_rate":"9.80","retail_currency":"USD","list_rate":"8.25","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_8e162fe9fd6f4475b51e77af9b84ab4d","object":"Rate","created_at":"2024-07-23T20:00:32Z","updated_at":"2024-07-23T20:00:32Z","mode":"test","service":"GroundAdvantage","carrier":"USPS","rate":"5.93","currency":"USD","retail_rate":"8.45","retail_currency":"USD","list_rate":"6.40","list_currency":"USD","billing_type":"easypost","delivery_days":3,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":3,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"}],"refund_status":null,"scan_form":null,"selected_rate":{"id":"rate_8e162fe9fd6f4475b51e77af9b84ab4d","object":"Rate","created_at":"2024-07-23T20:00:33Z","updated_at":"2024-07-23T20:00:33Z","mode":"test","service":"GroundAdvantage","carrier":"USPS","rate":"5.93","currency":"USD","retail_rate":"8.45","retail_currency":"USD","list_rate":"6.40","list_currency":"USD","billing_type":"easypost","delivery_days":3,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":3,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},"tracker":{"id":"trk_82054308216d4080a0e6be47f49e1b2a","object":"Tracker","mode":"test","tracking_code":"9400100110368066401769","status":"unknown","status_detail":"unknown","created_at":"2024-07-23T20:00:33Z","updated_at":"2024-07-23T20:00:33Z","signed_by":null,"weight":null,"est_delivery_date":null,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","carrier":"USPS","tracking_details":[],"fees":[],"carrier_detail":null,"public_url":"https:\/\/track.easypost.com\/djE6dHJrXzgyMDU0MzA4MjE2ZDQwODBhMGU2YmU0N2Y0OWUxYjJh"},"to_address":{"id":"adr_376ca903492e11ef86f2ac1f6bc539ae","object":"Address","created_at":"2024-07-23T20:00:31+00:00","updated_at":"2024-07-23T20:00:32+00:00","name":"ELIZABETH SWAN","company":null,"street1":"179 N HARBOR DR","street2":"","city":"REDONDO BEACH","state":"CA","zip":"90277-2506","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":false,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":33.8436,"longitude":-118.39177,"time_zone":"America\/Los_Angeles"}}}},"usps_zone":4,"return_address":{"id":"adr_376f22c7492e11efbb52ac1f6bc53342","object":"Address","created_at":"2024-07-23T20:00:31+00:00","updated_at":"2024-07-23T20:00:31+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"buyer_address":{"id":"adr_376ca903492e11ef86f2ac1f6bc539ae","object":"Address","created_at":"2024-07-23T20:00:31+00:00","updated_at":"2024-07-23T20:00:32+00:00","name":"ELIZABETH SWAN","company":null,"street1":"179 N HARBOR DR","street2":"","city":"REDONDO BEACH","state":"CA","zip":"90277-2506","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":false,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":33.8436,"longitude":-118.39177,"time_zone":"America\/Los_Angeles"}}}},"forms":[],"fees":[{"object":"Fee","type":"LabelFee","amount":"0.00000","charged":true,"refunded":false},{"object":"Fee","type":"PostageFee","amount":"5.93000","charged":true,"refunded":false},{"object":"Fee","type":"InsuranceFee","amount":"0.50000","charged":true,"refunded":false}],"id":"shp_2664316df809459887cd1035e4a4f7fa","object":"Shipment"}' + curl_info: + url: 'https://api.easypost.com/v2/shipments/shp_2664316df809459887cd1035e4a4f7fa/buy' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 689 + request_size: 421 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 1.326936 + namelookup_time: 0.001216 + connect_time: 0.128586 + pretransfer_time: 0.256076 + size_upload: 73.0 + size_download: 8235.0 + speed_download: 6206.0 + speed_upload: 55.0 + download_content_length: 8235.0 + upload_content_length: 73.0 + starttransfer_time: 1.326797 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.130 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63858 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 256017 + connect_time_us: 128586 + namelookup_time_us: 1216 + pretransfer_time_us: 256076 + redirect_time_us: 0 + starttransfer_time_us: 1326797 + total_time_us: 1326936 + effective_method: POST + capath: '' + cainfo: '' + index: 0 +- + request: + method: POST + url: 'https://api.easypost.com/v2/claims' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"type":"damage","email_evidence_attachments":["data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8\/\/8\/AwAI\/AL+4Q7AIAAAAABJRU5ErkJggg=="],"invoice_attachments":["data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8\/\/8\/AwAI\/AL+4Q7AIAAAAABJRU5ErkJggg=="],"supporting_documentation_attachments":["data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8\/\/8\/AwAI\/AL+4Q7AIAAAAABJRU5ErkJggg=="],"description":"Test description","contact_email":"test@example.com","tracking_code":"9400100110368066401769","amount":"100"}' + response: + status: + code: 201 + message: Created + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 98f5faeb66a00be2e79a82ec0019b383 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '1111' + x-runtime: '0.898786' + x-node: bigweb42nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb4nuq c0f5e722d1', 'extlb1nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"approved_amount":null,"attachments":["https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/844aa29e0276476aaef0caa76c8f4c8f.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/2c7099a487914a258bfc9d8bf80a5f35.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/a5355ea95d1d4ba3973dca342bae477f.png"],"check_delivery_address":null,"contact_email":"test@example.com","created_at":"2024-07-23T20:00:34","description":"Test description","history":[{"status":"submitted","status_detail":"Claim was created.","timestamp":"2024-07-23T20:00:34"}],"id":"clm_097e4784ffb44354856c828961c8ad37","insurance_amount":"100.00","insurance_id":"ins_cfe583f5459042c49b410ba35e975338","mode":"test","object":"Claim","payment_method":"easypost_wallet","recipient_name":null,"requested_amount":"100.00","salvage_value":null,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","status":"submitted","status_detail":"Claim was created.","status_timestamp":"2024-07-23T20:00:34","tracking_code":"9400100110368066401769","type":"damage","updated_at":"2024-07-23T20:00:34"}' + curl_info: + url: 'https://api.easypost.com/v2/claims' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 694 + request_size: 920 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 1.296151 + namelookup_time: 0.001221 + connect_time: 0.135976 + pretransfer_time: 0.2663 + size_upload: 615.0 + size_download: 1111.0 + speed_download: 857.0 + speed_upload: 474.0 + download_content_length: 1111.0 + upload_content_length: 615.0 + starttransfer_time: 1.296134 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.131 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63859 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 266185 + connect_time_us: 135976 + namelookup_time_us: 1221 + pretransfer_time_us: 266300 + redirect_time_us: 0 + starttransfer_time_us: 1296134 + total_time_us: 1296151 + effective_method: POST + capath: '' + cainfo: '' + index: 0 +- + request: + method: POST + url: 'https://api.easypost.com/v2/claims/clm_097e4784ffb44354856c828961c8ad37/cancel' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '[]' + response: + status: + code: 200 + message: OK + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 483169f866a00be3e79a8304001a7a76 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '1235' + x-runtime: '0.045524' + x-node: bigweb41nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb3nuq c0f5e722d1', 'extlb2nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"approved_amount":null,"attachments":["https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/844aa29e0276476aaef0caa76c8f4c8f.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/2c7099a487914a258bfc9d8bf80a5f35.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/a5355ea95d1d4ba3973dca342bae477f.png"],"check_delivery_address":null,"contact_email":"test@example.com","created_at":"2024-07-23T20:00:34","description":"Test description","history":[{"status":"cancelled","status_detail":"Claim cancellation was requested.","timestamp":"2024-07-23T20:00:36"},{"status":"submitted","status_detail":"Claim was created.","timestamp":"2024-07-23T20:00:34"}],"id":"clm_097e4784ffb44354856c828961c8ad37","insurance_amount":"100.00","insurance_id":"ins_cfe583f5459042c49b410ba35e975338","mode":"test","object":"Claim","payment_method":"easypost_wallet","recipient_name":null,"requested_amount":"100.00","salvage_value":null,"shipment_id":"shp_2664316df809459887cd1035e4a4f7fa","status":"cancelled","status_detail":"Claim cancellation was requested.","status_timestamp":"2024-07-23T20:00:36","tracking_code":"9400100110368066401769","type":"damage","updated_at":"2024-07-23T20:00:35"}' + curl_info: + url: 'https://api.easypost.com/v2/claims/clm_097e4784ffb44354856c828961c8ad37/cancel' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 689 + request_size: 349 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.440286 + namelookup_time: 0.001143 + connect_time: 0.130507 + pretransfer_time: 0.259705 + size_upload: 2.0 + size_download: 1235.0 + speed_download: 2804.0 + speed_upload: 4.0 + download_content_length: 1235.0 + upload_content_length: 2.0 + starttransfer_time: 0.439345 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.130 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63860 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 259626 + connect_time_us: 130507 + namelookup_time_us: 1143 + pretransfer_time_us: 259705 + redirect_time_us: 0 + starttransfer_time_us: 439345 + total_time_us: 440286 + effective_method: POST + capath: '' + cainfo: '' + index: 0 diff --git a/test/cassettes/claim/create.yml b/test/cassettes/claim/create.yml new file mode 100644 index 00000000..46ca742b --- /dev/null +++ b/test/cassettes/claim/create.yml @@ -0,0 +1,239 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/shipments' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"shipment":{"from_address":{"name":"Jack Sparrow","street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","email":"test@example.com","phone":"5555555555"},"to_address":{"name":"Elizabeth Swan","street1":"179 N Harbor Dr","city":"Redondo Beach","state":"CA","zip":"90277","country":"US","email":"test@example.com","phone":"5555555555"},"parcel":{"length":"10","width":"8","height":"4","weight":"15.4"},"customs_info":{"eel_pfc":"NOEEI 30.37(a)","customs_certify":"true","customs_signer":"Steve Brule","contents_type":"merchandise","restriction_type":"none","non_delivery_option":"return","customs_items":[{"description":"Sweet shirts","quantity":"2","weight":"11","value":"23.25","hs_tariff_number":"654321","origin_country":"US"}]},"options":{"label_format":"PNG","invoice_number":"123"},"reference":"123"}}' + response: + status: + code: 201 + message: Created + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 483169fc66a00908e79a7e2600178a23 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + location: /api/v2/shipments/shp_086a0105d412457c99ee9de3c14cc2d2 + content-type: 'application/json; charset=utf-8' + content-length: '6016' + x-runtime: '0.501373' + x-node: bigweb42nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb4nuq c0f5e722d1', 'extlb2nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"created_at":"2024-07-23T19:48:24Z","is_return":false,"messages":[{"carrier":"DhlEcs","carrier_account_id":"ca_cd846680a6f74c23891086de730769d6","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_91e6857e8cb6455180f8ef8a3db8baaa","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_23d193562e8e459bbd937c2aad3dd092","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_5e8c4f41363b432594441dbf98e4032e","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cb65fc8581184ea38a3108f9e9d1e81c","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"}],"mode":"test","options":{"label_format":"PNG","invoice_number":"123","currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":"123","status":"unknown","tracking_code":null,"updated_at":"2024-07-23T19:48:25Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":{"id":"cstinfo_d43e66a38d9140ffbfaf77939a9e97a9","object":"CustomsInfo","created_at":"2024-07-23T19:48:24Z","updated_at":"2024-07-23T19:48:24Z","contents_explanation":null,"contents_type":"merchandise","customs_certify":true,"customs_signer":"Steve Brule","eel_pfc":"NOEEI 30.37(a)","non_delivery_option":"return","restriction_comments":null,"restriction_type":"none","mode":"test","declaration":null,"customs_items":[{"id":"cstitem_c48424ca2d534e1ba5e84a03a2537a93","object":"CustomsItem","created_at":"2024-07-23T19:48:24Z","updated_at":"2024-07-23T19:48:24Z","description":"Sweet shirts","hs_tariff_number":"654321","origin_country":"US","quantity":2,"value":"23.25","weight":11,"code":null,"mode":"test","manufacturer":null,"currency":null,"eccn":null,"printed_commodity_identifier":null}]},"from_address":{"id":"adr_8604020c492c11ef9f113cecef1b359e","object":"Address","created_at":"2024-07-23T19:48:24+00:00","updated_at":"2024-07-23T19:48:24+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"insurance":null,"order_id":null,"parcel":{"id":"prcl_947a8aba021440ed8363def31346932c","object":"Parcel","created_at":"2024-07-23T19:48:24Z","updated_at":"2024-07-23T19:48:24Z","length":10,"width":8,"height":4,"predefined_package":null,"weight":15.4,"mode":"test"},"postage_label":null,"rates":[{"id":"rate_2f7ab5fa802f482cb7c800954cdd74a3","object":"Rate","created_at":"2024-07-23T19:48:25Z","updated_at":"2024-07-23T19:48:25Z","mode":"test","service":"Priority","carrier":"USPS","rate":"6.90","currency":"USD","retail_rate":"9.80","retail_currency":"USD","list_rate":"8.25","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_097e3fdffd7b412da2cd718a1e82a11c","object":"Rate","created_at":"2024-07-23T19:48:25Z","updated_at":"2024-07-23T19:48:25Z","mode":"test","service":"GroundAdvantage","carrier":"USPS","rate":"5.93","currency":"USD","retail_rate":"8.45","retail_currency":"USD","list_rate":"6.40","list_currency":"USD","billing_type":"easypost","delivery_days":3,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":3,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_c000d186ecef49f59557fe4760ffca8f","object":"Rate","created_at":"2024-07-23T19:48:25Z","updated_at":"2024-07-23T19:48:25Z","mode":"test","service":"Express","carrier":"USPS","rate":"33.10","currency":"USD","retail_rate":"37.90","retail_currency":"USD","list_rate":"33.10","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"}],"refund_status":null,"scan_form":null,"selected_rate":null,"tracker":null,"to_address":{"id":"adr_85fee21a492c11efa851ac1f6bc53342","object":"Address","created_at":"2024-07-23T19:48:24+00:00","updated_at":"2024-07-23T19:48:24+00:00","name":"Elizabeth Swan","company":null,"street1":"179 N Harbor Dr","street2":null,"city":"Redondo Beach","state":"CA","zip":"90277","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"usps_zone":4,"return_address":{"id":"adr_8604020c492c11ef9f113cecef1b359e","object":"Address","created_at":"2024-07-23T19:48:24+00:00","updated_at":"2024-07-23T19:48:24+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"buyer_address":{"id":"adr_85fee21a492c11efa851ac1f6bc53342","object":"Address","created_at":"2024-07-23T19:48:24+00:00","updated_at":"2024-07-23T19:48:24+00:00","name":"Elizabeth Swan","company":null,"street1":"179 N Harbor Dr","street2":null,"city":"Redondo Beach","state":"CA","zip":"90277","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"forms":[],"fees":[],"id":"shp_086a0105d412457c99ee9de3c14cc2d2","object":"Shipment"}' + curl_info: + url: 'https://api.easypost.com/v2/shipments' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 760 + request_size: 1172 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.958401 + namelookup_time: 0.032579 + connect_time: 0.16514 + pretransfer_time: 0.310875 + size_upload: 864.0 + size_download: 6016.0 + speed_download: 6277.0 + speed_upload: 901.0 + download_content_length: 6016.0 + upload_content_length: 864.0 + starttransfer_time: 0.941468 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.130 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63718 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 310790 + connect_time_us: 165140 + namelookup_time_us: 32579 + pretransfer_time_us: 310875 + redirect_time_us: 0 + starttransfer_time_us: 941468 + total_time_us: 958401 + effective_method: POST + capath: '' + cainfo: '' + index: 0 +- + request: + method: POST + url: 'https://api.easypost.com/v2/shipments/shp_086a0105d412457c99ee9de3c14cc2d2/buy' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"rate":{"id":"rate_097e3fdffd7b412da2cd718a1e82a11c"},"insurance":"100"}' + response: + status: + code: 200 + message: OK + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 483169fb66a00909e79a7e2700178af1 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '8235' + x-runtime: '0.963639' + x-node: bigweb35nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb4nuq c0f5e722d1', 'extlb2nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"created_at":"2024-07-23T19:48:24Z","is_return":false,"messages":[{"carrier":"DhlEcs","carrier_account_id":"ca_cd846680a6f74c23891086de730769d6","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_91e6857e8cb6455180f8ef8a3db8baaa","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_23d193562e8e459bbd937c2aad3dd092","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_5e8c4f41363b432594441dbf98e4032e","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cb65fc8581184ea38a3108f9e9d1e81c","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"}],"mode":"test","options":{"label_format":"PNG","invoice_number":"123","currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":"123","status":"unknown","tracking_code":"9400100110368066399110","updated_at":"2024-07-23T19:48:26Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":{"id":"cstinfo_d43e66a38d9140ffbfaf77939a9e97a9","object":"CustomsInfo","created_at":"2024-07-23T19:48:24Z","updated_at":"2024-07-23T19:48:24Z","contents_explanation":null,"contents_type":"merchandise","customs_certify":true,"customs_signer":"Steve Brule","eel_pfc":"NOEEI 30.37(a)","non_delivery_option":"return","restriction_comments":null,"restriction_type":"none","mode":"test","declaration":null,"customs_items":[{"id":"cstitem_c48424ca2d534e1ba5e84a03a2537a93","object":"CustomsItem","created_at":"2024-07-23T19:48:24Z","updated_at":"2024-07-23T19:48:24Z","description":"Sweet shirts","hs_tariff_number":"654321","origin_country":"US","quantity":2,"value":"23.25","weight":11,"code":null,"mode":"test","manufacturer":null,"currency":null,"eccn":null,"printed_commodity_identifier":null}]},"from_address":{"id":"adr_8604020c492c11ef9f113cecef1b359e","object":"Address","created_at":"2024-07-23T19:48:24+00:00","updated_at":"2024-07-23T19:48:24+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"insurance":"100.00","order_id":null,"parcel":{"id":"prcl_947a8aba021440ed8363def31346932c","object":"Parcel","created_at":"2024-07-23T19:48:24Z","updated_at":"2024-07-23T19:48:24Z","length":10,"width":8,"height":4,"predefined_package":null,"weight":15.4,"mode":"test"},"postage_label":{"object":"PostageLabel","id":"pl_4b7216438d0d4376913432dd2e9bc804","created_at":"2024-07-23T19:48:26Z","updated_at":"2024-07-23T19:48:26Z","date_advance":0,"integrated_form":"none","label_date":"2024-07-23T19:48:26Z","label_resolution":300,"label_size":"4x6","label_type":"default","label_file_type":"image\/png","label_url":"https:\/\/easypost-files.s3.us-west-2.amazonaws.com\/files\/postage_label\/20240723\/e82d89dd44cd864801a513a54e60b896db.png","label_pdf_url":null,"label_zpl_url":null,"label_epl2_url":null,"label_file":null},"rates":[{"id":"rate_2f7ab5fa802f482cb7c800954cdd74a3","object":"Rate","created_at":"2024-07-23T19:48:25Z","updated_at":"2024-07-23T19:48:25Z","mode":"test","service":"Priority","carrier":"USPS","rate":"6.90","currency":"USD","retail_rate":"9.80","retail_currency":"USD","list_rate":"8.25","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_097e3fdffd7b412da2cd718a1e82a11c","object":"Rate","created_at":"2024-07-23T19:48:25Z","updated_at":"2024-07-23T19:48:25Z","mode":"test","service":"GroundAdvantage","carrier":"USPS","rate":"5.93","currency":"USD","retail_rate":"8.45","retail_currency":"USD","list_rate":"6.40","list_currency":"USD","billing_type":"easypost","delivery_days":3,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":3,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_c000d186ecef49f59557fe4760ffca8f","object":"Rate","created_at":"2024-07-23T19:48:25Z","updated_at":"2024-07-23T19:48:25Z","mode":"test","service":"Express","carrier":"USPS","rate":"33.10","currency":"USD","retail_rate":"37.90","retail_currency":"USD","list_rate":"33.10","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"}],"refund_status":null,"scan_form":null,"selected_rate":{"id":"rate_097e3fdffd7b412da2cd718a1e82a11c","object":"Rate","created_at":"2024-07-23T19:48:26Z","updated_at":"2024-07-23T19:48:26Z","mode":"test","service":"GroundAdvantage","carrier":"USPS","rate":"5.93","currency":"USD","retail_rate":"8.45","retail_currency":"USD","list_rate":"6.40","list_currency":"USD","billing_type":"easypost","delivery_days":3,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":3,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},"tracker":{"id":"trk_473511f15c5e47a6840cf67efeade15a","object":"Tracker","mode":"test","tracking_code":"9400100110368066399110","status":"unknown","status_detail":"unknown","created_at":"2024-07-23T19:48:26Z","updated_at":"2024-07-23T19:48:26Z","signed_by":null,"weight":null,"est_delivery_date":null,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","carrier":"USPS","tracking_details":[],"fees":[],"carrier_detail":null,"public_url":"https:\/\/track.easypost.com\/djE6dHJrXzQ3MzUxMWYxNWM1ZTQ3YTY4NDBjZjY3ZWZlYWRlMTVh"},"to_address":{"id":"adr_85fee21a492c11efa851ac1f6bc53342","object":"Address","created_at":"2024-07-23T19:48:24+00:00","updated_at":"2024-07-23T19:48:25+00:00","name":"ELIZABETH SWAN","company":null,"street1":"179 N HARBOR DR","street2":"","city":"REDONDO BEACH","state":"CA","zip":"90277-2506","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":false,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":33.8436,"longitude":-118.39177,"time_zone":"America\/Los_Angeles"}}}},"usps_zone":4,"return_address":{"id":"adr_8604020c492c11ef9f113cecef1b359e","object":"Address","created_at":"2024-07-23T19:48:24+00:00","updated_at":"2024-07-23T19:48:24+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"buyer_address":{"id":"adr_85fee21a492c11efa851ac1f6bc53342","object":"Address","created_at":"2024-07-23T19:48:24+00:00","updated_at":"2024-07-23T19:48:25+00:00","name":"ELIZABETH SWAN","company":null,"street1":"179 N HARBOR DR","street2":"","city":"REDONDO BEACH","state":"CA","zip":"90277-2506","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":false,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":33.8436,"longitude":-118.39177,"time_zone":"America\/Los_Angeles"}}}},"forms":[],"fees":[{"object":"Fee","type":"LabelFee","amount":"0.00000","charged":true,"refunded":false},{"object":"Fee","type":"PostageFee","amount":"5.93000","charged":true,"refunded":false},{"object":"Fee","type":"InsuranceFee","amount":"0.50000","charged":true,"refunded":false}],"id":"shp_086a0105d412457c99ee9de3c14cc2d2","object":"Shipment"}' + curl_info: + url: 'https://api.easypost.com/v2/shipments/shp_086a0105d412457c99ee9de3c14cc2d2/buy' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 689 + request_size: 421 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 1.370271 + namelookup_time: 0.001163 + connect_time: 0.141606 + pretransfer_time: 0.273217 + size_upload: 73.0 + size_download: 8235.0 + speed_download: 6009.0 + speed_upload: 53.0 + download_content_length: 8235.0 + upload_content_length: 73.0 + starttransfer_time: 1.370227 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.130 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63719 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 273075 + connect_time_us: 141606 + namelookup_time_us: 1163 + pretransfer_time_us: 273217 + redirect_time_us: 0 + starttransfer_time_us: 1370227 + total_time_us: 1370271 + effective_method: POST + capath: '' + cainfo: '' + index: 0 +- + request: + method: POST + url: 'https://api.easypost.com/v2/claims' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"type":"damage","email_evidence_attachments":["data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8\/\/8\/AwAI\/AL+4Q7AIAAAAABJRU5ErkJggg=="],"invoice_attachments":["data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8\/\/8\/AwAI\/AL+4Q7AIAAAAABJRU5ErkJggg=="],"supporting_documentation_attachments":["data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8\/\/8\/AwAI\/AL+4Q7AIAAAAABJRU5ErkJggg=="],"description":"Test description","contact_email":"test@example.com","tracking_code":"9400100110368066399110","amount":"100"}' + response: + status: + code: 201 + message: Created + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 98f5fae966a0090be79a7e3f0016fc84 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '1111' + x-runtime: '0.852553' + x-node: bigweb40nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb4nuq c0f5e722d1', 'extlb1nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"approved_amount":null,"attachments":["https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/aef24e0390f149a1b7e933c5cd384091.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/0451fbe7ec9c445288393e18add66a57.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/3c421000878e47d590d74fad69dc832b.png"],"check_delivery_address":null,"contact_email":"test@example.com","created_at":"2024-07-23T19:48:27","description":"Test description","history":[{"status":"submitted","status_detail":"Claim was created.","timestamp":"2024-07-23T19:48:27"}],"id":"clm_097efe4128e44a15986ebc4bf2467c14","insurance_amount":"100.00","insurance_id":"ins_9651e894aafb450ead9cc2e44b76a53b","mode":"test","object":"Claim","payment_method":"easypost_wallet","recipient_name":null,"requested_amount":"100.00","salvage_value":null,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","status":"submitted","status_detail":"Claim was created.","status_timestamp":"2024-07-23T19:48:27","tracking_code":"9400100110368066399110","type":"damage","updated_at":"2024-07-23T19:48:27"}' + curl_info: + url: 'https://api.easypost.com/v2/claims' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 694 + request_size: 920 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 1.265495 + namelookup_time: 0.001071 + connect_time: 0.138161 + pretransfer_time: 0.271976 + size_upload: 615.0 + size_download: 1111.0 + speed_download: 877.0 + speed_upload: 485.0 + download_content_length: 1111.0 + upload_content_length: 615.0 + starttransfer_time: 1.265474 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.131 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63720 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 271902 + connect_time_us: 138161 + namelookup_time_us: 1071 + pretransfer_time_us: 271976 + redirect_time_us: 0 + starttransfer_time_us: 1265474 + total_time_us: 1265495 + effective_method: POST + capath: '' + cainfo: '' + index: 0 diff --git a/test/cassettes/claim/getNextPage.yml b/test/cassettes/claim/getNextPage.yml new file mode 100644 index 00000000..15e875c7 --- /dev/null +++ b/test/cassettes/claim/getNextPage.yml @@ -0,0 +1,78 @@ + +- + request: + method: GET + url: 'https://api.easypost.com/v2/claims?page_size=5' + headers: + Host: api.easypost.com + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + response: + status: + code: 200 + message: OK + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 483169fc66a00b8de79a82c4001a10fb + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '2252' + x-runtime: '0.040158' + x-node: bigweb53nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb4nuq c0f5e722d1', 'extlb2nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"claims":[{"approved_amount":null,"attachments":["https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/379d4f0d76c847adabddde44f53f397d.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/d55632462ea34ac3a8419cd735e12708.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/0df078001f3849c982cc00fca02f738a.png"],"check_delivery_address":null,"contact_email":"test@example.com","created_at":"2024-07-23T19:56:49","description":"Test description","history":[{"status":"submitted","status_detail":"Claim was created.","timestamp":"2024-07-23T19:56:49"}],"id":"clm_097ed5afc86d45149655a63fd31bc810","insurance_amount":"100.00","insurance_id":"ins_6d1b3e02c4e041b08b00254e3c45ca79","mode":"test","object":"Claim","payment_method":"easypost_wallet","recipient_name":null,"requested_amount":"100.00","salvage_value":null,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","status":"submitted","status_detail":"Claim was created.","status_timestamp":"2024-07-23T19:56:49","tracking_code":"9400100110368066400960","type":"damage","updated_at":"2024-07-23T19:56:49"},{"approved_amount":null,"attachments":["https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/aef24e0390f149a1b7e933c5cd384091.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/0451fbe7ec9c445288393e18add66a57.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/3c421000878e47d590d74fad69dc832b.png"],"check_delivery_address":null,"contact_email":"test@example.com","created_at":"2024-07-23T19:48:27","description":"Test description","history":[{"status":"submitted","status_detail":"Claim was created.","timestamp":"2024-07-23T19:48:27"}],"id":"clm_097efe4128e44a15986ebc4bf2467c14","insurance_amount":"100.00","insurance_id":"ins_9651e894aafb450ead9cc2e44b76a53b","mode":"test","object":"Claim","payment_method":"easypost_wallet","recipient_name":null,"requested_amount":"100.00","salvage_value":null,"shipment_id":"shp_086a0105d412457c99ee9de3c14cc2d2","status":"submitted","status_detail":"Claim was created.","status_timestamp":"2024-07-23T19:48:27","tracking_code":"9400100110368066399110","type":"damage","updated_at":"2024-07-23T19:48:27"}],"has_more":false}' + curl_info: + url: 'https://api.easypost.com/v2/claims?page_size=5' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 689 + request_size: 295 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.443722 + namelookup_time: 0.003334 + connect_time: 0.135586 + pretransfer_time: 0.278517 + size_upload: 0.0 + size_download: 2252.0 + speed_download: 5075.0 + speed_upload: 0.0 + download_content_length: 2252.0 + upload_content_length: 0.0 + starttransfer_time: 0.443692 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.130 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63842 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 278448 + connect_time_us: 135586 + namelookup_time_us: 3334 + pretransfer_time_us: 278517 + redirect_time_us: 0 + starttransfer_time_us: 443692 + total_time_us: 443722 + effective_method: GET + capath: '' + cainfo: '' + index: 0 diff --git a/test/cassettes/claim/retrieve.yml b/test/cassettes/claim/retrieve.yml new file mode 100644 index 00000000..b60f371b --- /dev/null +++ b/test/cassettes/claim/retrieve.yml @@ -0,0 +1,317 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/shipments' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"shipment":{"from_address":{"name":"Jack Sparrow","street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","email":"test@example.com","phone":"5555555555"},"to_address":{"name":"Elizabeth Swan","street1":"179 N Harbor Dr","city":"Redondo Beach","state":"CA","zip":"90277","country":"US","email":"test@example.com","phone":"5555555555"},"parcel":{"length":"10","width":"8","height":"4","weight":"15.4"},"customs_info":{"eel_pfc":"NOEEI 30.37(a)","customs_certify":"true","customs_signer":"Steve Brule","contents_type":"merchandise","restriction_type":"none","non_delivery_option":"return","customs_items":[{"description":"Sweet shirts","quantity":"2","weight":"11","value":"23.25","hs_tariff_number":"654321","origin_country":"US"}]},"options":{"label_format":"PNG","invoice_number":"123"},"reference":"123"}}' + response: + status: + code: 201 + message: Created + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 483169f666a00affe79a826500198da0 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + location: /api/v2/shipments/shp_f98d4ce802094693be6cc09f0776fea4 + content-type: 'application/json; charset=utf-8' + content-length: '6016' + x-runtime: '0.404928' + x-node: bigweb38nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb3nuq c0f5e722d1', 'extlb2nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"created_at":"2024-07-23T19:56:47Z","is_return":false,"messages":[{"carrier":"DhlEcs","carrier_account_id":"ca_23d193562e8e459bbd937c2aad3dd092","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cb65fc8581184ea38a3108f9e9d1e81c","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cd846680a6f74c23891086de730769d6","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_91e6857e8cb6455180f8ef8a3db8baaa","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_5e8c4f41363b432594441dbf98e4032e","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"}],"mode":"test","options":{"label_format":"PNG","invoice_number":"123","currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":"123","status":"unknown","tracking_code":null,"updated_at":"2024-07-23T19:56:47Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":{"id":"cstinfo_410438c715e845ddb92679d3a817b808","object":"CustomsInfo","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","contents_explanation":null,"contents_type":"merchandise","customs_certify":true,"customs_signer":"Steve Brule","eel_pfc":"NOEEI 30.37(a)","non_delivery_option":"return","restriction_comments":null,"restriction_type":"none","mode":"test","declaration":null,"customs_items":[{"id":"cstitem_63de9831d1e64b468b28f43e9e715f31","object":"CustomsItem","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","description":"Sweet shirts","hs_tariff_number":"654321","origin_country":"US","quantity":2,"value":"23.25","weight":11,"code":null,"mode":"test","manufacturer":null,"currency":null,"eccn":null,"printed_commodity_identifier":null}]},"from_address":{"id":"adr_b1bc55e7492d11efb3883cecef1b359e","object":"Address","created_at":"2024-07-23T19:56:47+00:00","updated_at":"2024-07-23T19:56:47+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"insurance":null,"order_id":null,"parcel":{"id":"prcl_0638b2a5adf144ff9e7c433d54bb8280","object":"Parcel","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","length":10,"width":8,"height":4,"predefined_package":null,"weight":15.4,"mode":"test"},"postage_label":null,"rates":[{"id":"rate_9cb5d83664e34e99b7baeb2c4095f826","object":"Rate","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","mode":"test","service":"Priority","carrier":"USPS","rate":"6.90","currency":"USD","retail_rate":"9.80","retail_currency":"USD","list_rate":"8.25","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_52ad857433dd40c281e0f30052f2f8c7","object":"Rate","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","mode":"test","service":"GroundAdvantage","carrier":"USPS","rate":"5.93","currency":"USD","retail_rate":"8.45","retail_currency":"USD","list_rate":"6.40","list_currency":"USD","billing_type":"easypost","delivery_days":3,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":3,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_222f07c3f3e74a79a157481fcb08191a","object":"Rate","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","mode":"test","service":"Express","carrier":"USPS","rate":"33.10","currency":"USD","retail_rate":"37.90","retail_currency":"USD","list_rate":"33.10","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"}],"refund_status":null,"scan_form":null,"selected_rate":null,"tracker":null,"to_address":{"id":"adr_b1ba8e13492d11efbceeac1f6bc53342","object":"Address","created_at":"2024-07-23T19:56:47+00:00","updated_at":"2024-07-23T19:56:47+00:00","name":"Elizabeth Swan","company":null,"street1":"179 N Harbor Dr","street2":null,"city":"Redondo Beach","state":"CA","zip":"90277","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"usps_zone":4,"return_address":{"id":"adr_b1bc55e7492d11efb3883cecef1b359e","object":"Address","created_at":"2024-07-23T19:56:47+00:00","updated_at":"2024-07-23T19:56:47+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"buyer_address":{"id":"adr_b1ba8e13492d11efbceeac1f6bc53342","object":"Address","created_at":"2024-07-23T19:56:47+00:00","updated_at":"2024-07-23T19:56:47+00:00","name":"Elizabeth Swan","company":null,"street1":"179 N Harbor Dr","street2":null,"city":"Redondo Beach","state":"CA","zip":"90277","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"forms":[],"fees":[],"id":"shp_f98d4ce802094693be6cc09f0776fea4","object":"Shipment"}' + curl_info: + url: 'https://api.easypost.com/v2/shipments' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 760 + request_size: 1172 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.945651 + namelookup_time: 0.024102 + connect_time: 0.163717 + pretransfer_time: 0.303224 + size_upload: 864.0 + size_download: 6016.0 + speed_download: 6361.0 + speed_upload: 913.0 + download_content_length: 6016.0 + upload_content_length: 864.0 + starttransfer_time: 0.945567 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.130 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63816 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 303098 + connect_time_us: 163717 + namelookup_time_us: 24102 + pretransfer_time_us: 303224 + redirect_time_us: 0 + starttransfer_time_us: 945567 + total_time_us: 945651 + effective_method: POST + capath: '' + cainfo: '' + index: 0 +- + request: + method: POST + url: 'https://api.easypost.com/v2/shipments/shp_f98d4ce802094693be6cc09f0776fea4/buy' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"rate":{"id":"rate_52ad857433dd40c281e0f30052f2f8c7"},"insurance":"100"}' + response: + status: + code: 200 + message: OK + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 483169f866a00b00e79a826600198e7f + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '8235' + x-runtime: '0.822800' + x-node: bigweb38nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb3nuq c0f5e722d1', 'extlb2nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"created_at":"2024-07-23T19:56:47Z","is_return":false,"messages":[{"carrier":"DhlEcs","carrier_account_id":"ca_23d193562e8e459bbd937c2aad3dd092","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cb65fc8581184ea38a3108f9e9d1e81c","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_cd846680a6f74c23891086de730769d6","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_91e6857e8cb6455180f8ef8a3db8baaa","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"},{"carrier":"DhlEcs","carrier_account_id":"ca_5e8c4f41363b432594441dbf98e4032e","type":"rate_error","message":"shipment.customs_info.customs_items.0.code: field required"}],"mode":"test","options":{"label_format":"PNG","invoice_number":"123","currency":"USD","payment":{"type":"SENDER"},"date_advance":0},"reference":"123","status":"unknown","tracking_code":"9400100110368066400960","updated_at":"2024-07-23T19:56:49Z","batch_id":null,"batch_status":null,"batch_message":null,"customs_info":{"id":"cstinfo_410438c715e845ddb92679d3a817b808","object":"CustomsInfo","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","contents_explanation":null,"contents_type":"merchandise","customs_certify":true,"customs_signer":"Steve Brule","eel_pfc":"NOEEI 30.37(a)","non_delivery_option":"return","restriction_comments":null,"restriction_type":"none","mode":"test","declaration":null,"customs_items":[{"id":"cstitem_63de9831d1e64b468b28f43e9e715f31","object":"CustomsItem","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","description":"Sweet shirts","hs_tariff_number":"654321","origin_country":"US","quantity":2,"value":"23.25","weight":11,"code":null,"mode":"test","manufacturer":null,"currency":null,"eccn":null,"printed_commodity_identifier":null}]},"from_address":{"id":"adr_b1bc55e7492d11efb3883cecef1b359e","object":"Address","created_at":"2024-07-23T19:56:47+00:00","updated_at":"2024-07-23T19:56:47+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"insurance":"100.00","order_id":null,"parcel":{"id":"prcl_0638b2a5adf144ff9e7c433d54bb8280","object":"Parcel","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","length":10,"width":8,"height":4,"predefined_package":null,"weight":15.4,"mode":"test"},"postage_label":{"object":"PostageLabel","id":"pl_09363e8ab69f4732b905c30814a6d3c8","created_at":"2024-07-23T19:56:48Z","updated_at":"2024-07-23T19:56:49Z","date_advance":0,"integrated_form":"none","label_date":"2024-07-23T19:56:48Z","label_resolution":300,"label_size":"4x6","label_type":"default","label_file_type":"image\/png","label_url":"https:\/\/easypost-files.s3.us-west-2.amazonaws.com\/files\/postage_label\/20240723\/e855ddb686a93e4673a6e1f838ae0471f2.png","label_pdf_url":null,"label_zpl_url":null,"label_epl2_url":null,"label_file":null},"rates":[{"id":"rate_9cb5d83664e34e99b7baeb2c4095f826","object":"Rate","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","mode":"test","service":"Priority","carrier":"USPS","rate":"6.90","currency":"USD","retail_rate":"9.80","retail_currency":"USD","list_rate":"8.25","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_52ad857433dd40c281e0f30052f2f8c7","object":"Rate","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","mode":"test","service":"GroundAdvantage","carrier":"USPS","rate":"5.93","currency":"USD","retail_rate":"8.45","retail_currency":"USD","list_rate":"6.40","list_currency":"USD","billing_type":"easypost","delivery_days":3,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":3,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},{"id":"rate_222f07c3f3e74a79a157481fcb08191a","object":"Rate","created_at":"2024-07-23T19:56:47Z","updated_at":"2024-07-23T19:56:47Z","mode":"test","service":"Express","carrier":"USPS","rate":"33.10","currency":"USD","retail_rate":"37.90","retail_currency":"USD","list_rate":"33.10","list_currency":"USD","billing_type":"easypost","delivery_days":2,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":2,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"}],"refund_status":null,"scan_form":null,"selected_rate":{"id":"rate_52ad857433dd40c281e0f30052f2f8c7","object":"Rate","created_at":"2024-07-23T19:56:48Z","updated_at":"2024-07-23T19:56:48Z","mode":"test","service":"GroundAdvantage","carrier":"USPS","rate":"5.93","currency":"USD","retail_rate":"8.45","retail_currency":"USD","list_rate":"6.40","list_currency":"USD","billing_type":"easypost","delivery_days":3,"delivery_date":null,"delivery_date_guaranteed":false,"est_delivery_days":3,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","carrier_account_id":"ca_8dc116debcdb49b5a66a2ddee4612600"},"tracker":{"id":"trk_b1c8a176410f40f193def5a36c3652e2","object":"Tracker","mode":"test","tracking_code":"9400100110368066400960","status":"unknown","status_detail":"unknown","created_at":"2024-07-23T19:56:49Z","updated_at":"2024-07-23T19:56:49Z","signed_by":null,"weight":null,"est_delivery_date":null,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","carrier":"USPS","tracking_details":[],"fees":[],"carrier_detail":null,"public_url":"https:\/\/track.easypost.com\/djE6dHJrX2IxYzhhMTc2NDEwZjQwZjE5M2RlZjVhMzZjMzY1MmUy"},"to_address":{"id":"adr_b1ba8e13492d11efbceeac1f6bc53342","object":"Address","created_at":"2024-07-23T19:56:47+00:00","updated_at":"2024-07-23T19:56:48+00:00","name":"ELIZABETH SWAN","company":null,"street1":"179 N HARBOR DR","street2":"","city":"REDONDO BEACH","state":"CA","zip":"90277-2506","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":false,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":33.8436,"longitude":-118.39177,"time_zone":"America\/Los_Angeles"}}}},"usps_zone":4,"return_address":{"id":"adr_b1bc55e7492d11efb3883cecef1b359e","object":"Address","created_at":"2024-07-23T19:56:47+00:00","updated_at":"2024-07-23T19:56:47+00:00","name":"Jack Sparrow","company":null,"street1":"388 Townsend St","street2":"Apt 20","city":"San Francisco","state":"CA","zip":"94107","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":[]},"buyer_address":{"id":"adr_b1ba8e13492d11efbceeac1f6bc53342","object":"Address","created_at":"2024-07-23T19:56:47+00:00","updated_at":"2024-07-23T19:56:48+00:00","name":"ELIZABETH SWAN","company":null,"street1":"179 N HARBOR DR","street2":"","city":"REDONDO BEACH","state":"CA","zip":"90277-2506","country":"US","phone":"","email":"","mode":"test","carrier_facility":null,"residential":false,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":33.8436,"longitude":-118.39177,"time_zone":"America\/Los_Angeles"}}}},"forms":[],"fees":[{"object":"Fee","type":"LabelFee","amount":"0.00000","charged":true,"refunded":false},{"object":"Fee","type":"PostageFee","amount":"5.93000","charged":true,"refunded":false},{"object":"Fee","type":"InsuranceFee","amount":"0.50000","charged":true,"refunded":false}],"id":"shp_f98d4ce802094693be6cc09f0776fea4","object":"Shipment"}' + curl_info: + url: 'https://api.easypost.com/v2/shipments/shp_f98d4ce802094693be6cc09f0776fea4/buy' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 689 + request_size: 421 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 1.247348 + namelookup_time: 0.00124 + connect_time: 0.137954 + pretransfer_time: 0.288763 + size_upload: 73.0 + size_download: 8235.0 + speed_download: 6602.0 + speed_upload: 58.0 + download_content_length: 8235.0 + upload_content_length: 73.0 + starttransfer_time: 1.247331 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.130 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63817 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 288605 + connect_time_us: 137954 + namelookup_time_us: 1240 + pretransfer_time_us: 288763 + redirect_time_us: 0 + starttransfer_time_us: 1247331 + total_time_us: 1247348 + effective_method: POST + capath: '' + cainfo: '' + index: 0 +- + request: + method: POST + url: 'https://api.easypost.com/v2/claims' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"type":"damage","email_evidence_attachments":["data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8\/\/8\/AwAI\/AL+4Q7AIAAAAABJRU5ErkJggg=="],"invoice_attachments":["data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8\/\/8\/AwAI\/AL+4Q7AIAAAAABJRU5ErkJggg=="],"supporting_documentation_attachments":["data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAeUlEQVR42mP8\/\/8\/AwAI\/AL+4Q7AIAAAAABJRU5ErkJggg=="],"description":"Test description","contact_email":"test@example.com","tracking_code":"9400100110368066400960","amount":"100"}' + response: + status: + code: 201 + message: Created + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 98f5faea66a00b01e79a82680018dd99 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '1111' + x-runtime: '0.832951' + x-node: bigweb53nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-proxied: ['intlb4nuq c0f5e722d1', 'extlb1nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"approved_amount":null,"attachments":["https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/379d4f0d76c847adabddde44f53f397d.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/d55632462ea34ac3a8419cd735e12708.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/0df078001f3849c982cc00fca02f738a.png"],"check_delivery_address":null,"contact_email":"test@example.com","created_at":"2024-07-23T19:56:49","description":"Test description","history":[{"status":"submitted","status_detail":"Claim was created.","timestamp":"2024-07-23T19:56:49"}],"id":"clm_097ed5afc86d45149655a63fd31bc810","insurance_amount":"100.00","insurance_id":"ins_6d1b3e02c4e041b08b00254e3c45ca79","mode":"test","object":"Claim","payment_method":"easypost_wallet","recipient_name":null,"requested_amount":"100.00","salvage_value":null,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","status":"submitted","status_detail":"Claim was created.","status_timestamp":"2024-07-23T19:56:49","tracking_code":"9400100110368066400960","type":"damage","updated_at":"2024-07-23T19:56:49"}' + curl_info: + url: 'https://api.easypost.com/v2/claims' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 694 + request_size: 920 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 1.226971 + namelookup_time: 0.001134 + connect_time: 0.129059 + pretransfer_time: 0.259929 + size_upload: 615.0 + size_download: 1111.0 + speed_download: 905.0 + speed_upload: 501.0 + download_content_length: 1111.0 + upload_content_length: 615.0 + starttransfer_time: 1.225443 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.131 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63819 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 259797 + connect_time_us: 129059 + namelookup_time_us: 1134 + pretransfer_time_us: 259929 + redirect_time_us: 0 + starttransfer_time_us: 1225443 + total_time_us: 1226971 + effective_method: POST + capath: '' + cainfo: '' + index: 0 +- + request: + method: GET + url: 'https://api.easypost.com/v2/claims/clm_097ed5afc86d45149655a63fd31bc810' + headers: + Host: api.easypost.com + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + response: + status: + code: 200 + message: OK + headers: + x-frame-options: SAMEORIGIN + x-xss-protection: '1; mode=block' + x-content-type-options: nosniff + x-download-options: noopen + x-permitted-cross-domain-policies: none + referrer-policy: strict-origin-when-cross-origin + x-ep-request-uuid: 483169f966a00b02e79a8282001990b4 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '1111' + x-runtime: '0.039915' + x-node: bigweb32nuq + x-version-label: easypost-202407231832-14d334dc13-master + x-backend: easypost + x-canary: direct + x-proxied: ['intlb4nuq c0f5e722d1', 'extlb2nuq fa152d4755'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"approved_amount":null,"attachments":["https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/379d4f0d76c847adabddde44f53f397d.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/d55632462ea34ac3a8419cd735e12708.png","https:\/\/easypost-files.s3-us-west-2.amazonaws.com\/insurance\/20240723\/0df078001f3849c982cc00fca02f738a.png"],"check_delivery_address":null,"contact_email":"test@example.com","created_at":"2024-07-23T19:56:49","description":"Test description","history":[{"status":"submitted","status_detail":"Claim was created.","timestamp":"2024-07-23T19:56:49"}],"id":"clm_097ed5afc86d45149655a63fd31bc810","insurance_amount":"100.00","insurance_id":"ins_6d1b3e02c4e041b08b00254e3c45ca79","mode":"test","object":"Claim","payment_method":"easypost_wallet","recipient_name":null,"requested_amount":"100.00","salvage_value":null,"shipment_id":"shp_f98d4ce802094693be6cc09f0776fea4","status":"submitted","status_detail":"Claim was created.","status_timestamp":"2024-07-23T19:56:49","tracking_code":"9400100110368066400960","type":"damage","updated_at":"2024-07-23T19:56:49"}' + curl_info: + url: 'https://api.easypost.com/v2/claims/clm_097ed5afc86d45149655a63fd31bc810' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 707 + request_size: 320 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.438676 + namelookup_time: 0.001202 + connect_time: 0.131545 + pretransfer_time: 0.267106 + size_upload: 0.0 + size_download: 1111.0 + speed_download: 2532.0 + speed_upload: 0.0 + download_content_length: 1111.0 + upload_content_length: 0.0 + starttransfer_time: 0.438661 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 169.62.110.130 + certinfo: { } + primary_port: 443 + local_ip: 10.130.6.14 + local_port: 63822 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 267055 + connect_time_us: 131545 + namelookup_time_us: 1202 + pretransfer_time_us: 267106 + redirect_time_us: 0 + starttransfer_time_us: 438661 + total_time_us: 438676 + effective_method: GET + capath: '' + cainfo: '' + index: 0