Adres Yönetimi Genel bakış
Adres Yönetimi - Genel Bakış Yeni Adres Oluştur Tüm Gönderici Adresleri Gönderici Adresi Detayı Kullanıcı Adreslerini Listele Kullanıcı Gönderici Adresleri Alıcı Adresi Detayı Varsayılan Adresleri Getir Adres Detayı Adres Güncelle Adres Sil Ülkeleri Listele Şehirleri Listele İlçeleri Listele Mahalleleri Listele Sokakları Listele
Adres Güncelle
Açıklama
Section titled “Açıklama” PUT
/v1/addresses/0/0 Kayıtlı bir kargo adresini günceller (telefon, konum, metin değişiklikleri).
Parametreler
Section titled “Parametreler”| Parametre | Konum | Tip | Açıklama | Varsayılan | Örnek |
|---|---|---|---|---|---|
| Authorization * | header | string | Bearer Yetkilendirme Tokeni (Örn: Bearer eyJhb...) | - | Bearer <TOKEN> |
| USER_ID * | path | string | İşlem yapan kullanıcının kimlik (ID) değeri. UUID formatındadır. | - | - |
İstek Gövdesi
Section titled “İstek Gövdesi”| Alan | Tip | Açıklama |
|---|---|---|
| others | object |
{ //"address":{ // "countryCode":"tr" //} "others":{ "isActive": false }}Örnek Kod
Section titled “Örnek Kod”fetch('https://api.kargomucuz.com/v1/addresses/0/0', { method: 'PUT', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <YOUR_TOKEN>' }, body: JSON.stringify({ //"address":{ // "countryCode":"tr" //} "others":{ "isActive": false } })}).then(response => response.json()).then(data => console.log(data));$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.kargomucuz.com/v1/addresses/0/0');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
$body = <<<'EOD'{ //"address":{ // "countryCode":"tr" //} "others":{ "isActive": false }}EOD;curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$headers = array();$headers[] = 'Content-Type: application/json';$headers[] = 'Authorization: Bearer <YOUR_TOKEN>';curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);if (curl_errno($ch)) { echo 'Error:' . curl_error($ch);}curl_close($ch);echo $result;Yanıtlar
Section titled “Yanıtlar”500: Sunucu Hatası
{ "error": "fetch failed"}