Method | URL | İçerik Türü |
---|---|---|
PUT | address-book/update | application/json |
Açıklama
Dikkat Edilmesi Gerekenler
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 |
---|---|---|---|
address_type (*)
|
string | evet | Adres türü Gönderici veya Alıcı |
location_name (*)
|
string | evet | hayır | Adres Konumu (örn: Ana Depo) |
address_name
|
string | evet | Gönderici / Alıcı Adı - Şirket Adı |
address_email
|
string | hayır | Gönderici / Alıcı email adresi |
address_phone (*)
|
string | evet | Gönderici / Alıcı telefon numarası |
address_line
|
string | evet | Gönderici / Alıcı adresi |
address_country
|
string | evet | Gönderici / Alıcı ülkesi (örn: tr) |
address_city
|
string | evet | Gönderici / Alıcı İli |
address_district
|
string | evet | Gönderici / Alıcı İlçesi |
is_main_warehouse (*)
|
integer | evet | Ana Depo Durumu |
Parametre ismi | Değer | Açıklama |
---|---|---|
(*) address_type | sender - recipient | Gönderici için sender Alıcı için recipient |
(*) location_name | 1 | Sadece address_type değeri sender ise gönderilecektir. Örnek Navlungo Ana Depo |
(*) address_phone | 1 | Lütfen belirtilen formatta gönderiniz +90 532 123 45 67 |
(*) is_main_warehouse | 0 | Sadece address_type değeri sender ise ana depo yapmak istediğiniz adrese 1 olarak gönderilecektir. Sadece 1 adet ana depo kaydı oluşturulabilir. |
Örnek İstek
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '__APIURL__/address-book/update',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"address_type": "sender",
"location_name": "John Depo 2",
"address_name": "John Doe",
"address_email": "john@doe.com",
"address_phone": "+90531234567",
"address_line": "Deneme Mahallesi Ural Sokak No:999",
"address_country": "tr",
"address_city": "İstanbul",
"address_district": "Kadıköy",
"is_main_warehouse": 1
}',
CURLOPT_HTTPHEADER => array(
'X-localization: tr',
'Content-Type: application/json',
'Authorization: Bearer __TOKEN__',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Örnek Servis Cevapları
{
"status": true,
"message": "Adres kaydınız başarıyla güncellenmiştir.",
"data": {
"id": 159,
"customer_id": 136,
"customer_name": "Navlungo Test Account",
"address_type": "sender",
"location_name": "John Depo 2",
"address_name": "John Doe",
"address_email": "john@doe.com",
"address_phone": "+90 531234567",
"address_line": "Deneme Mahallesi Ural Sokak No:999",
"address_country": "tr",
"address_city": "İstanbul",
"address_district": "Kadıköy",
"address_post_code": null,
"address_latitude": null,
"address_longitude": null,
"is_main_warehouse": 1,
"created_at": "2024-10-24 20:28:23",
"updated_at": "2024-10-24 20:28:23"
}
}