PHP code example of imbue / sendcloud-api-php

1. Go to this page and download the library: Download imbue/sendcloud-api-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

imbue / sendcloud-api-php example snippets


$sendCloud = new \Imbue\SendCloud\SendCloudApiClient();
$sendCloud->setApiAuth('gb3iogpp8uf74p92holav67ij7jmpswe', '1m9mtv4ylnd8fy0xb61ury81pt6xp3fh');

$parcel = $sendCloud->parcels->create([
    'parcel' => [
        'name' => 'Julie Appleseed',
        'company_name' => 'SendCloud',
        'address' => 'Insulindelaan 115',
        'house_number' => 115,
        'city' => 'Eindhoven',
        'postal_code' => '5642CV',
        'telephone' => '+31612345678',
        'request_label' => true,
        'email' => '[email protected]',
        'country' => 'NL',
        'shipment' => [
            'id' => 8,
        ],
        'weight' => '10.000',
        'order_number' => '1234567890',
        'insured_value' => 2000,
    ]
]);

$shipment = $sendCloud->integrationShipments->upsert(1346, [
    'name' => 'Julie Appleseed',
    'company_name' => 'SendCloud',
    'address' => 'Insulindelaan 115',
    'house_number' => 115,
    'city' => 'Eindhoven',
    'postal_code' => '5642CV',
    'telephone' => '+31612345678',
    'request_label' => true,
    'email' => '[email protected]',
    'country' => 'NL',
    'shipment' => [
        'id' => 8,
    ],
    'weight' => '10.000',
    'order_number' => '1234567890',
    'insured_value' => 2000,
]);

$sendCloud->integrations->list();

$sendCloud->parcels->get($id);

$sendCloud->setPartnerId('3dd88a04-26e4-4959-af11-f5674491573e')

$ composer