fulfillment / straightship-api
dev-master
2024-10-21 18:57 UTC
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3 || ^6.2.1-stable || ^5.3.1-stable
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.3
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2025-02-25 13:57:53 UTC
README
API regions: US: https://api-us.techship.io/api/docs/ui/index CA: https://api-ca.techship.io/api/docs/ui/index
This PHP package is automatically generated by the Swagger Codegen project:
- API version: V3
- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/git_user_id/git_repo_id.git"
}
],
"require": {
"git_user_id/git_repo_id": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: x-api-key $config = Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer'); // Configure API key authorization: x-secret-key $config = Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKey('x-secret-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-secret-key', 'Bearer'); $apiInstance = new Fulfillment\StraightShip\Client\Api\AuthApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->getPermissions(); print_r($result); } catch (Exception $e) { echo 'Exception when calling AuthApi->getPermissions: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: x-api-key $config = Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer'); // Configure API key authorization: x-secret-key $config = Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKey('x-secret-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-secret-key', 'Bearer'); $apiInstance = new namespace Fulfillment\StraightShip\Client\Api\AuthApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $apiInstance->login(); } catch (Exception $e) { echo 'Exception when calling AuthApi->login: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: x-api-key $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer'); // Configure API key authorization: x-secret-key $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKey('x-secret-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-secret-key', 'Bearer'); $apiInstance = new namespace Fulfillment\StraightShip\Client\Api\AuthApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $refresh_token = "refresh_token_example"; // string | try { $result = $apiInstance->refreshToken($refresh_token); print_r($result); } catch (Exception $e) { echo 'Exception when calling AuthApi->refreshToken: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: x-api-key $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer'); // Configure API key authorization: x-secret-key $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKey('x-secret-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = namespace Fulfillment\StraightShip\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-secret-key', 'Bearer'); $apiInstance = new namespace Fulfillment\StraightShip\Client\Api\AuthApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $uid = "uid_example"; // string | try { $result = $apiInstance->token($uid); print_r($result); } catch (Exception $e) { echo 'Exception when calling AuthApi->token: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://api-us.techship.io/
Class | Method | HTTP request | Description |
---|---|---|---|
AuthApi | getPermissions | POST /api/v3/auth/permissions | Get permissions |
AuthApi | login | POST /api/v3/auth/login | Login |
AuthApi | refreshToken | POST /api/v3/auth/refreshtoken | Desktop login, exchange refresh token for token |
AuthApi | token | POST /api/v3/auth/token | Desktop login, exchange uid for token |
BoxesApi | listBoxes | GET /api/v3/boxes | List client boxes |
CarriersApi | listCarriers | GET /api/v3/carriers | List carriers |
ClientsApi | listClients | GET /api/v3/clients | List clients |
ClientsApi | listPrinters | GET /api/v3/miscellaneous/printers | List clients |
CountriesApi | listCountries | GET /api/v3/countries | List countries |
ManifestsApi | finalizeManifest | POST /api/v3/manifests/finalize/{manifestId} | Finalize manifest |
ManifestsApi | getManifest | GET /api/v3/manifests/{manifestId} | Get manifest |
ManifestsApi | listTrackingNumbers | GET /api/v3/manifests/listtrackingnumbers/{manifestId} | Get manifest tracking numbers |
ManifestsApi | searchManifests | GET /api/v3/manifests/search | Get manifest tracking numbers |
ManifestsApi | validateTrackingNumber | PUT /api/v3/manifests/validatetrackingnumber | Validate tracking number |
ManifestsApi | validateTrackingNumberExt | PUT /api/v3/manifests/validatetrackingnumberext | Validate tracking number |
ManifestsApi | validateTransaction | PUT /api/v3/manifests/validatetransaction | Validate transaction |
MiddleMileApi | setContainerId | PUT /api/v3/middlemile/setcontainerid | Set container for shipment by tracking number |
ShipmentsApi | callPrint | POST /api/v3/shipments/print | Send shipment to printer (requires desktop client) |
ShipmentsApi | cartonizeShipment | POST /api/v3/shipments/cartonize | Cartonize unpacked shipment |
ShipmentsApi | countShipment | GET /api/v3/shipments/count | Count |
ShipmentsApi | createShipment | POST /api/v3/shipments/create | Create shipment |
ShipmentsApi | delete | DELETE /api/v3/shipments/{shipmentId} | Delete shipment |
ShipmentsApi | estimateShipment | POST /api/v3/shipments/estimate | Create shipment |
ShipmentsApi | getShipment | GET /api/v3/shipments/{shipmentId} | Get shipment |
ShipmentsApi | importAndProcess | POST /api/v3/shipments/importandprocess | Import shipment |
ShipmentsApi | listShipment | GET /api/v3/shipments | List shipments |
ShipmentsApi | trigger | POST /api/v3/shipments/{shipmentId} | Triggers WMS callback |
ShipmentsApi | updateShipment | PUT /api/v3/shipments/{shipmentId} | Update shipment |
Documentation For Models
- Address
- ApiError
- BatteriesInfo
- Carrier
- CarrierBillingAccount
- CarrierOrderRate
- CartonizeResult
- Client
- ClientBillingAccount
- ClientBox
- Country
- CountrySubDivision
- CreateLabelRequest
- CreateLabelResult
- CustomField
- Customs
- DangerousGoodsDetails
- DangerousGoodsDetailsBasic
- DangerousGoodsDetailsDhl
- DangerousGoodsDetailsFedex
- DangerousGoodsHeader
- DangerousGoodsSignatory
- Dimensions
- DutyBilling
- InputOrder
- InputPackage
- InputPackageItem
- InputUnpackedItem
- InputUnpackedOrder
- Insurance
- LTLOptions
- Label
- Manifest
- MiddleMileContainerIdUpdateRequest
- MiddleMileContainerIdUpdateResponse
- OperationResult
- Order
- Package
- PackageBase
- PackageDetails
- PackageFreightCharge
- PackageItem
- PackageOptions
- Permissions
- Printer
- RatesResult
- Routing
- ServiceCode
- ShipToAddress
- ShippingOptions
- TaxInfo
- Token
- TrackingNumber
- UserDocument
- ValidateTrackingInfo
- VoidShipmentResult
Documentation For Authorization
x-api-key
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header
x-secret-key
- Type: API key
- API key parameter name: x-secret-key
- Location: HTTP header