Yeni Adres Oluştur
Açıklama
Section titled “Açıklama” POST
/v1/addresses/0 Gönderici (sender) veya alıcı (receiver) olarak sisteme yeni bir kargo adresi ekler.
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 |
|---|---|---|
| type | string | Adresin türü ('sender' veya 'receiver') |
| title | string | Kullanıcının anlayacağı adres başlığı (Örn: 'Evim', 'Merkez Depo') |
| location | object | |
| by | object | Teslimatta sorumlu kişinin iletişim verisi |
| others | object |
{ "type":"receiver", "title":"deneme adresi 24", "location":{ "country":{ "id":"298795", "title":"Türkiye", "code":"tr" }, "province":{ "id":"", "title":"", "code":"" }, "city":{ "id":"0", "title":"Samsun", "code":"" }, "district":{ "id":"0", "title":"Çarşamba", "code":"" }, "neighborhood":{ "id":"0", "title":"", "code":"" }, "street":{ "id":"0", "title":"", "code":"" }, "address":{ "line1":"2010 sitesi 1", "line2":"2010 sitesi 2", "line3":"2010 sitesi 3" }, "postCode":"" }, "by":{ "entity":"Yusuf Yasir Kaygusuz", "phone1":{ "phoneCountryCode":"90", "number":"5413234321" }, "phone2":{ "phoneCountryCode":"90", "number":"5413234322" }, "phone3":{ "phoneCountryCode":"90", "number":"5413234323" }, "email":"yasirkaygusuzone@hotmail.com" }, //"invoice":{ // "eInvoice":false, // "taxDepartment":"", // "taxNumber":"" //}, "others":{ // "tag":"", // "isActive":"false", // "latitude":0.1233213, // "longitude":0.1233213 }}Örnek Kod
Section titled “Örnek Kod”fetch('https://api.kargomucuz.com/v1/addresses/0', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <YOUR_TOKEN>' }, body: JSON.stringify({ "type":"receiver", "title":"deneme adresi 24", "location":{ "country":{ "id":"298795", "title":"Türkiye", "code":"tr" }, "province":{ "id":"", "title":"", "code":"" }, "city":{ "id":"0", "title":"Samsun", "code":"" }, "district":{ "id":"0", "title":"Çarşamba", "code":"" }, "neighborhood":{ "id":"0", "title":"", "code":"" }, "street":{ "id":"0", "title":"", "code":"" }, "address":{ "line1":"2010 sitesi 1", "line2":"2010 sitesi 2", "line3":"2010 sitesi 3" }, "postCode":"" }, "by":{ "entity":"Yusuf Yasir Kaygusuz", "phone1":{ "phoneCountryCode":"90", "number":"5413234321" }, "phone2":{ "phoneCountryCode":"90", "number":"5413234322" }, "phone3":{ "phoneCountryCode":"90", "number":"5413234323" }, "email":"yasirkaygusuzone@hotmail.com" }, //"invoice":{ // "eInvoice":false, // "taxDepartment":"", // "taxNumber":"" //}, "others":{ // "tag":"", // "isActive":"false", // "latitude":0.1233213, // "longitude":0.1233213 } })}).then(response => response.json()).then(data => console.log(data));$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.kargomucuz.com/v1/addresses/0');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$body = <<<'EOD'{ "type":"receiver", "title":"deneme adresi 24", "location":{ "country":{ "id":"298795", "title":"Türkiye", "code":"tr" }, "province":{ "id":"", "title":"", "code":"" }, "city":{ "id":"0", "title":"Samsun", "code":"" }, "district":{ "id":"0", "title":"Çarşamba", "code":"" }, "neighborhood":{ "id":"0", "title":"", "code":"" }, "street":{ "id":"0", "title":"", "code":"" }, "address":{ "line1":"2010 sitesi 1", "line2":"2010 sitesi 2", "line3":"2010 sitesi 3" }, "postCode":"" }, "by":{ "entity":"Yusuf Yasir Kaygusuz", "phone1":{ "phoneCountryCode":"90", "number":"5413234321" }, "phone2":{ "phoneCountryCode":"90", "number":"5413234322" }, "phone3":{ "phoneCountryCode":"90", "number":"5413234323" }, "email":"yasirkaygusuzone@hotmail.com" }, //"invoice":{ // "eInvoice":false, // "taxDepartment":"", // "taxNumber":"" //}, "others":{ // "tag":"", // "isActive":"false", // "latitude":0.1233213, // "longitude":0.1233213 }}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”200: Başarılı kimlik doğrulaması sonrası dönen yanıt.
{ "status": true, "message": "Adres oluşturma başarılı.", "payload": { "data": { "resellerId": null, "type": "receiver", "title": "Sender Adresim Example", "explanation": null, "location": { "country": { "id": "298795", "title": "Türkiye", "code": null }, "province": { "id": "", "title": "", "code": "" }, "city": { "id": "55", "title": "Samsun", "code": null }, "district": { "id": "55003", "title": "Çarşamba", "code": null }, "neighborhood": { "id": null, "title": null, "code": null }, "street": { "id": null, "title": null, "code": null }, "address": { "line1": "2010 sitesi 1", "line2": null, "line3": null }, "postCode": "" }, "by": { "entity": "Yusuf Yasir Kaygusuz", "phone1": { "phoneCountryCode": "90", "number": "5419441858" }, "phone2": { "phoneCountryCode": null, "number": null }, "phone3": { "phoneCountryCode": null, "number": null }, "email": "yasirkaygusuzone@hotmail.com" }, "others": { "tag": null, "latitude": null, "longitude": null, "isActive": false, "updated": "2026-06-09T12:47:04.778Z", "created": "2026-06-09T12:47:04.778Z" }, "_id": "6a280b481391689d3a486d37", "__v": 0 } }, "code": 500}