Method | URL | İçerik Türü |
---|---|---|
POST | post/create | 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 [posts array dışı]
Parametre ismi | Tip | Zorunluluk | Açıklama |
---|---|---|---|
platform | string | hayır | Örnek : firmadınız |
Servise Gönderilmesi gereken parametreler [posts array içi]
Parametre ismi | Tip | Zorunluluk | Açıklama |
---|---|---|---|
reference_id (*) | string | hayır | Gönderi için benzersiz bir id. |
carrier_id (*) | integer | evet | Gönderi teslimatından sorumlu taşıyıcı. |
post_type (*) | integer | evet | Gönderinin türü. İzin verilen değerler: 1, 2 |
cod_payment_type (*) | integer || string ("") | hayır | Gönderi için kapıda ödeme yöntemi. İzin verilen değerler: 1,2 veya boş string "" |
sender.addressId (*) | integer | evet | Gönderici adres no bilgisi |
recipient.name | string | evet | Alıcının adı. |
recipient.phone (*) | string | evet | Alıcının telefon numarası. |
recipient.email | string | hayır | Alıcının e-posta adresi. |
recipient.address | string | evet | Alıcının adresi. |
recipient.country | string | evet | Alıcının ülke kodu. (Örn: tr) |
recipient.city | string | evet | Alıcının şehri. |
recipient.district | string | evet | Alıcının ilçesi. |
recipient.post_code | string | hayır | Alıcının bulunduğu yerin posta kodu. |
post.desi | decimal | evet | Gönderinin ağırlığı. |
post.package_count | integer | evet | Gönderideki paket sayısı. |
post.price (*) | decimal | hayır | Kapıda ödeme tutarı. |
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 |
---|---|---|
(*) reference_id | NVL123456 | Size ait sipariş numarası ya da takipde kullanılacak bir değer |
(*) carrier_id | 1 | Taşıyıcı Ayarları Otomatik veya Kapsam Alanına Göre ise 1 değeri gönderilecektir. |
9 | Sürat Kargo | |
10 | HepsiJet | |
11 | Kolay Gelsin | |
12 | Scotty | |
13 | Aras Kargo | |
14 | Ptt Kargo | |
15 | Vigo | |
16 | Hepsijet XL | |
(*) post_type | 1 | Aynı Gün Teslimat |
2 | Standart Teslimat | |
(*) cod_payment_type | 1 | Kapıda Nakit Ödeme |
2 | Kapıda Kredi Kartı | |
(*) sender.addressId | 123 | Adres Defterinden aldığınız Depo Adresiniz (sender) |
(*) post.price | 1.00 | cod_payment_type alanı 1 veya 2 ise gönderilecektir. |
(*) recipient.phone | - | Lütfen belirtilen formatta gönderiniz +90 532 123 45 67 |
Örnek İstek
<?php
$data = [
"platform" => "",
"posts"=>
[
[
"reference_id"=> "",
"carrier_id"=> 9,
"post_type"=> 1,
"cod_payment_type"=> "",
"sender"=> [
"addressId"=> 150,
],
"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"=> ""
],
"post"=> [
"desi"=> 2.2,
"package_count"=> 1,
"price"=> "",
"note"=> ""
],
"barcode_format"=> "",
"custom_data_1"=> "",
"custom_data_2"=> "",
"custom_data_3"=> "",
"custom_data_4"=> ""
]
]
];
$payload = json_encode($data);
$ch = curl_init('__APIURL__/post/create');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array(
'X-localization : tr',
'Content-Type : application/json',
'Authorization : Bearer __TOKEN__',
));
$result = curl_exec($ch);
curl_close($ch);
print_r($result);
?>
Örnek Servis Cevapları
{
"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": "",
"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": "34700"
"latitude": "123.456",
"longitude": "456.789"
},
"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": "34852"
},
"post": {
"desi": 2.2,
"package_count": 1,
"price": "",
"note": ""
},
"custom_data_1": "",
"custom_data_2": "",
"custom_data_3": "",
"custom_data_4": "",
"created_at": "2022-02-28 14:30:00",
"updated_at": "2022-02-28 15:30:00"
}
}