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.createSession`
- `customerPortal.createAccountLink`

## v8.3.0 (2025-11-10)

- Adds support for `UspsShipAccount`
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/easypost/model/CustomerPortalAccountLink.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.easypost.model;

import java.util.Date;
import lombok.Getter;

@Getter
public class CustomerPortalAccountLink {
private String object;
private String link;
private Date createdAt;
private Date expiresAt;
}
12 changes: 12 additions & 0 deletions src/main/java/com/easypost/model/EmbeddablesSession.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.easypost.model;

import java.util.Date;
import lombok.Getter;

@Getter
public class EmbeddablesSession {
private String object;
private String sessionId;
private Date createdAt;
private Date expiresAt;
}
34 changes: 34 additions & 0 deletions src/main/java/com/easypost/service/CustomerPortalService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.easypost.service;

import java.util.Map;

import com.easypost.exception.EasyPostException;
import com.easypost.http.Requestor;
import com.easypost.http.Requestor.RequestMethod;
import com.easypost.model.CustomerPortalAccountLink;

public class CustomerPortalService {
private final EasyPostClient client;

/**
* CustomerPortalService constructor.
*
* @param client The client object.
*/
CustomerPortalService(EasyPostClient client) {
this.client = client;
}

/**
* Create a CustomerPortalAccountLink from the API.
*
* @param params Map of parameters.
* @return CustomerPortalAccountLink object
* @throws EasyPostException when the request fails.
*/
public CustomerPortalAccountLink createAccountLink(final Map<String, Object> params) throws EasyPostException {
String endpoint = "customer_portal/account_link";

return Requestor.request(RequestMethod.POST, endpoint, params, CustomerPortalAccountLink.class, client);
}
}
93 changes: 33 additions & 60 deletions src/main/java/com/easypost/service/EasyPostClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,39 @@ public class EasyPostClient {
private final String clientApiKey; // API key for all EasyPost API requests
private final String apiVersion = "v2";
private final String apiBase;
public final AddressService address;
public final ApiKeyService apiKey;
public final BatchService batch;
public final BetaReferralCustomerService betaReferralCustomer;
public final BetaRateService betaRate;
public final BillingService billing;
public final CarrierAccountService carrierAccount;
public final CarrierMetadataService carrierMetadata;
public final CarrierTypeService carrierType;
public final ClaimService claim;
public final CustomsInfoService customsInfo;
public final CustomsItemService customsItem;
public final EndShipperService endShipper;
public final EventService event;
public final InsuranceService insurance;
public final LumaService luma;
public final OrderService order;
public final ParcelService parcel;
public final PaymentMethodService paymentMethod;
public final PickupService pickup;
public final RateService rate;
public final ReferralCustomerService referralCustomer;
public final RefundService refund;
public final ReportService report;
public final ScanformService scanForm;
public final ShipmentService shipment;
public final SmartRateService smartRate;
public final TrackerService tracker;
public final UserService user;
public final WebhookService webhook;
// Services
public final AddressService address = new AddressService(this);
public final ApiKeyService apiKey = new ApiKeyService(this);
public final BatchService batch = new BatchService(this);
public final BetaRateService betaRate = new BetaRateService(this);
public final BetaReferralCustomerService betaReferralCustomer = new BetaReferralCustomerService(this);
public final BillingService billing = new BillingService(this);
public final CarrierAccountService carrierAccount = new CarrierAccountService(this);
public final CarrierMetadataService carrierMetadata = new CarrierMetadataService(this);
public final CarrierTypeService carrierType = new CarrierTypeService(this);
public final ClaimService claim = new ClaimService(this);
public final CustomerPortalService customerPortal = new CustomerPortalService(this);
public final CustomsInfoService customsInfo = new CustomsInfoService(this);
public final CustomsItemService customsItem = new CustomsItemService(this);
public final EmbeddableService embeddable = new EmbeddableService(this);
public final EndShipperService endShipper = new EndShipperService(this);
public final EventService event = new EventService(this);
public final InsuranceService insurance = new InsuranceService(this);
public final LumaService luma = new LumaService(this);
public final OrderService order = new OrderService(this);
public final ParcelService parcel = new ParcelService(this);
public final PaymentMethodService paymentMethod = new PaymentMethodService(this);
public final PickupService pickup = new PickupService(this);
public final RateService rate = new RateService(this);
public final ReferralCustomerService referralCustomer = new ReferralCustomerService(this);
public final RefundService refund = new RefundService(this);
public final ReportService report = new ReportService(this);
public final ScanformService scanForm = new ScanformService(this);
public final ShipmentService shipment = new ShipmentService(this);
public final SmartRateService smartRate = new SmartRateService(this);
public final TrackerService tracker = new TrackerService(this);
public final UserService user = new UserService(this);
public final WebhookService webhook = new WebhookService(this);
@Getter
private RequestHook requestHooks = new RequestHook();
@Getter
Expand Down Expand Up @@ -129,36 +132,6 @@ public EasyPostClient(String apiKey, int connectTimeoutMilliseconds, int readTim
this.clientApiKey = apiKey;
this.connectTimeoutMilliseconds = connectTimeoutMilliseconds;
this.readTimeoutMilliseconds = readTimeoutMilliseconds;
this.address = new AddressService(this);
this.apiKey = new ApiKeyService(this);
this.batch = new BatchService(this);
this.betaReferralCustomer = new BetaReferralCustomerService(this);
this.betaRate = new BetaRateService(this);
this.billing = new BillingService(this);
this.carrierAccount = new CarrierAccountService(this);
this.carrierMetadata = new CarrierMetadataService(this);
this.carrierType = new CarrierTypeService(this);
this.claim = new ClaimService(this);
this.customsInfo = new CustomsInfoService(this);
this.customsItem = new CustomsItemService(this);
this.endShipper = new EndShipperService(this);
this.event = new EventService(this);
this.insurance = new InsuranceService(this);
this.luma = new LumaService(this);
this.order = new OrderService(this);
this.parcel = new ParcelService(this);
this.paymentMethod = new PaymentMethodService(this);
this.pickup = new PickupService(this);
this.rate = new RateService(this);
this.referralCustomer = new ReferralCustomerService(this);
this.refund = new RefundService(this);
this.report = new ReportService(this);
this.scanForm = new ScanformService(this);
this.shipment = new ShipmentService(this);
this.smartRate = new SmartRateService(this);
this.tracker = new TrackerService(this);
this.user = new UserService(this);
this.webhook = new WebhookService(this);
}

/**
Expand Down
34 changes: 34 additions & 0 deletions src/main/java/com/easypost/service/EmbeddableService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.easypost.service;

import java.util.Map;

import com.easypost.exception.EasyPostException;
import com.easypost.http.Requestor;
import com.easypost.http.Requestor.RequestMethod;
import com.easypost.model.EmbeddablesSession;

public class EmbeddableService {
private final EasyPostClient client;

/**
* EmbeddableService constructor.
*
* @param client The client object.
*/
EmbeddableService(EasyPostClient client) {
this.client = client;
}

/**
* Create an EmbeddablesSession from the API.
*
* @param params Map of parameters.
* @return EmbeddablesSession object
* @throws EasyPostException when the request fails.
*/
public EmbeddablesSession createSession(final Map<String, Object> params) throws EasyPostException {
String endpoint = "embeddables/session";

return Requestor.request(RequestMethod.POST, endpoint, params, EmbeddablesSession.class, client);
}
}
177 changes: 177 additions & 0 deletions src/test/cassettes/customer_portal/create_account_link.json

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

Loading
Loading