shippo-php-client | Shipping API PHP library | REST library
kandi X-RAY | shippo-php-client Summary
kandi X-RAY | shippo-php-client Summary
Shippo is a shipping API that connects you with multiple shipping carriers (such as USPS, UPS, DHL, Canada Post, Australia Post, UberRUSH and many others) through one interface. Print a shipping label in 10 mins using our default USPS and DHL Express accounts. No need to register for a carrier account to get started.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Refresh the attributes from the given array .
- Handle API errors
- Encodes an array into a string
- Convert response to Shippo object
- Convert a class name to a short name .
- Replace values with the given properties .
- Retrieves a singleton instance of a singleton class
- Get the status of a subscription
- Get shipping rates
- Create a batch of objects
shippo-php-client Key Features
shippo-php-client Examples and Code Snippets
Community Discussions
Trending Discussions on shippo-php-client
QUESTION
However I get this error, that I don't know what it means:
Fatal error: Uncaught Shippo_InvalidRequestError: {"rate": ["This field is required."]} in /home/****/shippo/lib/Shippo/ApiRequestor.php:100 Stack trace: #0 /home/****/shippo/lib/Shippo/ApiRequestor.php(154): Shippo_ApiRequestor->handleApiError('{"rate": ["This...', 400, Array) #1 /home/****/shippo/lib/Shippo/ApiRequestor.php(59): Shippo_ApiRequestor->_interpretResponse('{"rate": ["This...', 400) #2 /home/****/shippo/lib/Shippo/ApiResource.php(107): Shippo_ApiRequestor->request('post', '/v1/transaction...', Array) #3 /home/****/shippo/lib/Shippo/Transaction.php(14): Shippo_ApiResource::_scopedCreate('Shippo_Transact...', Array, NULL) #4 /home/****/public_html/.ship/print/done/index.php(65): Shippo_Transaction::create(Array) #5 {main} thrown in /home/****/shippo/lib/Shippo/ApiRequestor.php on line 100
I had gotten a similar message about the parcel field too, so I changed in the PHP script parcels to parcel. This is the example code from https://github.com/goshippo/shippo-php-client/blob/master/examples/basic-shipment.php
My Code:
...ANSWER
Answered 2017-May-30 at 17:14Although I am not 100% certain here, you are likely using the latest version of the PHP wrapper but do not have the latest version of the Shippo API.
I would recommend going to the Shippo changelog and review the changes there and decide whether you would like to upgrade or not.
The likely reason that your code is failing there, is that there (if you're on an older version of the API) you are trying to retrieve a value from a field that does not exist. You should be looking for $rate = $shipment['rates_list'][0]
.
You'll see that this field was changed in the most recent version of the API.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shippo-php-client
Basic domestic shipment
International shipment - Custom forms, interntational destinations
Price estimation matrix
Retrieve rates, filter by delivery time and purchase cheapest label
Retrieve rates, purchase label for fastest delivery option
Retrieve rates so customer can pick preferred shipping method, purchase label
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page