Method | URL | İçerik Türü |
---|---|---|
POST | post/update | application/json |
Açıklama
Dikkat Edilmesi Gerekenler
Servise Gönderilmesi gereken zorunlu başlıklar
Parametre ismi | Tip | Zorunluluk | Açıklama |
---|---|---|---|
Authorization | Bearer | evet | auth/login metodundan aldığınız token |
Servise Gönderilmesi gereken parametreler
Parametre ismi | Tip | Zorunluluk | Açıklama |
---|---|---|---|
post_number | string | evet | Gönderi için tarafımızdan oluşturulan benzersiz id. |
sender.addressId (*) | integer | evet | hayır | Gönderici adres no bilgisi |
sender.name | string | evet | hayır | Gönderenin adı. |
sender.phone | string | evet | hayır | Gönderenin telefon numarası. |
sender.email | string | hayır | Gönderenin e-posta adresi. |
sender.address | string | evet | hayır | Gönderenin adresi. |
sender.country | string | hayır | Gönderenin ülke kodu. (Örn: tr) |
sender.city | string | evet | hayır | Gönderenin şehri. |
sender.district | string | evet | hayır | Gönderenin ilçesi. |
sender.post_code | string | hayır | Gönderenin bulunduğu yerin posta kodu. |
recipient.addressId (*) | integer | evet | hayır | Alıcı adres no bilgisi |
recipient.name | string | evet | hayır | Alıcının adı. |
recipient.phone | string | evet | hayır | Alıcının telefon numarası. |
recipient.email | string | hayır | Alıcının e-posta adresi. |
recipient.address | string | evet | hayır | Alıcının adresi. |
sender.country | string | hayır | Alıcının ülke kodu. (Örn: tr) |
recipient.city | string | evet | hayır | Alıcının şehri. |
recipient.district | string | evet | hayır | Alıcının ilçesi. |
recipient.post_code | string | hayır | Alıcının bulunduğu yerin posta kodu. |
post.desi | decimal | hayır | Gönderinin ağırlığı. |
post.package_count | integer | hayır | Gönderideki paket sayısı. |
post.note | string | hayır | Gönderi için bir not. |
barcode_format
|
string | hayır |
Barkod biçim kodu ( pdf-A5 ) |
custom_data_1 | string | hayır | Özel veri alanı. |
custom_data_2 | string | hayır | Özel veri alanı. |
custom_data_3 | string | hayır | Özel veri alanı. |
custom_data_4 | string | hayır | Özel veri alanı. |
Parametre ismi | Değer | Açıklama |
---|---|---|
(*) sender.addressId | 123 | Sadece Standart ve Aynı Gün Teslimat gönderilerinde doldurulması zorunludur. Sender için diğer alanlarını göndermeyiniz. |
(*) recipient.addressId | 123 | Sadece İade Alımı gönderilerinde doldurulması zorunludur. Recipient için diğer alanlarını göndermeyiniz. |
Örnek İstek
<?php
// Standart ve AGT
$data = array(
"post_number" => "MFYS29970",
"sender" => array(
"addressId"=> 150,
),
"recipient" => array(
"name"=> "John Doe",
"phone"=> "+90 535 123 45 67",
"email"=> "recipient@firma.com",
"address"=> "Deneme Mahallesi, Ural Sk. No:999",
"country"=> "tr",
"city"=> "İstanbul",
"district"=> "Maltepe",
"post_code" => ""
),
"post" => array(
"note" => ""
),
"barcode_format" => "",
"custom_data_1" => "",
"custom_data_2" => "",
"custom_data_3" => "",
"custom_data_4" => ""
);
// İade Gönderisi
$data = array(
"post_number" => "MFYS29970",
"sender" => array(
"name"=> "John Doe",
"phone"=> "+90 535 123 45 67",
"email"=> "sender@firma.com",
"address"=> "Deneme Mahallesi, Dolmabahçe Caddesi",
"country"=> "tr",
"city"=> "İstanbul",
"district"=> "Ataşehir",
"post_code"=> ""
),
"recipient" => array(
"addressId"=> 150,
),
"post" => array(
"note" => ""
),
"barcode_format" => "",
"custom_data_1" => "",
"custom_data_2" => "",
"custom_data_3" => "",
"custom_data_4" => ""
);
$payload = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '__APIURL__/post/update');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer __TOKEN__'
));
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
if ($response === false) {
echo 'cURL error: ' . curl_error($ch);
}
curl_close($ch);
echo $response;
?>
Örnek Servis Cevapları
{
"status": true,
"message": "Gönderi başarıyla güncellenmiştir.",
"data": {
"post_number": "MFYS29970",
"reference_id": "LDTN64JV124",
"tracking_url": "https://domestic-track.navlungo.com/check/MFYS29970",
"barcode_url": "https://domestic-qa-barcode.navlungo.com/MFYS29970.pdf",
"post": {
"carrier_id": 9,
"carrier_name": "Sürat Kargo",
"post_type": 2,
"post_type_name": "Standart Teslimat",
"cod_payment_type": null,
"cod_payment_type_name": null,
"sender": {
"name": "John Doe",
"phone": "+90 535 123 45 67",
"email": "sender@firma.com",
"address": "Deneme Mahallesi, Dolmabahçe Caddesi",
"country": "tr",
"city": "İstanbul",
"district": "Ataşehir",
"post_code": null,
"latitude": null,
"longitude": null
},
"recipient": {
"name": "John Doe",
"phone": "+90 535 123 45 67",
"email": "recipient@firma.com",
"address": "Deneme Mahallesi, Ural Sk. No:999",
"country": "tr",
"city": "İstanbul",
"district": "Maltepe",
"post_code": null
},
"post": {
"desi": 2.2,
"package_count": 1,
"price": 0,
"note": null
},
"custom_data_1": null,
"custom_data_2": null,
"custom_data_3": null,
"custom_data_4": null,
"created_at": "2023-06-01 13:39:46",
"updated_at": "2023-06-01 14:06:12"
}
}
}