Skip to content

Commit dd9c850

Browse files
committed
Update UPS API version to v2409
1 parent 1a7dec2 commit dd9c850

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/carriers/UPS.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public static function getServiceCodes(): array
130130
protected ?string $pickupType = '01';
131131
protected bool $includeInsurance = false;
132132
protected bool $addDeclaredValue = false;
133+
protected string $apiVersion = 'v2409';
133134

134135
private array $pickupCodes = [
135136
'01' => 'Daily Pickup',
@@ -252,7 +253,7 @@ public function getRates(Shipment $shipment): ?RateResponse
252253
}
253254

254255
$request = new Request([
255-
'endpoint' => 'api/rating/v1/Shop',
256+
'endpoint' => "api/rating/$this->apiVersion/Shop",
256257
'payload' => [
257258
'json' => $payload,
258259
],
@@ -316,7 +317,7 @@ public function getTrackingStatus(array $trackingNumbers, array $options = []):
316317

317318
$request = new Request([
318319
'method' => 'GET',
319-
'endpoint' => "api/track/v1/details/{$trackingNumber}",
320+
'endpoint' => "api/track/$this->apiVersion/details/{$trackingNumber}",
320321
]);
321322

322323
$data = $this->fetchTracking($request, function(Response $response) {
@@ -471,7 +472,7 @@ public function getLabels(Shipment $shipment, Rate $rate, array $options = []):
471472
$payload['ShipmentRequest']['Shipment']['Shipper']['ShipperNumber'] = $this->accountNumber;
472473

473474
$request = new Request([
474-
'endpoint' => 'api/shipments/v1/ship',
475+
'endpoint' => "api/shipments/$this->apiVersion/ship",
475476
'payload' => [
476477
'json' => $payload,
477478
],
@@ -517,7 +518,7 @@ public function getHttpClient(): HttpClient
517518

518519
// Fetch an access token first
519520
$authResponse = Json::decode((string)(new HttpClient())
520-
->request('POST', $url . 'security/v1/oauth/token', [
521+
->request('POST', $url . "security/$this->apiVersion/oauth/token", [
521522
'headers' => [
522523
'Content-Type' => 'application/x-www-form-urlencoded',
523524
'x-merchant-id' => $this->clientId,

0 commit comments

Comments
 (0)