diff --git a/CHANGELOG.md b/CHANGELOG.md index 991824ef..2ad42266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Removes the deprecated, unusable `addCreditCard` function - Stripe has disabled the ability to pass plain credit card details over the wire and now requires using [Stripe.js/Elements/Checkout](https://support.stripe.com/questions/card-tokenization-restrictions-using-publishable-keys). Follow the [Decentralized (EasyPost-Manage Billing) Guide](https://docs.easypost.com/guides/get-started-with-forge/easypost-managed-billing-guide#referralcustomer-billing-management) for more details on the new flow to use. - Makes `referralCustomer.retrieveEasypostStripeApiKey` public to help facilitate adding credit cards using Stripe.js +- Adds support for `FedexDefaultAccount`, `GofoWalletAccount`, `UpsDapAccount`, `UniUniWalletAccount`, and `VehoWalletAccount` by properly routing carrier-account create requests to the `/carrier_accounts/open` endpoint ## v8.8.3 (2026-08-26) diff --git a/lib/EasyPost/Constant/Constants.php b/lib/EasyPost/Constant/Constants.php index 522c2557..72057180 100644 --- a/lib/EasyPost/Constant/Constants.php +++ b/lib/EasyPost/Constant/Constants.php @@ -15,17 +15,25 @@ abstract class Constants const SUPPORT_EMAIL = 'support@easypost.com'; // Validation - const CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS = [ - 'FedexAccount', - 'FedexSmartpostAccount' - ]; - - const CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH = [ - 'AmazonShippingAccount', - 'UpsAccount', - 'UpsMailInnovationsAccount', - 'UpsSurepostAccount', - 'UspsShipAccount', + const CARRIER_ACCOUNT_CREATE_ENDPOINT_TYPES = [ + '/carrier_accounts/open' => [ + 'FedexDefaultAccount', + 'GofoWalletAccount', + 'UpsDapAccount', + 'UniUniWalletAccount', + 'VehoWalletAccount', + ], + '/carrier_accounts/register' => [ + 'FedexAccount', + 'FedexSmartpostAccount', + ], + '/carrier_accounts/register_oauth' => [ + 'AmazonShippingAccount', + 'UpsAccount', + 'UpsMailInnovationsAccount', + 'UpsSurepostAccount', + 'UspsShipAccount', + ], ]; // Exception messages (many of these are intended to be used with `sprintf()`) diff --git a/lib/EasyPost/Service/CarrierAccountService.php b/lib/EasyPost/Service/CarrierAccountService.php index cf051fa8..8fc7700e 100644 --- a/lib/EasyPost/Service/CarrierAccountService.php +++ b/lib/EasyPost/Service/CarrierAccountService.php @@ -75,8 +75,8 @@ public function create(mixed $params = null): mixed } $carrierAccountType = $params['type']; - $params = [self::selectTopLayerKey($carrierAccountType) => $params]; $url = self::selectCarrierAccountCreationEndpoint($carrierAccountType); + $params = [self::selectTopLayerKey($url) => $params]; $response = Requestor::request($this->client, HttpMethod::POST, $url, $params); return InternalUtil::convertToEasyPostObject($this->client, $response); @@ -103,10 +103,10 @@ public function types(mixed $params = null): mixed */ private function selectCarrierAccountCreationEndpoint(string $carrierAccountType): string { - if (in_array($carrierAccountType, Constants::CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS, true)) { - return '/carrier_accounts/register'; - } else if (in_array($carrierAccountType, Constants::CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH, true)) { - return '/carrier_accounts/register_oauth'; + foreach (Constants::CARRIER_ACCOUNT_CREATE_ENDPOINT_TYPES as $endpoint => $carrierAccountTypes) { + if (in_array($carrierAccountType, $carrierAccountTypes, true)) { + return $endpoint; + } } return '/carrier_accounts'; @@ -115,12 +115,12 @@ private function selectCarrierAccountCreationEndpoint(string $carrierAccountType /** * Select the top-key layer for creating/updating a carrier account based on the type of carrier account. * - * @param string $carrierAccountType The type of carrier account to create. + * @param string $carrierAccountUrl The URL used for the carrier-account create endpoint. * @return string The top-layer key for creating/updating a carrier account. */ - private function selectTopLayerKey(string $carrierAccountType): string + private function selectTopLayerKey(string $carrierAccountUrl): string { - if (in_array($carrierAccountType, Constants::CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH, true)) { + if ($carrierAccountUrl === '/carrier_accounts/register_oauth') { return 'carrier_account_oauth_registrations'; } else { return 'carrier_account'; diff --git a/test/EasyPost/CarrierAccountTest.php b/test/EasyPost/CarrierAccountTest.php index 62c39141..569d307a 100644 --- a/test/EasyPost/CarrierAccountTest.php +++ b/test/EasyPost/CarrierAccountTest.php @@ -3,8 +3,8 @@ namespace EasyPost\Test; use EasyPost\CarrierAccount; +use EasyPost\Constant\Constants; use EasyPost\EasyPostClient; -use EasyPost\Exception\Api\ApiException; use EasyPost\Exception\General\MissingParameterException; use PHPUnit\Framework\TestCase; @@ -30,60 +30,50 @@ public static function tearDownAfterClass(): void } /** - * Test creating a carrier account. + * @return array> */ - public function testCreate(): void + public static function carrierAccountCreateUrlRoutingDataProvider(): array { - TestUtil::setupCassette('carrier_accounts/create.yml'); - - self::$client = new EasyPostClient((string)getenv('EASYPOST_PROD_API_KEY')); - - $carrierAccount = self::$client->carrierAccount->create(Fixture::basicCarrierAccount()); - - $this->assertEquals('DhlEcsAccount', $carrierAccount->type); - $this->assertInstanceOf(CarrierAccount::class, $carrierAccount); - $this->assertStringMatchesFormat('ca_%s', $carrierAccount->id); + $tests = []; + + foreach (Constants::CARRIER_ACCOUNT_CREATE_ENDPOINT_TYPES as $endpoint => $carrierAccountTypes) { + foreach ($carrierAccountTypes as $carrierAccountType) { + $tests[$carrierAccountType] = [ + $carrierAccountType, + $endpoint, + self::carrierCreatePayloadForEndpoint($endpoint), + ]; + } + } - // Delete the carrier account once it's done being tested. - self::$client->carrierAccount->delete($carrierAccount->id); + return $tests; } /** - * Test creating a UPS account. + * @param string $endpoint + * @return array */ - public function testCreateUps(): void + private static function carrierCreatePayloadForEndpoint(string $endpoint): array { - TestUtil::setupCassette('carrier_accounts/create_ups.yml'); - - self::$client = new EasyPostClient((string)getenv('EASYPOST_PROD_API_KEY')); - - $carrierAccount = self::$client->carrierAccount->create([ - 'type' => 'UpsAccount', - 'account_number' => '123456789' - ]); - - $this->assertEquals('UpsAccount', $carrierAccount->type); - $this->assertInstanceOf(CarrierAccount::class, $carrierAccount); - $this->assertStringMatchesFormat('ca_%s', $carrierAccount->id); + if ($endpoint === '/carrier_accounts/open' || $endpoint === '/carrier_accounts/register') { + return ['registration_data' => []]; + } - // Delete the carrier account once it's done being tested. - self::$client->carrierAccount->delete($carrierAccount->id); + return []; } /** - * Test creating an Amazon account. + * Test creating a carrier account. */ - public function testCreateAmazon(): void + public function testCreate(): void { - TestUtil::setupCassette('carrier_accounts/create_amazon.yml'); + TestUtil::setupCassette('carrier_accounts/create.yml'); self::$client = new EasyPostClient((string)getenv('EASYPOST_PROD_API_KEY')); - $carrierAccount = self::$client->carrierAccount->create([ - 'type' => 'AmazonShippingAccount', - ]); + $carrierAccount = self::$client->carrierAccount->create(Fixture::basicCarrierAccount()); - $this->assertEquals('AmazonShippingAccount', $carrierAccount->type); + $this->assertEquals('DhlEcsAccount', $carrierAccount->type); $this->assertInstanceOf(CarrierAccount::class, $carrierAccount); $this->assertStringMatchesFormat('ca_%s', $carrierAccount->id); @@ -112,40 +102,49 @@ public function testCreateWithoutType(): void } /** - * Test creating a carrier account with custom workflow such as FedEx or UPS. + * Test creating carrier accounts with custom endpoint routing. * - * We purposefully don't pass data here because real data is required for this endpoint - * which we don't have in a test context, simply assert the error matches when no data is passed. + * @dataProvider carrierAccountCreateUrlRoutingDataProvider + * @param array $params */ - public function testCreateWithCustomWorkflow(): void - { - TestUtil::setupCassette('carrier_accounts/createWithCustomWorkflow.yml'); - + public function testCreateUrlRouting( + string $carrierAccountType, + string $expectedEndpoint, + array $params + ): void { + $capturedRequest = []; + TestUtil::setupCassette("carrier_accounts/create_url_routing_{$carrierAccountType}.yml"); self::$client = new EasyPostClient((string)getenv('EASYPOST_PROD_API_KEY')); + self::$client->requestEvent->addHandler(function (array $requestInfo) use (&$capturedRequest): void { + if (!isset($capturedRequest['path']) && str_contains($requestInfo['path'], '/carrier_accounts')) { + $capturedRequest = $requestInfo; + } + }); - $data = []; - $data['type'] = 'FedexAccount'; - // We have to send some registration data, otherwise API will throw a 400 Bad Request - $data['registration_data'] = ['some' => 'data']; - - $errorFound = false; - + $payload = ['type' => $carrierAccountType] + $params; + $carrierAccount = null; try { - $carrierAccount = self::$client->carrierAccount->create($data); - // Delete the carrier account once it's done being tested (should not be reached). - self::$client->carrierAccount->delete($carrierAccount->id); - } catch (ApiException $error) { - $this->assertEquals(422, $error->getHttpStatus()); - $errors = $error->errors; - foreach ($errors as $error) { - if ($error['field'] == 'account_number' && $error['message'] == 'must be present and a string') { - $errorFound = true; - break; - } + $carrierAccount = self::$client->carrierAccount->create($payload); + } catch (\Exception $error) { + if ($error instanceof \EasyPost\Exception\Api\ApiException) { + $this->assertNotContains($error->getHttpStatus(), [404, 500]); + } else { + throw $error; } } - $this->assertTrue($errorFound); + if ($carrierAccount !== null) { + $this->assertInstanceOf(CarrierAccount::class, $carrierAccount); + $this->assertStringMatchesFormat('ca_%s', $carrierAccount->id); + self::$client->carrierAccount->delete($carrierAccount->id); + } + + $this->assertEquals(Constants::API_BASE . '/v2' . $expectedEndpoint, $capturedRequest['path']); + if ($expectedEndpoint === '/carrier_accounts/register_oauth') { + $this->assertArrayHasKey('carrier_account_oauth_registrations', $capturedRequest['request_body']); + } else { + $this->assertArrayHasKey('carrier_account', $capturedRequest['request_body']); + } } /** @@ -182,33 +181,6 @@ public function testAll(): void $this->assertContainsOnlyInstancesOf(CarrierAccount::class, $carrierAccounts); } - /** - * Test updating an UPS account. - */ - public function testUpdateUps(): void - { - TestUtil::setupCassette('carrier_accounts/update_ups.yml'); - - self::$client = new EasyPostClient((string)getenv('EASYPOST_PROD_API_KEY')); - - $carrierAccount = self::$client->carrierAccount->create([ - 'type' => 'UpsAccount', - 'account_number' => '123456789' - ]); - - $updatedCarrierAccount = self::$client->carrierAccount->update( - $carrierAccount->id, - ['account_number' => '987654321'] - ); - - $this->assertInstanceOf(CarrierAccount::class, $updatedCarrierAccount); - $this->assertStringMatchesFormat('ca_%s', $updatedCarrierAccount->id); - $this->assertEquals('UpsAccount', $updatedCarrierAccount->type); - - // Delete the carrier account once it's done being tested. - self::$client->carrierAccount->delete($updatedCarrierAccount->id); - } - /** * Test updating a carrier account. */ diff --git a/test/cassettes/carrier_accounts/create_url_routing_AmazonShippingAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_AmazonShippingAccount.yml new file mode 100644 index 00000000..2d75381b --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_AmazonShippingAccount.yml @@ -0,0 +1,173 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account_oauth_registrations":{"type":"AmazonShippingAccount"}}' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: ef2f75726ad13f68e2cc17900014b0a0 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '1737' + x-runtime: '0.110726' + x-node: web115azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb3azw f29267e751', 'extlb1azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"id":"ca_62c4b9a1b81d4ecc85ae4e31a7cb7120","object":"CarrierAccount","type":"AmazonShippingAccount","clone":false,"created_at":"2026-10-15T21:02:32Z","updated_at":"2026-10-15T21:02:32Z","description":null,"reference":null,"billing_type":"carrier","readable":"Amazon Shipping","logo":null,"fields":[],"credentials":[],"test_credentials":[]}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 752 + request_size: 401 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.195012 + namelookup_time: 0.00219 + connect_time: 0.026214 + pretransfer_time: 0.054536 + size_upload: 72.0 + size_download: 1737.0 + speed_download: 8907.0 + speed_upload: 369.0 + download_content_length: 1737.0 + upload_content_length: 72.0 + starttransfer_time: 0.19498 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64150 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 54497 + queue_time_us: 13 + connect_time_us: 26214 + namelookup_time_us: 2190 + pretransfer_time_us: 54536 + redirect_time_us: 0 + starttransfer_time_us: 194980 + posttransfer_time_us: 54536 + total_time_us: 195012 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 +- + request: + method: DELETE + url: 'https://api.easypost.com/v2/carrier_accounts/ca_62c4b9a1b81d4ecc85ae4e31a7cb7120' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: cdd5852f6ad13f68e2cc17910014c002 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '2' + x-runtime: '0.119095' + x-node: web113azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb1azw f29267e751', 'extlb2azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '[]' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/ca_62c4b9a1b81d4ecc85ae4e31a7cb7120' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 744 + request_size: 332 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.208916 + namelookup_time: 0.003475 + connect_time: 0.028409 + pretransfer_time: 0.057249 + size_upload: 0.0 + size_download: 2.0 + speed_download: 9.0 + speed_upload: 0.0 + download_content_length: 2.0 + upload_content_length: 0.0 + starttransfer_time: 0.208871 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64151 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 57208 + queue_time_us: 10 + connect_time_us: 28409 + namelookup_time_us: 3475 + pretransfer_time_us: 57249 + redirect_time_us: 0 + starttransfer_time_us: 208871 + posttransfer_time_us: 57249 + total_time_us: 208916 + effective_method: DELETE + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_FedexAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_FedexAccount.yml new file mode 100644 index 00000000..5785c00b --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_FedexAccount.yml @@ -0,0 +1,88 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/register' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account":{"type":"FedexAccount","registration_data":[]}}' + response: + status: + code: 400 + message: 'Bad Request' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: 2cb8c6476ad13f67e2cc17770014befa + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '112' + x-runtime: '0.020703' + x-node: web110azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb1azw f29267e751', 'extlb2azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"error":{"code":"BAD_REQUEST","message":"Malformed request. Please check the contents and retry.","errors":[]}}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/register' + content_type: 'application/json; charset=utf-8' + http_code: 400 + header_size: 755 + request_size: 389 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.119292 + namelookup_time: 0.003605 + connect_time: 0.030432 + pretransfer_time: 0.060708 + size_upload: 66.0 + size_download: 112.0 + speed_download: 938.0 + speed_upload: 553.0 + download_content_length: 112.0 + upload_content_length: 66.0 + starttransfer_time: 0.119251 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64148 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 60640 + queue_time_us: 18 + connect_time_us: 30432 + namelookup_time_us: 3605 + pretransfer_time_us: 60708 + redirect_time_us: 0 + starttransfer_time_us: 119251 + posttransfer_time_us: 60708 + total_time_us: 119292 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_FedexDefaultAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_FedexDefaultAccount.yml new file mode 100644 index 00000000..e0c6b116 --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_FedexDefaultAccount.yml @@ -0,0 +1,88 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/open' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account":{"type":"FedexDefaultAccount","registration_data":[]}}' + response: + status: + code: 422 + message: 'Unprocessable Entity' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: add87ec76ad13f66e2cc176f006e1247 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '453' + x-runtime: '0.032359' + x-node: web118azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb1azw f29267e751', 'extlb3azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"error":{"code":"UNPROCESSABLE_ENTITY","message":"The request was understood, but cannot be processed.","errors":[{"field":"name","message":"is missing"},{"field":"street1","message":"is missing"},{"field":"city","message":"is missing"},{"field":"state","message":"is missing"},{"field":"postal_code","message":"is missing"},{"field":"country","message":"is missing"},{"field":"phone","message":"is missing"},{"field":"email","message":"is missing"}]}}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/open' + content_type: 'application/json; charset=utf-8' + http_code: 422 + header_size: 764 + request_size: 392 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.155085 + namelookup_time: 0.037613 + connect_time: 0.061864 + pretransfer_time: 0.091443 + size_upload: 73.0 + size_download: 453.0 + speed_download: 2921.0 + speed_upload: 470.0 + download_content_length: 453.0 + upload_content_length: 73.0 + starttransfer_time: 0.155062 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64140 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 91385 + queue_time_us: 7 + connect_time_us: 61864 + namelookup_time_us: 37613 + pretransfer_time_us: 91443 + redirect_time_us: 0 + starttransfer_time_us: 155062 + posttransfer_time_us: 91443 + total_time_us: 155085 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_FedexSmartpostAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_FedexSmartpostAccount.yml new file mode 100644 index 00000000..95763de5 --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_FedexSmartpostAccount.yml @@ -0,0 +1,88 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/register' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account":{"type":"FedexSmartpostAccount","registration_data":[]}}' + response: + status: + code: 400 + message: 'Bad Request' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: aebfacb46ad13f67e2cc1778006e1669 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '112' + x-runtime: '0.023471' + x-node: web107azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb3azw f29267e751', 'extlb3azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"error":{"code":"BAD_REQUEST","message":"Malformed request. Please check the contents and retry.","errors":[]}}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/register' + content_type: 'application/json; charset=utf-8' + http_code: 400 + header_size: 755 + request_size: 398 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.117465 + namelookup_time: 0.004216 + connect_time: 0.032431 + pretransfer_time: 0.063355 + size_upload: 75.0 + size_download: 112.0 + speed_download: 953.0 + speed_upload: 638.0 + download_content_length: 112.0 + upload_content_length: 75.0 + starttransfer_time: 0.117444 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64149 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 63284 + queue_time_us: 12 + connect_time_us: 32431 + namelookup_time_us: 4216 + pretransfer_time_us: 63355 + redirect_time_us: 0 + starttransfer_time_us: 117444 + posttransfer_time_us: 63355 + total_time_us: 117465 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_GofoWalletAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_GofoWalletAccount.yml new file mode 100644 index 00000000..b9ba7866 --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_GofoWalletAccount.yml @@ -0,0 +1,173 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/open' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account":{"type":"GofoWalletAccount","registration_data":[]}}' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: ef2f75726ad13f66e2cc17700014acbb + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '460' + x-runtime: '0.084683' + x-node: web124azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb2azw f29267e751', 'extlb1azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"id":"ca_a2b7e2517eba44dfaf32c19c0b31987e","object":"CarrierAccount","type":"GofoWalletAccount","clone":false,"created_at":"2026-10-15T21:02:30Z","updated_at":"2026-10-15T21:02:30Z","description":"GOFO Wallet Account","reference":null,"billing_type":"easypost","readable":"GOFO Wallet","logo":null,"fields":[],"credentials":[],"test_credentials":[]}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/open' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 751 + request_size: 390 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.17535 + namelookup_time: 0.002475 + connect_time: 0.029036 + pretransfer_time: 0.060299 + size_upload: 71.0 + size_download: 460.0 + speed_download: 2623.0 + speed_upload: 404.0 + download_content_length: 460.0 + upload_content_length: 71.0 + starttransfer_time: 0.17531 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64141 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 60261 + queue_time_us: 8 + connect_time_us: 29036 + namelookup_time_us: 2475 + pretransfer_time_us: 60299 + redirect_time_us: 0 + starttransfer_time_us: 175310 + posttransfer_time_us: 60299 + total_time_us: 175350 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 +- + request: + method: DELETE + url: 'https://api.easypost.com/v2/carrier_accounts/ca_a2b7e2517eba44dfaf32c19c0b31987e' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: 2cb8c6446ad13f66e2cc17710014bc8d + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '2' + x-runtime: '0.133368' + x-node: web120azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb1azw f29267e751', 'extlb2azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '[]' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/ca_a2b7e2517eba44dfaf32c19c0b31987e' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 744 + request_size: 332 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.221803 + namelookup_time: 0.002425 + connect_time: 0.02759 + pretransfer_time: 0.055623 + size_upload: 0.0 + size_download: 2.0 + speed_download: 9.0 + speed_upload: 0.0 + download_content_length: 2.0 + upload_content_length: 0.0 + starttransfer_time: 0.221731 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64142 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 55576 + queue_time_us: 10 + connect_time_us: 27590 + namelookup_time_us: 2425 + pretransfer_time_us: 55623 + redirect_time_us: 0 + starttransfer_time_us: 221731 + posttransfer_time_us: 55623 + total_time_us: 221803 + effective_method: DELETE + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_UniUniWalletAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_UniUniWalletAccount.yml new file mode 100644 index 00000000..0dfc8958 --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_UniUniWalletAccount.yml @@ -0,0 +1,173 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/open' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account":{"type":"UniUniWalletAccount","registration_data":[]}}' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: 5218e58a6ad13f66e2cc17730014ae0f + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '600' + x-runtime: '0.077294' + x-node: web126azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb1azw f29267e751', 'extlb1azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"id":"ca_5725322703164b7f8dc226fa35cfb3d7","object":"CarrierAccount","type":"UniUniWalletAccount","clone":false,"created_at":"2026-10-15T21:02:31Z","updated_at":"2026-10-15T21:02:31Z","description":"UniUni Wallet Account","reference":null,"billing_type":"easypost","readable":"UniUni Wallet","logo":null,"fields":[],"credentials":[],"test_credentials":[]}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/open' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 751 + request_size: 392 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.180279 + namelookup_time: 0.002701 + connect_time: 0.029802 + pretransfer_time: 0.064553 + size_upload: 73.0 + size_download: 600.0 + speed_download: 3328.0 + speed_upload: 404.0 + download_content_length: 600.0 + upload_content_length: 73.0 + starttransfer_time: 0.180236 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64144 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 64478 + queue_time_us: 12 + connect_time_us: 29802 + namelookup_time_us: 2701 + pretransfer_time_us: 64553 + redirect_time_us: 0 + starttransfer_time_us: 180236 + posttransfer_time_us: 64553 + total_time_us: 180279 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 +- + request: + method: DELETE + url: 'https://api.easypost.com/v2/carrier_accounts/ca_5725322703164b7f8dc226fa35cfb3d7' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: cdd5852d6ad13f67e2cc17740014bda4 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '2' + x-runtime: '0.148380' + x-node: web114azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb2azw f29267e751', 'extlb2azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '[]' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/ca_5725322703164b7f8dc226fa35cfb3d7' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 744 + request_size: 332 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.23814 + namelookup_time: 0.005126 + connect_time: 0.02999 + pretransfer_time: 0.060012 + size_upload: 0.0 + size_download: 2.0 + speed_download: 8.0 + speed_upload: 0.0 + download_content_length: 2.0 + upload_content_length: 0.0 + starttransfer_time: 0.238039 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64145 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 59976 + queue_time_us: 18 + connect_time_us: 29990 + namelookup_time_us: 5126 + pretransfer_time_us: 60012 + redirect_time_us: 0 + starttransfer_time_us: 238039 + posttransfer_time_us: 60012 + total_time_us: 238140 + effective_method: DELETE + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_UpsAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_UpsAccount.yml new file mode 100644 index 00000000..bfc94f48 --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_UpsAccount.yml @@ -0,0 +1,88 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account_oauth_registrations":{"type":"UpsAccount"}}' + response: + status: + code: 422 + message: 'Unprocessable Entity' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: add87ec46ad13f68e2cc1792006e17a9 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '227' + x-runtime: '0.029751' + x-node: web111azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb4azw f29267e751', 'extlb3azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"error":{"code":"UNPROCESSABLE_ENTITY","message":"The request was understood, but cannot be processed.","errors":[{"field":"account_number","message":"The provided Carrier Account''s Account Number is required but missing."}]}}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + content_type: 'application/json; charset=utf-8' + http_code: 422 + header_size: 764 + request_size: 390 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.134247 + namelookup_time: 0.003893 + connect_time: 0.031951 + pretransfer_time: 0.062651 + size_upload: 61.0 + size_download: 227.0 + speed_download: 1690.0 + speed_upload: 454.0 + download_content_length: 227.0 + upload_content_length: 61.0 + starttransfer_time: 0.134215 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64152 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 62573 + queue_time_us: 17 + connect_time_us: 31951 + namelookup_time_us: 3893 + pretransfer_time_us: 62651 + redirect_time_us: 0 + starttransfer_time_us: 134215 + posttransfer_time_us: 62651 + total_time_us: 134247 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_UpsDapAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_UpsDapAccount.yml new file mode 100644 index 00000000..472848e0 --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_UpsDapAccount.yml @@ -0,0 +1,88 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/open' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account":{"type":"UpsDapAccount","registration_data":[]}}' + response: + status: + code: 422 + message: 'Unprocessable Entity' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: aebfacac6ad13f66e2cc1772006e13a4 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '150' + x-runtime: '0.073690' + x-node: web105azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb2azw f29267e751', 'extlb3azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"error":{"code":"PARAMETER.REQUIRED","message":"Missing required parameter.","errors":[{"field":"postal_code","message":"is required but missing"}]}}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/open' + content_type: 'application/json; charset=utf-8' + http_code: 422 + header_size: 764 + request_size: 386 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.165639 + namelookup_time: 0.003539 + connect_time: 0.029559 + pretransfer_time: 0.061908 + size_upload: 67.0 + size_download: 150.0 + speed_download: 905.0 + speed_upload: 404.0 + download_content_length: 150.0 + upload_content_length: 67.0 + starttransfer_time: 0.165558 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64143 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 61841 + queue_time_us: 58 + connect_time_us: 29559 + namelookup_time_us: 3539 + pretransfer_time_us: 61908 + redirect_time_us: 0 + starttransfer_time_us: 165558 + posttransfer_time_us: 61908 + total_time_us: 165639 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_UpsMailInnovationsAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_UpsMailInnovationsAccount.yml new file mode 100644 index 00000000..daf2294c --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_UpsMailInnovationsAccount.yml @@ -0,0 +1,88 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account_oauth_registrations":{"type":"UpsMailInnovationsAccount"}}' + response: + status: + code: 422 + message: 'Unprocessable Entity' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: ef2f756c6ad13f68e2cc17930014b1da + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '227' + x-runtime: '0.029395' + x-node: web109azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb4azw f29267e751', 'extlb1azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"error":{"code":"UNPROCESSABLE_ENTITY","message":"The request was understood, but cannot be processed.","errors":[{"field":"account_number","message":"The provided Carrier Account''s Account Number is required but missing."}]}}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + content_type: 'application/json; charset=utf-8' + http_code: 422 + header_size: 764 + request_size: 405 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.119581 + namelookup_time: 0.002943 + connect_time: 0.027985 + pretransfer_time: 0.056186 + size_upload: 76.0 + size_download: 227.0 + speed_download: 1899.0 + speed_upload: 635.0 + download_content_length: 227.0 + upload_content_length: 76.0 + starttransfer_time: 0.119493 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64153 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 56151 + queue_time_us: 9 + connect_time_us: 27985 + namelookup_time_us: 2943 + pretransfer_time_us: 56186 + redirect_time_us: 0 + starttransfer_time_us: 119493 + posttransfer_time_us: 56186 + total_time_us: 119581 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_UpsSurepostAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_UpsSurepostAccount.yml new file mode 100644 index 00000000..3f5c2354 --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_UpsSurepostAccount.yml @@ -0,0 +1,88 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account_oauth_registrations":{"type":"UpsSurepostAccount"}}' + response: + status: + code: 422 + message: 'Unprocessable Entity' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: 2cb8c6476ad13f68e2cc17940014c100 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '227' + x-runtime: '0.022672' + x-node: web127azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb4azw f29267e751', 'extlb2azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"error":{"code":"UNPROCESSABLE_ENTITY","message":"The request was understood, but cannot be processed.","errors":[{"field":"account_number","message":"The provided Carrier Account''s Account Number is required but missing."}]}}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + content_type: 'application/json; charset=utf-8' + http_code: 422 + header_size: 764 + request_size: 398 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.111495 + namelookup_time: 0.004449 + connect_time: 0.030087 + pretransfer_time: 0.059383 + size_upload: 69.0 + size_download: 227.0 + speed_download: 2036.0 + speed_upload: 618.0 + download_content_length: 227.0 + upload_content_length: 69.0 + starttransfer_time: 0.111435 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64154 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 59319 + queue_time_us: 17 + connect_time_us: 30087 + namelookup_time_us: 4449 + pretransfer_time_us: 59383 + redirect_time_us: 0 + starttransfer_time_us: 111435 + posttransfer_time_us: 59383 + total_time_us: 111495 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_UspsShipAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_UspsShipAccount.yml new file mode 100644 index 00000000..74cbd856 --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_UspsShipAccount.yml @@ -0,0 +1,173 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account_oauth_registrations":{"type":"UspsShipAccount"}}' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: add87ec46ad13f68e2cc1795006e18a1 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '2561' + x-runtime: '0.109958' + x-node: web125azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb1azw f29267e751', 'extlb3azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"id":"ca_c593ef357fd84acb845213b88fa646de","object":"CarrierAccount","type":"UspsShipAccount","clone":false,"created_at":"2026-10-15T21:02:32Z","updated_at":"2026-10-15T21:02:32Z","description":null,"reference":null,"billing_type":"carrier","readable":"Usps Ship","logo":null,"fields":[],"credentials":[],"test_credentials":[]}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 752 + request_size: 395 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.200452 + namelookup_time: 0.003153 + connect_time: 0.028537 + pretransfer_time: 0.056808 + size_upload: 66.0 + size_download: 2561.0 + speed_download: 12776.0 + speed_upload: 329.0 + download_content_length: 2561.0 + upload_content_length: 66.0 + starttransfer_time: 0.20042 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64155 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 56759 + queue_time_us: 18 + connect_time_us: 28537 + namelookup_time_us: 3153 + pretransfer_time_us: 56808 + redirect_time_us: 0 + starttransfer_time_us: 200420 + posttransfer_time_us: 56808 + total_time_us: 200452 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 +- + request: + method: DELETE + url: 'https://api.easypost.com/v2/carrier_accounts/ca_c593ef357fd84acb845213b88fa646de' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: ef2f756e6ad13f69e2cc17960014b2f8 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '2' + x-runtime: '0.072505' + x-node: web127azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb3azw f29267e751', 'extlb1azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '[]' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/ca_c593ef357fd84acb845213b88fa646de' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 744 + request_size: 332 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.159919 + namelookup_time: 0.003182 + connect_time: 0.028636 + pretransfer_time: 0.057264 + size_upload: 0.0 + size_download: 2.0 + speed_download: 12.0 + speed_upload: 0.0 + download_content_length: 2.0 + upload_content_length: 0.0 + starttransfer_time: 0.159891 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64156 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 57217 + queue_time_us: 12 + connect_time_us: 28636 + namelookup_time_us: 3182 + pretransfer_time_us: 57264 + redirect_time_us: 0 + starttransfer_time_us: 159891 + posttransfer_time_us: 57264 + total_time_us: 159919 + effective_method: DELETE + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/create_url_routing_VehoWalletAccount.yml b/test/cassettes/carrier_accounts/create_url_routing_VehoWalletAccount.yml new file mode 100644 index 00000000..173f2b57 --- /dev/null +++ b/test/cassettes/carrier_accounts/create_url_routing_VehoWalletAccount.yml @@ -0,0 +1,173 @@ + +- + request: + method: POST + url: 'https://api.easypost.com/v2/carrier_accounts/open' + headers: + Host: api.easypost.com + Expect: '' + Accept-Encoding: '' + Accept: application/json + Authorization: '' + Content-Type: application/json + User-Agent: '' + body: '{"carrier_account":{"type":"VehoWalletAccount","registration_data":[]}}' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: add87ec86ad13f67e2cc1775006e1527 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '583' + x-runtime: '0.079996' + x-node: web124azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb1azw f29267e751', 'extlb3azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '{"id":"ca_13db0ea5576d4e92aea9fb033a97a548","object":"CarrierAccount","type":"VehoWalletAccount","clone":false,"created_at":"2026-10-15T21:02:31Z","updated_at":"2026-10-15T21:02:31Z","description":"Veho Account","reference":null,"billing_type":"easypost","readable":"Veho","logo":null,"fields":[],"credentials":[],"test_credentials":[]}' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/open' + content_type: 'application/json; charset=utf-8' + http_code: 201 + header_size: 751 + request_size: 390 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.176296 + namelookup_time: 0.005111 + connect_time: 0.031656 + pretransfer_time: 0.06315 + size_upload: 71.0 + size_download: 583.0 + speed_download: 3307.0 + speed_upload: 402.0 + download_content_length: 583.0 + upload_content_length: 71.0 + starttransfer_time: 0.176228 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64146 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 63071 + queue_time_us: 27 + connect_time_us: 31656 + namelookup_time_us: 5111 + pretransfer_time_us: 63150 + redirect_time_us: 0 + starttransfer_time_us: 176228 + posttransfer_time_us: 63150 + total_time_us: 176296 + effective_method: POST + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 +- + request: + method: DELETE + url: 'https://api.easypost.com/v2/carrier_accounts/ca_13db0ea5576d4e92aea9fb033a97a548' + 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 + easypost-api-version: '2015-01-01' + vary: EasyPost-Api-Version + x-ep-request-uuid: ef2f75706ad13f67e2cc17760014af90 + cache-control: 'private, no-cache, no-store' + pragma: no-cache + expires: '0' + content-type: 'application/json; charset=utf-8' + content-length: '2' + x-runtime: '0.072800' + x-node: web114azw + x-version-label: easypost-202610151955-b13716d895-main + x-backend: easypost + x-proxied: ['intlb4azw f29267e751', 'extlb1azw ff4cfe6eb5'] + strict-transport-security: 'max-age=31536000; includeSubDomains; preload' + body: '[]' + curl_info: + url: 'https://api.easypost.com/v2/carrier_accounts/ca_13db0ea5576d4e92aea9fb033a97a548' + content_type: 'application/json; charset=utf-8' + http_code: 200 + header_size: 744 + request_size: 332 + filetime: -1 + ssl_verify_result: 0 + redirect_count: 0 + total_time: 0.167214 + namelookup_time: 0.003189 + connect_time: 0.030073 + pretransfer_time: 0.062447 + size_upload: 0.0 + size_download: 2.0 + speed_download: 11.0 + speed_upload: 0.0 + download_content_length: 2.0 + upload_content_length: 0.0 + starttransfer_time: 0.167123 + redirect_time: 0.0 + redirect_url: '' + primary_ip: 172.185.21.32 + certinfo: { } + primary_port: 443 + local_ip: 192.168.1.60 + local_port: 64147 + http_version: 2 + protocol: 2 + ssl_verifyresult: 0 + scheme: https + appconnect_time_us: 62382 + queue_time_us: 20 + connect_time_us: 30073 + namelookup_time_us: 3189 + pretransfer_time_us: 62447 + redirect_time_us: 0 + starttransfer_time_us: 167123 + posttransfer_time_us: 62447 + total_time_us: 167214 + effective_method: DELETE + capath: '' + cainfo: '' + used_proxy: 0 + httpauth_used: 0 + proxyauth_used: 0 + conn_id: 0 + index: 0 diff --git a/test/cassettes/carrier_accounts/update_ups.yml b/test/cassettes/carrier_accounts/update_ups.yml deleted file mode 100644 index 70d7a291..00000000 --- a/test/cassettes/carrier_accounts/update_ups.yml +++ /dev/null @@ -1,239 +0,0 @@ - -- - request: - method: POST - url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' - headers: - Host: api.easypost.com - Expect: '' - Accept-Encoding: '' - Accept: application/json - Authorization: '' - Content-Type: application/json - User-Agent: '' - body: '{"carrier_account_oauth_registrations":{"type":"UpsAccount","account_number":"123456789"}}' - 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: 6ae239366830cdb8e7874543008db232 - cache-control: 'private, no-cache, no-store' - pragma: no-cache - expires: '0' - content-type: 'application/json; charset=utf-8' - content-length: '1420' - x-runtime: '0.091240' - x-node: bigweb41nuq - x-version-label: easypost-202505231841-d89645a184-master - x-backend: easypost - x-proxied: ['intlb3nuq 668d3fc830', 'extlb2nuq 99aac35317'] - strict-transport-security: 'max-age=31536000; includeSubDomains; preload' - body: '{"id":"ca_06c594e584bc423e887fd9f130b485d8","object":"CarrierAccount","type":"UpsAccount","clone":false,"created_at":"2025-05-23T19:34:16Z","updated_at":"2025-05-23T19:34:16Z","description":null,"reference":null,"billing_type":"carrier","readable":"UPS","logo":null,"fields":[],"credentials":[],"test_credentials":[]}' - curl_info: - url: 'https://api.easypost.com/v2/carrier_accounts/register_oauth' - content_type: 'application/json; charset=utf-8' - http_code: 201 - header_size: 694 - request_size: 418 - filetime: -1 - ssl_verify_result: 0 - redirect_count: 0 - total_time: 0.303049 - namelookup_time: 0.003562 - connect_time: 0.071055 - pretransfer_time: 0.140912 - size_upload: 90.0 - size_download: 1420.0 - speed_download: 4685.0 - speed_upload: 296.0 - download_content_length: 1420.0 - upload_content_length: 90.0 - starttransfer_time: 0.303017 - redirect_time: 0.0 - redirect_url: '' - primary_ip: 169.62.110.130 - certinfo: { } - primary_port: 443 - local_ip: 10.130.6.32 - local_port: 51583 - http_version: 2 - protocol: 2 - ssl_verifyresult: 0 - scheme: https - appconnect_time_us: 140871 - connect_time_us: 71055 - namelookup_time_us: 3562 - pretransfer_time_us: 140912 - redirect_time_us: 0 - starttransfer_time_us: 303017 - posttransfer_time_us: 140912 - total_time_us: 303049 - effective_method: POST - capath: '' - cainfo: '' - index: 0 -- - request: - method: PATCH - url: 'https://api.easypost.com/v2/carrier_accounts/ca_06c594e584bc423e887fd9f130b485d8' - headers: - Host: api.easypost.com - Expect: '' - Accept-Encoding: '' - Accept: application/json - Authorization: '' - Content-Type: application/json - User-Agent: '' - body: '{"carrier_account":{"account_number":"987654321"}}' - 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: 6ae239376830cdb8e7874544008db287 - cache-control: 'private, no-cache, no-store' - pragma: no-cache - expires: '0' - content-type: 'application/json; charset=utf-8' - content-length: '1420' - x-runtime: '0.120034' - x-node: bigweb53nuq - x-version-label: easypost-202505231841-d89645a184-master - x-backend: easypost - x-proxied: ['intlb4nuq 668d3fc830', 'extlb2nuq 99aac35317'] - strict-transport-security: 'max-age=31536000; includeSubDomains; preload' - body: '{"id":"ca_06c594e584bc423e887fd9f130b485d8","object":"CarrierAccount","type":"UpsAccount","clone":false,"created_at":"2025-05-23T19:34:16Z","updated_at":"2025-05-23T19:34:16Z","description":null,"reference":null,"billing_type":"carrier","readable":"UPS","logo":null,"fields":[],"credentials":[],"test_credentials":[]}' - curl_info: - url: 'https://api.easypost.com/v2/carrier_accounts/ca_06c594e584bc423e887fd9f130b485d8' - content_type: 'application/json; charset=utf-8' - http_code: 200 - header_size: 689 - request_size: 400 - filetime: -1 - ssl_verify_result: 0 - redirect_count: 0 - total_time: 0.326864 - namelookup_time: 0.001438 - connect_time: 0.067508 - pretransfer_time: 0.135774 - size_upload: 50.0 - size_download: 1420.0 - speed_download: 4344.0 - speed_upload: 152.0 - download_content_length: 1420.0 - upload_content_length: 50.0 - starttransfer_time: 0.326771 - redirect_time: 0.0 - redirect_url: '' - primary_ip: 169.62.110.130 - certinfo: { } - primary_port: 443 - local_ip: 10.130.6.32 - local_port: 51584 - http_version: 2 - protocol: 2 - ssl_verifyresult: 0 - scheme: https - appconnect_time_us: 135715 - connect_time_us: 67508 - namelookup_time_us: 1438 - pretransfer_time_us: 135774 - redirect_time_us: 0 - starttransfer_time_us: 326771 - posttransfer_time_us: 135773 - total_time_us: 326864 - effective_method: PATCH - capath: '' - cainfo: '' - index: 0 -- - request: - method: DELETE - url: 'https://api.easypost.com/v2/carrier_accounts/ca_06c594e584bc423e887fd9f130b485d8' - 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: 6ae239326830cdb8e7874545008db2ef - cache-control: 'private, no-cache, no-store' - pragma: no-cache - expires: '0' - content-type: 'application/json; charset=utf-8' - content-length: '2' - x-runtime: '0.072700' - x-node: bigweb36nuq - x-version-label: easypost-202505231841-d89645a184-master - x-backend: easypost - x-proxied: ['intlb3nuq 668d3fc830', 'extlb2nuq 99aac35317'] - strict-transport-security: 'max-age=31536000; includeSubDomains; preload' - body: '[]' - curl_info: - url: 'https://api.easypost.com/v2/carrier_accounts/ca_06c594e584bc423e887fd9f130b485d8' - content_type: 'application/json; charset=utf-8' - http_code: 200 - header_size: 686 - request_size: 331 - filetime: -1 - ssl_verify_result: 0 - redirect_count: 0 - total_time: 0.276449 - namelookup_time: 0.002645 - connect_time: 0.066904 - pretransfer_time: 0.135033 - size_upload: 0.0 - size_download: 2.0 - speed_download: 7.0 - speed_upload: 0.0 - download_content_length: 2.0 - upload_content_length: 0.0 - starttransfer_time: 0.276357 - redirect_time: 0.0 - redirect_url: '' - primary_ip: 169.62.110.130 - certinfo: { } - primary_port: 443 - local_ip: 10.130.6.32 - local_port: 51585 - http_version: 2 - protocol: 2 - ssl_verifyresult: 0 - scheme: https - appconnect_time_us: 134974 - connect_time_us: 66904 - namelookup_time_us: 2645 - pretransfer_time_us: 135033 - redirect_time_us: 0 - starttransfer_time_us: 276357 - posttransfer_time_us: 135063 - total_time_us: 276449 - effective_method: DELETE - capath: '' - cainfo: '' - index: 0