This Frappe app is designed to integrate UPS (United Parcel Service) functionalities into ERPNext.
Note: This project is a work in progress. The documentation and code are provided as-is, and further development may be needed to suit your specific requirements.
Before you begin, ensure you have the following:
-
UPS Account: An account with UPS is required. Sign up or log in at ups.com.
-
Account Number: Obtain an account number from UPS, essential for transactions.
-
Developer Account on UPS: Log in to the UPS Developer Portal (developer.ups.com) for API access.
-
App Registration: Create an application via the UPS Developer Portal for integrating UPS technology into your ERPNext. Use the Client Credentials Grant Type. Select
I want to integrate UPS technology into my business
during creation. -
API Subscriptions: Include the following products/APIs in your application:
- Authorization (OAuth)
- Shipping
This app facilitates seamless integration with UPS services, including shipping, tracking, and address validation, within ERPNext.
-
UPS Client (
ups_client.py
):- Manages API requests to UPS.
- Handles session management, token generation, and authorization.
- Includes methods for session creation and closure, token fetching and setting, and making generic UPS API requests.
-
UPS Shipment Doctype (
ups_shipment
):- Defines the structure for shipment records.
- Contains logic for preparing and sending shipment requests to UPS, and handling responses including tracking numbers and label generation.
-
UPS Settings Doctype (
ups_settings
):- Stores UPS account settings and credentials.
- Provides functions for retrieving the API base URL, bearer token, client ID, and client secret.
- Manages access token expiration and renewal.
-
Additional Doctypes:
UPS Shipment Package
andUPS Shipment Charge
for structuring packages and charges related to a shipment.
- Clone the repository into your bench apps folder:
bench get-app https://github.com/alyf-de/ups_integration.git
. - Install the app:
bench install-app ups_integration
. - Configure the UPS Settings in ERPNext with the necessary credentials and preferences.
- Set up UPS Settings with your UPS account details, including API credentials.
- Create a UPS Shipment document in ERPNext, filling in details like shipper, recipient, and package information.
- On saving or submitting the shipment, the app communicates with UPS to create the shipment and fetch tracking details.
Key areas for improvement include:
- Expanding the
UPSClient
class to cover more UPS API endpoints. - Enhancing the
UPS Shipment
Doctype with features like real-time tracking updates. - Customizing the user interface and workflow to better fit specific business processes.
GPL-3.0