Aras Kargo API
Aras Kargo, Türkiye'nin köklü kargo firmalarından biridir. SOAP tabanlı API ile gönderi oluşturma, kargo takibi ve fiyat hesaplama işlemlerini entegre edebilirsiniz.
WSDL Adresleri
- Gönderi: https://customerservices.araskargo.com.tr/ArasCargoCustomerIntegrationService/ArasCargoIntegrationService.svc?wsdl
- Takip: https://customerservices.araskargo.com.tr/ArasCargoCustomerIntegrationService/ArasCargoIntegrationService.svc?wsdl
1. Gönderi Oluşturma
$wsdl = 'https://customerservices.araskargo.com.tr/ArasCargoCustomerIntegrationService/ArasCargoIntegrationService.svc?wsdl';
$client = new SoapClient($wsdl);
$params = [
'UserName' => 'MUSTERI_KODU',
'Password' => 'API_SIFRE',
'TradingWaybillNumber'=> uniqid(),
'InvoiceNumber' => 'FAT-001',
'ReceiverName' => 'Ali Yılmaz',
'ReceiverPhone' => '05551234567',
'ReceiverAddress' => 'Atatürk Cad. No:5 Ankara',
'ReceiverCityCode' => '6',
'ReceiverTownCode' => '69',
'PieceCount' => '1',
'Weight' => '2',
'Volume' => '3',
'PayorTypeCode' => '1',
'IsWorldWide' => '0',
];
$result = $client->SetOrder($params);
2. Kargo Takip Sorgulama
$tracking = $client->GetQueryJSON([
'UserName' => 'MUSTERI_KODU',
'Password' => 'API_SIFRE',
'IntegrationCode' => $cargo_key,
'QueryType' => 1,
]);
$data = json_decode($tracking->GetQueryJSONResult);
echo 'Durum: ' . $data->DURUM_ACIKLAMA;