Method | URL | İçerik Türü |
---|---|---|
POST | post/create | application/json |
Açıklama
- Bu metod, yeni bir gönderi oluşturmak için kullanılır. Gönderi oluşturma işlemi, müşterilerin veya işyerlerinin yeni gönderilerini sisteme tanıtmalarını sağlar. Bu metod sayesinde gerekli gönderi bilgileri API aracılığıyla iletilir ve sistemdeki ilgili işlemler başlatılır. Bu, gönderi yönetimi sürecinin başlangıcını temsil eder.
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 : ticimax, shopify, ideasoft |
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, 3 |
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.name | string | evet | Gönderenin adı. |
sender.phone (*) | string | evet | Gönderenin telefon numarası. |
sender.email | string | hayır | Gönderenin e-posta adresi. |
sender.address | string | evet | Gönderenin adresi. |
sender.country | string | evet | Gönderenin ülke kodu. (Örn: tr) |
sender.city | string | evet | Gönderenin şehri. |
sender.district | string | evet | Gönderenin ilçesi. |
sender.post_code | string | hayır | Gönderenin bulunduğu yerin posta kodu. |
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. |
sender.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 ( html, pdf-A5, pdf-A6, pdf-A6Y, pdf-A7 ) |
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 |
---|---|---|
(*) 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 | |
(*) post_type | 1 | Aynı Gün Teslimat |
2 | Standart Teslimat | |
3 | İade | |
(*) cod_payment_type | 1 | Kapıda Nakit Ödeme |
2 | Kapıda Kredi Kartı | |
(*) post.price | 1.00 | cod_payment_type alanı 1 veya 2 ise gönderilecektir. |
(*) sender.phone | - | Lütfen belirtilen formatta gönderiniz +90 532 123 45 67 |
(*) recipient.phone | - | Lütfen belirtilen formatta gönderiniz +90 532 123 45 67 |
(*) barcode_format | html | Base64 türünde dönüş yapılacaktır |
Örnek İstek
<?php
$data = [
"platform" => "",
"posts"=>
[
[
"reference_id"=> "",
"carrier_id"=> 9,
"post_type"=> 1,
"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"=> ""
],
"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"=> "", // html,pdf-A5,pdf-A6,pdf-A6Y,pdf-A7
"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": 4,
"carrier_name": "MNG Kargo",
"post_type": 1,
"post_type_name": "Aynı Gün 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"
}
}