comyo-media / shipcloud-php Goto Github PK
View Code? Open in Web Editor NEWshipcloud API v1 PHP 5.4+ library
shipcloud API v1 PHP 5.4+ library
Source: https://developers.shipcloud.io/concepts/
For POST, PATCH, PUT, and DELETE requests, parameters not included in the URL should be encoded as JSON with a Content-Type of ‘application/json’
When using for example "create_shipping_label" and setting a boolean the api sends it as int (0|1). It does only work if sending the boolean as string. Sample request:
array:7 [ "to" => array:8 [ "company" => "Schreiber & Freunde GmbH & Co. KG" "first_name" => "Philipp" "last_name" => "Schreiber" "street" => "Heilbronner Straße" "street_no" => "12" "city" => "Neckarsulm" "zip_code" => "74172" "country" => "DE" ] "package" => array:4 [ "width" => 40 "length" => 40 "height" => 40 "weight" => 12 ] "carrier" => "dhl" "service" => "standard" "reference_number" => "abcde" "notification_email" => "[email protected]" "create_shipping_label" => true ]
This does not work. What works is the following (the difference is the "create_shipping_label" parameter):
array:7 [ "to" => array:8 [ "company" => "Schreiber & Freunde GmbH & Co. KG" "first_name" => "Philipp" "last_name" => "Schreiber" "street" => "Heilbronner Straße" "street_no" => "12" "city" => "Neckarsulm" "zip_code" => "74172" "country" => "DE" ] "package" => array:4 [ "width" => 40 "length" => 40 "height" => 40 "weight" => 12 ] "carrier" => "dhl" "service" => "standard" "reference_number" => "abcde" "notification_email" => "[email protected]" "create_shipping_label" => "true" ]
Shipcloud support says the following:
dass true als String angenommen wird ist derzeit noch ein Fallback der in Zukunft ausgebaut wird. Bitte überprüfe einmal, was genau ihr am Ende an Daten an uns sendet, denn bei uns kommt "create_shipping_label=1" an und das ist halt nicht korrekt.
Perhaps that will be fixed as side effect when fixing #1
Declaration of ComyoMedia\Shipcloud\Api\Shipments::delete($id) should be compatible with ComyoMedia\Shipcloud\Api\Api::delete($uri = NULL, $parameters = Array, $body = Array).
Renaming it to something different like destroy() should help!
public function destroy($id)
{
return $this->delete("shipments/{$id}");
}
Hi,
I created a PHP script for creating shipment via Shipcloud API
Though it has been created successfully, but I am getting only Id and the tracking_url,
and not carrier_tracking_no,label_url, and price as response parameters
I am using my sandbox API key
here is how the posted parameters in my request code look like.
$post_data = array(
'to' => array(
'company' => 'Receiver Inc.',
'first_name' => 'Max',
'last_name' => 'Mustermann',
'street' => 'Beispielstrasse',
'street_no' => '42',
'city' => 'Hamburg',
'zip_code' => '22100',
'country' => 'DE'
),
'package' => array(
'weight' => 15,
'length' => 20,
'width' => 20,
'height' => 20,
'type' => 'parcel'
),
'carrier' => 'dhl',
'service' => 'standard',
'reference_number' => 'ref123456',
'notification_email' => '[email protected]',
'create_shipping_label' => true
);
Please help me out.
Thank You.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.