Müşteri Oluşturma
Açıklama
Bu servis aracılığıyla, Portal ekranından yapıldığı gibi müşteri kaydı oluşturulabilir. Bireysel veya kurumsal müşteriler desteklenir. Ek olarak, sistemde kullanılan bazı opsiyonel alanlar (passportNo, districtCode, isForeignNational, title) da gönderilebilir.
- Endpoint:
/vendor/customer - Method:
POST Request Content-Type:application/json
Yetkilendirme:Geçerli AccessToken zorunludur. (Bkz: Madde 1 – AccessToken Alınması)
Request Body
| Alan Adı | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| code | string | Evet | Müşteri veya alt müşteri kullanıcı kodu (benzersiz olmalı). |
| companyName | string | Evet (isCompany True ise) | Kurumsal müşteriler için firma adı. |
| firstName | string | Evet (isCompany False ise) | Bireysel müşteriler için ad. |
| lastName | string | Evet (isCompany False ise) | Bireysel müşteriler için soyad. |
| string | Evet | Müşteri/alt müşteri e-posta adresi. | |
| mobile | string | Evet | Cep telefonu numarası. |
| phone | string | Hayır | Sabit telefon numarası. |
| countryCode | string | Evet | Ülke kodu (örn. "TR"). |
| cityCode | string | Hayır | Şehir kodu. |
| districtCode | integer | Hayır | İlçe kodu (opsiyonel). |
| currencyCode | integer | Evet | Para birimi ID’si. |
| erpCode | string | Evet | ERP kodu (benzersiz olmalı). |
| isActive | boolean | Hayır | Aktif/Pasif durumu (true veya false). |
| isCompany | boolean | Evet | Kurumsal ise true, bireysel ise false. |
| address | string | Hayır | Adres bilgisi. |
| tckn | string | Evet (isCompany False ise) | Bireysel müşteriler için TCKN. |
| taxNumber | string | Evet (isCompany True ise) | Kurumsal müşteriler için vergi numarası. |
| taxOffice | string | Evet (isCompany True ise) | Kurumsal müşteriler için vergi dairesi. |
| sendMail | boolean | Hayır | Kayıt e-postası gönderilsin mi (true veya false). |
| addDefaultCurrentAccount | boolean | Hayır | Kayıt sonrası otomatik cari hesap oluşturulsun mu. |
| paymentSetId | string | Hayır | Tanımlı ödeme seti ERP kodu. |
| canUseMobile | boolean | Hayır | Mobil kullanıma izin verilsin mi. |
| customerRepresentativeIds | array | Hayır | Müşteri temsilcisi ID’leri. |
| passportNo | string | Hayır | Yabancı kimlik/passaport numarası. |
| isForeignNational | boolean | Hayır | Yabancı uyruklu mu. |
| title | string | Hayır | Ünvan veya ek bilgi (opsiyonel). |
İstek Örneği
- Header:
Authorization: Bearer {token}, Content-Type: application/json - Body:
JSON
- Başarılı İstek
- Başarılı Yanıt
- Örnek cURL
{
"code": "5",
"phone": "5000000000",
"countryCode": "TR",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"erpCode": "",
"address": "test",
"taxNumber": "",
"taxOffice": "Silifke",
"paymentSetId": "504978bf-bebd-40c5-89aa-b76f3a20341c",
"customerRepresentativeIds": [
"a90b225c-fa6e-418d-8c03-93946a05e355"
],
"isForeignNational": false,
"isCompany": false,//bireysel kurumsal
"companyName": "",
"firstName": "vendor",
"lastName": "test3",
"email": "[email protected]",
"mobile": "5000000000",
"passportNo": "",
"canUseMobile": false,
"sendMail": true,
"isActive": true,
"tckn": "00000000000"
}
{
"status": "success",
"message": "Müşteri başarıyla oluşturuldu.",
"customerId": "1a5a47a9-688e-463d-b3d8-253dde5738ee"
}
curl --location 'https://pgw.netahsilatdemo.com/vendor/customer' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJwd3N2MS5hcGkiLCJlcnB2MS5hcGkiLCJjYXR2MS5hcGkiLCJ2ZW5kb3J2MS5hcGkiXSwiYWN0b3J0Ijoic2VydmljZSIsInJvbGUiOiJzZXJ2aWNlIiwiVW5pcXVlIjoiYTY4OTM1NzYtZTgwYi00OGU0LTllYWItZmExNTIwMTYxYWY5IiwiVGVuYW50SWQiOiI2NzA2ODNjMS0yZmUwLTQ4NDYtODdiMi02Y2JhOWI3OTNhYjIiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL2V4cGlyYXRpb24iOiI2Mzg5NjEyMTczOTU4NjE1MTUiLCJuYmYiOjE3NjAzNTIxMzksImV4cCI6MTc2MDUyNDkzOSwiaWF0IjoxNzYwMzUyMTM5LCJpc3MiOiJzc28uYXBpIiwiYXVkIjoiZWNvenVtLnNzbyJ9.8w1fAcCqq0JrLSS9CkNpu2FTMv6jB0Flob8aKHwVl68' \
--data-raw '{
"code": "501",
"phone": "5000000000",
"countryCode": "TR",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"erpCode": "501",
"address": "test",
"taxNumber": "",
"taxOffice": "Silifke",
"paymentSetId": "504978bf-bebd-40c5-89aa-b76f3a20341c",
"customerRepresentativeIds": [
"a90b225c-fa6e-418d-8c03-93946a05e355"
],
"isForeignNational": false,
"isCompany": false,
"companyName": "",
"firstName": "vendor",
"lastName": "test3",
"email": "[email protected]",
"mobile": "5000000000",
"passportNo": "",
"canUseMobile": false,
"sendMail": true,
"isActive": true,
"tckn": "00000000000"
}'