PHP code example of shippii-tech / php-sdk

1. Go to this page and download the library: Download shippii-tech/php-sdk 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/ */

    

shippii-tech / php-sdk example snippets


    $client = new \Vship\Client(
        apiKey: { Your API key }
    );

    $client->getCountries();

    $client->getCarrier('car_2IGXIoELZX4Bga45tOxo52sbpJY');

    $client->getCarriers([
        'filter[name]' => 'Carrier name',
    ]);

    $response = $client->createOrganisation([
        'name' => 'test 5222ee5511232ff31rr33',
        'vat_number' => '123423rr4 ',
        'company_number' => 'bhifgrvbhief',
        'vat_registered' => false,
        'currency' => 'EUR',
        'timezone' => 'Europe/Copenhagen',
        'settings' => [],
    ]);

    $client->getCarriers(array queryParameters = []): Carrier[]

    $client->getCarrier(string $carrierId): Carrier

    $client->createCarrier(array $payload): Carrier

    $client->updateCarrier(string $carrierId, array $payload): Carrier

    $client->deleteCarrier(string $carrierId): Carrier

    $client->getCarrierAccounts(array $queryParameters = []): CarrierAccount[]

    $client->getCarrierAccount(string $carrierAccountId): CarrierAccount

    $client->createCarrierAccount(array $payload): CarrierAccount

    $client->updateCarrierAccount(string $carrierAccountId, array $payload): CarrierAccount

    $client->deleteCarrierAccount(string $carrierAccountId): CarrierAccount

    $client->getCarrierAccountFields(string $carrierCode): CarrierAccountFields

    $client->getCountries(): Country

    $client->fetchPrintShipmentLabel(string $shipmentId, array $parameters): Label

    $client->getOrganisationObjects(array $queryParameters = []): OrganisationObject[]

    $client->getOrganisationObject(string $organisationObjectId): OrganisationObject

    $client->createOrganisationObject(array $payload): OrganisationObject

    $client->updateOrganisationObject(string $organisationObjectId, array $payload): OrganisationObject

    $client->deleteOrganisationObject(string $organisationObjectId): OrganisationObject

    $client->getOrganisations(array $queryParameters = []): Organisation[]

    $client->getOrganisation(string $organisationId): Organisation

    $client->createOrganisation(array $payload): Organisation

    $client->updateOrganisation(string $organisationId, array $payload): Organisation

    $client->deleteOrganisation($organisationId): Organisation

    $client->getShipments(array $queryParameters = []): Shipment[]

    $client->createShipment(array $payload): Shipment

    $client->cancelShipment(string $id): void

    $client->archiveShipment(string $shipmentId): Shipment

    $client->getUsers(array $queryParameters = []): User[]

    $client->getUser(string $userId): User

    $client->createConsolidateInvoice(array $payload): Invoice
bash
composer