简体   繁体   中英

Create shipment using fedex api (php)

I need to create shipment using fedex api into my website.

First, I check what are the available services through multiple-rate-services API which gives me results like below:

Rates for following service type(s) were returned.

Service Type        Amount       Delivery Date

FIRST_OVERNIGHT     $270.14   2016-10-24T08:00:00

PRIORITY_OVERNIGHT  $88.91        2016-10-24T10:30:00

STANDARD_OVERNIGHT  $208.34   2016-10-24T15:00:00

FEDEX_2_DAY_AM      $105.93   2016-10-25T10:30:00

FEDEX_2_DAY         $92.11       2016-10-25T16:30:00

FEDEX_EXPRESS_SAVER $67.28       2016-10-26T16:30:00

FEDEX_GROUND        $27.97       TWO_DAYS

which is straight forward, but when I want to create shipment for the above services I'm not sure which one to use because the API is further divided into

  1. Express *(Domestic/Domestic MPS/International)
  2. Freight *(Domestic)
  3. GDE *(India)
  4. Ground *(Domestic/Domestic MPS/International/International MPS/Smart Post)

Now, how to know which service comes under which section to send a valid request to add shipment.

I've been trying to find a solution for this for couple of days, so if anyone have implemented it kindly advise me on the right path.

All the returned services are FedEx Express (1) services, with the exception of FEDEX_GROUND which is Ground (4). That said, both Express and Ground actually use the same FedEx Ship endpoint. You just need to change the service code.

If you're looking for an easier way please check out Shippo ( https://goshippo.com ) and our PHP client library at https://github.com/goshippo/shippo-php-client . It makes using the FedEx API much easier and you don't need to worry about these typs of shipping questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM