İçeriğe geç

Yeni Adres Oluştur

POST /v1/addresses/{USER_ID}
POST /v1/addresses/{USER_ID}

Gönderici (sender) veya alıcı (receiver) olarak sisteme yeni bir kargo adresi ekler.

ParametreKonumTipAçıklamaVarsayılanÖrnek
Authorization * headerstringBearer Yetkilendirme Tokeni (Örn: Bearer eyJhb...)-Bearer <TOKEN>
USER_ID * pathstringİşlem yapan kullanıcının kimlik (ID) değeri. UUID formatındadır.--
{
"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
}
}
fetch('https://api.kargomucuz.com/v1/addresses/{USER_ID}', {
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));
200: Başarılı
{
"status": true,
"message": "Endpoint bulunamadı.",
"code": 500
}
401: Yetkisiz
{
"status": false,
"message": "Herhangi bir giriş sağlanmadı.",
"code": 500
}