Varsayılan Adresleri Getir
Açıklama
Section titled “Açıklama” GET
/v1/addresses/default/0 Kullanıcının gönderi, alıcı ve fatura işlemleri için seçtiği varsayılan adresleri getirir.
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. | - | - |
Örnek Kod
Section titled “Örnek Kod”fetch('https://api.kargomucuz.com/v1/addresses/default/0', { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <YOUR_TOKEN>' }}).then(response => response.json()).then(data => console.log(data));$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.kargomucuz.com/v1/addresses/default/0');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$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”200:
{ "status": true, "message": "Kullanıcı varsayılan adresleri getirildi", "payload": { "data": { "senderAddress": { "others": { "tag": null, "latitude": null, "longitude": null, "isActive": true, "updated": "2025-10-27T11:25:25.032Z", "created": "2025-10-27T11:25:25.032Z" }, "resellerId": null, "_id": "68ff56a5741d301e0e57e3b0", "type": "sender", "title": "Yusuf Tüfekci", "explanation": null, "location": { "country": { "id": "298795", "title": "Türkiye", "code": "tr" }, "province": { "id": null, "title": null, "code": null }, "city": { "id": "45", "title": "Manisa", "code": null }, "district": { "id": "45008", "title": "Sarıgöl", "code": null }, "neighborhood": { "id": null, "title": null, "code": null }, "street": { "id": null, "title": null, "code": null }, "address": { "line1": "Ayan mah Tunus sok no 3", "line2": null, "line3": null }, "postCode": null }, "by": { "phone1": { "phoneCountryCode": "90", "number": "5434942899" }, "phone2": { "phoneCountryCode": null, "number": null }, "phone3": { "phoneCountryCode": null, "number": null }, "entity": "Yusuf Tüfekci", "email": null }, "__v": 0 }, "receiverAddress": { "others": { "tag": null, "latitude": null, "longitude": null, "isActive": true, "updated": "2025-02-19T06:28:29.886Z", "created": "2025-02-19T06:28:29.886Z" }, "resellerId": null, "_id": "67b57a0d9236d0fdc4397a3c", "type": "receiver", "title": "Deneme", "explanation": null, "location": { "country": { "id": "298795", "title": "türkiye", "code": "tr" }, "province": { "id": null, "title": null, "code": null }, "city": { "title": "antalya", "id": null, "code": null }, "district": { "title": "kaş", "id": null, "code": null }, "neighborhood": { "id": null, "title": null, "code": null }, "street": { "id": null, "title": null, "code": null }, "address": { "line1": "Ab", "line2": null, "line3": null }, "postCode": null }, "by": { "phone1": { "phoneCountryCode": "90", "number": "5419441858" }, "phone2": { "phoneCountryCode": null, "number": null }, "phone3": { "phoneCountryCode": null, "number": null }, "entity": "Deneme", "email": null }, "__v": 0 }, "invoiceAddress": null } }, "code": 500}