Giter VIP home page Giter VIP logo

shipping-rate-calculator's Introduction

Project architecture

  • ShipForm.html: This is where the main components are.
  • Script.js: This is where we put the client-side scripts.
  • Server.php: The main part to make calls to the UPS and FedEx API and send them to the front-end.
  • UPS.json: Main schema for UPS API.
  • FedEx.json: Main schema for FedEx API.

Workflow.

  • Input the shipper and receiver details and package details.
  • Select the service(UPS or FedEx) and service type (Ground, Next Day Air, FedEx 2Day, etc).
  • Then request is sent from the front-end to the backend.
  • On the backend, the request body is replaced depending on the details(shippment detail and service type) from the existing schema.
  • Backend returns the response from the UPS or FedEx API to the front-end once it's successful.

Service API endpoints

UPS

https://onlinetools.ups.com/ship/v1/rating/Rate

FedEx

https://apis-sandbox.fedex.com/rate/v1/rates/quotes

https://apis-sandbox.fedex.com/oauth/token

Main factors to replace in the schema for the request

UPS

  • RateRequest->Shipment->ShipTo: This is where to replace the address of the receiver.

  • RateRequest->Shipment->ShipFrom: This is where to put the address of the shipper.

  • RateRequest->Shipment->Service: This is where to put the service type.
    Valid types for domestic service: (Code and Description)
    01 = Next Day Air
    02 = 2nd Day Air
    03 = Ground
    12 = 3 Day Select
    13 = Next Day Air Saver
    14 = UPS Next Day Air Early
    59 = 2nd Day Air A.M.

  • RateRequest->Shipment->ShipmentTotalWeight->Weight: Package weight

  • RateRequest->Shipment->Package->Dimensions->Length: Package length

  • RateRequest->Shipment->Package->Dimensions->Width: Package width

  • RateRequest->Shipment->Package->Dimensions->Height: Package height

  • RateRequest->Shipment->Package->PackageWeight->Weight: Package weight again.

Fedex

  • requestedShipment->shipper->address->postalCode : Shipper address Postal code.
  • requestedShipment->recipient->address->postalCode : Receiver address Postal code.
  • requestedShipment->requestedPackageLineItems[0]->weight->value : Package weight. FedEx just needs the weight for the package detail.
  • requestedShipment->serviceType : This is where to put the service type.
    FEDEX_GROUND
    FEDEX_EXPRESS_SAVER
    FEDEX_2_DAY
    FEDEX_2_DAY_AM
    STANDARD_OVERNIGHT
    PRIORITY_OVERNIGHT
    FIRST_OVERNIGHT

Necessary credentials

UPS

  • transId
  • transactionSrc
  • AccessLicenseNumber
  • Username
  • Password

FedEx

  • accountNumber
  • authorization: This is the Bearer token that can be fetched with FedEx Account info from
    https://apis-sandbox.fedex.com/oauth/token
    grant_type=client_credentials&client_id=NEED_TO_BE_UPDATED&client_secret=NEED_TO_BE_UPDATED

Available references

shipping-rate-calculator's People

Contributors

ivanov1201 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.