sawirricardo / waldom-php
Waldom APIs PHP SDK
0.0.1
2026-05-28 09:06 UTC
Requires
- php: ^8.2
- saloonphp/saloon: ^3.0|^4.0
- spatie/laravel-data: ^3.0|^4.0
Requires (Dev)
- phpunit/phpunit: ^10.0|^11.0|^12.0
README
PHP client for the Waldom APIs, built on top of Saloon.
Installation
composer require sawirricardo/waldom-php
Basic Usage
<?php use Sawirricardo\Waldom\Waldom; $apiKey = getenv('WALDOM_API_KEY'); $version = '1'; $waldom = Waldom::production(); $response = $waldom ->orderApi() ->getApiVversionOrderApi($version, $apiKey, 'PO123456'); $order = $response->json();
The API key is currently sent as part of the Waldom API path:
https://api.waldom.com/api/v1/{apiKey}/OrderAPI/{poNumber}
Keep the API key outside your source code, for example in an environment variable.
Environments
Production is used by default.
use Sawirricardo\Waldom\Waldom; $production = new Waldom(); $production = Waldom::production(); $sandbox = Waldom::sandbox();
Default URLs:
Production: https://api.waldom.com
Sandbox: https://sandbox.waldom.com
You can also use the waldomapac.com domain:
$production = Waldom::production(Waldom::DOMAIN_APAC); $sandbox = Waldom::sandbox('apac');
Those resolve to:
Production: https://api.waldomapac.com
Sandbox: https://sandbox.waldomapac.com
For a custom base URL:
$waldom = Waldom::withBaseUrl('https://api.waldomapac.com');
Examples
Get an Order
$response = $waldom ->orderApi() ->getApiVversionOrderApi($version, $apiKey, 'PO123456'); $data = $response->json();
Get an ASN
$response = $waldom ->asnApi() ->getApiVversionAsnApi($version, $apiKey, 'PO123456');
With an optional packing list number:
$response = $waldom ->asnApi() ->getApiVversionAsnApi($version, $apiKey, 'PO123456', 'PACKING-LIST-123');
Get an Invoice
$response = $waldom ->invoiceApi() ->getApiVversionInvoiceApi($version, $apiKey, 'PO123456');
Search Products
$response = $waldom ->productSearch() ->getApiVversionProductSearch( $apiKey, 'PART-NUMBER', '1', // inStockOnly: 1 or 0 '0', // exactMatch: 1 or 0 '10', // resultsCount $version, );
Inventory and Pricing
$response = $waldom ->inventoryAndPricing() ->getApiVversionInventoryAndPricing( $version, $apiKey, 'PART-NUMBER', '1', // inStockOnly: 1 or 0 '0', // exactMatch: 1 or 0 '10', // resultsCount );
Order Line Shipments
$response = $waldom ->orderLineShipmentApi() ->getApiVversionOrderLineShipmentApi($version, $apiKey, 'PO123456', 1);
With a shipment GUID:
$response = $waldom ->orderLineShipmentApi() ->getApiVversionOrderLineShipmentApi($version, $apiKey, 'PO123456', 1, 'SHIPMENT-GUID');
Available Resources
$waldom->asnApi(); $waldom->inventory(); $waldom->inventoryAndPricing(); $waldom->inventoryAndPricingPushApitrigger(); $waldom->invoiceApi(); $waldom->orderApi(); $waldom->orderLineApi(); $waldom->orderLineShipmentApi(); $waldom->pricing(); $waldom->productSearch(); $waldom->upsoutboundOrder();
Handling Responses
Each endpoint returns a Saloon response:
if ($response->successful()) { $data = $response->json(); } $status = $response->status(); $body = $response->body();