Müşteri güncelleme
Mevcut bir müşteri kaydını güncellemek için bu endpoint kullanılır. PATCH ile yalnızca değiştirmek istediğiniz alanları gönderirsiniz.
İstek
PATCH /api/customers/{id}
Accept: application/json
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
İstek gövdesi alanları
PATCH ile yalnızca güncellemek istediğiniz alanları gönderin. Tüm alanlar isteğe bağlıdır.
| Alan | Tip | Açıklama |
|---|---|---|
type | string | person | company |
tax_number | string | VKN/TCKN (10–11 hane) |
tax_office | string | Vergi dairesi |
title | string | Tüzel ünvan |
name | string | Ad |
surname | string | Soyad |
phone | string | Telefon |
email | string | E-posta |
country | string | Ülke |
postcode | string | Posta kodu |
city | string | İl |
district | string | İlçe |
address | string | Açık adres |
iban | string | IBAN |
Örnek istekler
- 💻 cURL
- 🐘 PHP
- 🟢 Node.js
- 🐍 Python
- 🔷 C#
curl -X PATCH "https://app.faturaentegrator.com/api/customers/1" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"name":"Mehmet","surname":"DEMİR","phone":"5321234567","email":"musteri@example.com","country":"TÜRKİYE","postcode":"16010","city":"BURSA","district":"YENİŞEHİR","address":"Cumhuriyet Mh. No:12","tax_number":"","tax_office":""}'
<?php
$body = ['name' => 'Mehmet', 'surname' => 'DEMİR', 'phone' => '5321234567', 'email' => 'musteri@example.com', 'country' => 'TÜRKİYE', 'postcode' => '16010', 'city' => 'BURSA', 'district' => 'YENİŞEHİR', 'address' => 'Cumhuriyet Mh. No:12', 'tax_number' => '', 'tax_office' => ''];
$ch = curl_init('https://app.faturaentegrator.com/api/customers/1');
curl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => 'PATCH', CURLOPT_POSTFIELDS => json_encode($body), CURLOPT_HTTPHEADER => ['Accept: application/json', 'Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'], CURLOPT_RETURNTRANSFER => true]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
const body = { name: 'Mehmet', surname: 'DEMİR', phone: '5321234567', email: 'musteri@example.com', country: 'TÜRKİYE', postcode: '16010', city: 'BURSA', district: 'YENİŞEHİR', address: 'Cumhuriyet Mh. No:12', tax_number: '', tax_office: '' };
const res = await fetch('https://app.faturaentegrator.com/api/customers/1', { method: 'PATCH', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify(body) });
const data = await res.json();
import requests
body = {'name': 'Mehmet', 'surname': 'DEMİR', 'phone': '5321234567', 'email': 'musteri@example.com', 'country': 'TÜRKİYE', 'postcode': '16010', 'city': 'BURSA', 'district': 'YENİŞEHİR', 'address': 'Cumhuriyet Mh. No:12', 'tax_number': '', 'tax_office': ''}
response = requests.patch('https://app.faturaentegrator.com/api/customers/1', json=body, headers={'Accept': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'})
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Accept", "application/json");
client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
var body = new { name = "Mehmet", surname = "DEMİR", phone = "5321234567", email = "musteri@example.com", country = "TÜRKİYE", postcode = "16010", city = "BURSA", district = "YENİŞEHİR", address = "Cumhuriyet Mh. No:12", tax_number = "", tax_office = "" };
var content = new StringContent(System.Text.Json.JsonSerializer.Serialize(body), System.Text.Encoding.UTF8, "application/json");
var request = new HttpRequestMessage(HttpMethod.Patch, "https://app.faturaentegrator.com/api/customers/1") { Content = content };
var response = await client.SendAsync(request);
var data = await response.Content.ReadFromJsonAsync<JsonElement>();