PHP client for the Waldom APIs, built on top of Saloon.
composer require sawirricardo/waldom-php<?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.
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');$response = $waldom
->orderApi()
->getApiVversionOrderApi($version, $apiKey, 'PO123456');
$data = $response->json();$response = $waldom
->asnApi()
->getApiVversionAsnApi($version, $apiKey, 'PO123456');With an optional packing list number:
$response = $waldom
->asnApi()
->getApiVversionAsnApi($version, $apiKey, 'PO123456', 'PACKING-LIST-123');$response = $waldom
->invoiceApi()
->getApiVversionInvoiceApi($version, $apiKey, 'PO123456');$response = $waldom
->productSearch()
->getApiVversionProductSearch(
$apiKey,
'PART-NUMBER',
'1', // inStockOnly: 1 or 0
'0', // exactMatch: 1 or 0
'10', // resultsCount
$version,
);$response = $waldom
->inventoryAndPricing()
->getApiVversionInventoryAndPricing(
$version,
$apiKey,
'PART-NUMBER',
'1', // inStockOnly: 1 or 0
'0', // exactMatch: 1 or 0
'10', // resultsCount
);$response = $waldom
->orderLineShipmentApi()
->getApiVversionOrderLineShipmentApi($version, $apiKey, 'PO123456', 1);With a shipment GUID:
$response = $waldom
->orderLineShipmentApi()
->getApiVversionOrderLineShipmentApi($version, $apiKey, 'PO123456', 1, 'SHIPMENT-GUID');$waldom->asnApi();
$waldom->inventory();
$waldom->inventoryAndPricing();
$waldom->inventoryAndPricingPushApitrigger();
$waldom->invoiceApi();
$waldom->orderApi();
$waldom->orderLineApi();
$waldom->orderLineShipmentApi();
$waldom->pricing();
$waldom->productSearch();
$waldom->upsoutboundOrder();Each endpoint returns a Saloon response:
if ($response->successful()) {
$data = $response->json();
}
$status = $response->status();
$body = $response->body();