Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## Next Release

- Adds the following functions:
- `embeddable.create_session`
- `customer_portal.create_account_link`

## v10.2.0 (2025-11-10)

- Adds `UspsShipAccount` support to the create carrier method
Expand Down
4 changes: 4 additions & 0 deletions easypost/easypost_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
CarrierAccountService,
CarrierMetadataService,
ClaimService,
CustomerPortalService,
CustomsInfoService,
CustomsItemService,
EmbeddableService,
EndShipperService,
EventService,
InsuranceService,
Expand Down Expand Up @@ -65,8 +67,10 @@ def __init__(
self.carrier_account = CarrierAccountService(self)
self.carrier_metadata = CarrierMetadataService(self)
self.claim = ClaimService(self)
self.customer_portal = CustomerPortalService(self)
self.customs_info = CustomsInfoService(self)
self.customs_item = CustomsItemService(self)
self.embeddable = EmbeddableService(self)
self.end_shipper = EndShipperService(self)
self.event = EventService(self)
self.insurance = InsuranceService(self)
Expand Down
2 changes: 2 additions & 0 deletions easypost/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
from easypost.services.carrier_account_service import CarrierAccountService
from easypost.services.carrier_metadata_service import CarrierMetadataService
from easypost.services.claim_service import ClaimService
from easypost.services.customer_portal_service import CustomerPortalService
from easypost.services.customs_info_service import CustomsInfoService
from easypost.services.customs_item_service import CustomsItemService
from easypost.services.embeddable_service import EmbeddableService
from easypost.services.end_shipper_service import EndShipperService
from easypost.services.event_service import EventService
from easypost.services.insurance_service import InsuranceService
Expand Down
23 changes: 23 additions & 0 deletions easypost/services/customer_portal_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from typing import Any

from easypost.easypost_object import convert_to_easypost_object
from easypost.requestor import (
RequestMethod,
Requestor,
)
from easypost.services.base_service import BaseService


class CustomerPortalService(BaseService):
def __init__(self, client):
self._client = client

def create_account_link(self, **params) -> dict[str, Any]:
"""Create a Portal Session."""
response = Requestor(self._client).request(
method=RequestMethod.POST,
url="/customer_portal/account_link",
params=params,
)

return convert_to_easypost_object(response=response)
23 changes: 23 additions & 0 deletions easypost/services/embeddable_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from typing import Any

from easypost.easypost_object import convert_to_easypost_object
from easypost.requestor import (
RequestMethod,
Requestor,
)
from easypost.services.base_service import BaseService


class EmbeddableService(BaseService):
def __init__(self, client):
self._client = client

def create_session(self, **params) -> dict[str, Any]:
"""Create an Embeddables Session."""
response = Requestor(self._client).request(
method=RequestMethod.POST,
url="/embeddables/session",
params=params,
)

return convert_to_easypost_object(response=response)
147 changes: 147 additions & 0 deletions tests/cassettes/test_customer_portal_account_link_create.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

143 changes: 143 additions & 0 deletions tests/cassettes/test_embeddable_session_create.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading