Method | URL | İçerik Türü |
---|---|---|
POST | post/update | application/json |
Açıklama
- Bu metod, mevcut bir gönderiyi güncellemek veya üzerinde değişiklik yapmak amacıyla kullanılır. Kullanıcılar veya işyerleri, varolan gönderi bilgilerini güncellemek istediklerinde bu metodu kullanarak değişiklikleri API aracılığıyla iletebilirler.
- Gönderi güncelleme işlemi gönderi durumu 'Önizleme' ya da 'Teslim Alınacak' durumlarında yapılabilmektedir.
- Gönderi güncelleme işlemi gönderi durumu 'İşlemde' olduğu zamanlarda yapılamamaktadır. Gönderi özelindeki işlem bittiğinde tekrar güncelleme yapabilirsiniz.
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.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 | hayır | 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 | hayır | Alıcının ülke kodu. (Örn: tr) |
recipient.city | string | evet | Alıcının şehri. |
recipient.district | string | hayır | Alıcının ilçesi. |
recipient.post_code | string | evet | Alıcının bulunduğu yerin posta kodu. |
post.desi | decimal | hayır | Gönderinin ağırlığı. |
post.package_count | int | 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 ( 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ı. |
Örnek İstek
<?php
$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(
"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" => ""
);
$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://track.carrtell.co/check/MFYS29970",
"barcode_url": "https://barcode.carrtell.co/MFYS29970.pdf",
"post": {
"carrier_id": 4,
"carrier_name": "MNG Kargo",
"post_type": 1,
"post_type_name": "Aynı Gün 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"
}
}
}