Müşteriler
Bu servis aracılığı ile Labs platformu üzerinde yeni müşteri oluşturabilir, oluşturulan müşterilerinizin listesini çekebilir, müşteri bilgilerini güncelleyebilir veya silebilirsiniz.
Müşteri servisi iki farklı müşteri tipini destekler. type query parametresi ile hangi müşteri tipini hedeflediğinizi belirtmeniz gerekmektedir.
marketplace_user— Pazaryeri müşterileri (Trendyol, Hepsiburada, Amazon vb. kanallardan gelen müşteriler)customer— Web/panel müşterileri (doğrudan web sitesi veya panel üzerinden oluşturulan müşteriler)
POST, DELETE metodlarında type parametresi zorunludur. GET metodlarında gönderilmezse varsayılan olarak marketplace_user kullanılır.
Müşteri Oluştur
Bu servis aracılığı ile Labs platformunda yeni bir müşteri tanımlaması yapabilirsiniz.
Zorunlu Query Parametreleri
- Name
type* zorunlu- Type
- string
- Description
Müşteri tipi. Geçerli değerler:
customer,marketplace_user
Body Parametreleri
- Name
fullName* zorunlu- Type
- string
- Description
Müşteri adı soyadı (maksimum 60 karakter)
- Name
email- Type
- string
- Description
E-posta adresi
- Name
phoneNumber- Type
- string
- Description
Telefon numarası
- Name
customerSource- Type
- string
- Description
Müşterinin geldiği platform (ör:
VAGA,HEPSIBURADA,TRENDYOL)
- Name
platformCustomerId- Type
- string
- Description
Harici platformdaki müşteri ID bilgisi
- Name
platformAddressRef- Type
- string
- Description
Harici platformdaki adres referans bilgisi
- Name
countryCode- Type
- string
- Description
Ülke kodu (ör:
TR)
- Name
address* zorunlu- Type
- object
- Description
Müşteri adres bilgileri
- Name
address.addressName- Type
- string
- Description
Adres adı (ör:
Ev,İş)
- Name
address.identifier- Type
- object
- Description
Adres kimlik bilgileri (customerName, phoneNumber, identity)
- Name
address.addressDetail* zorunlu- Type
- object
- Description
Adres detayları (countryCode, city, district, town, state, address, postalCode)
- Name
address.company- Type
- object
- Description
Şirket bilgileri (companyName, taxNumber, taxOffice)
Request
curl --location --request POST 'https://api.labsoffice.com/v1/customers?type=marketplace_user' \
--header 'Authorization: Bearer {API_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
"platformCustomerId": "354363SER",
"platformAddressRef": "23423534b7567",
"fullName": "Sercan Yıldız",
"email": "sercan.yildi3z@labsoffice.com",
"phoneNumber": "5555555555",
"customerSource": "VAGA",
"countryCode": "TR",
"address": {
"addressName": "Ev",
"addressType": [
"invoice",
"shipment"
],
"identifier": {
"customerName": "Sercan Yıldız",
"phoneNumber": "5555555555",
"identity": 11111111111
},
"addressDetail": {
"countryCode": "TR",
"city": "Giresun",
"district": "Bulancak",
"town": "İhsaniye Mh Bahçeli Sk No236 d 131 kat 1",
"state": null,
"address": "Bulancak merkez giresun",
"postalCode": null
},
"isDefault": false,
"company": {
"companyName": null,
"taxNumber": null,
"taxOffice": null
}
}
}'
Response
{
"status": "success",
"message": "Müşteri bilgileri başarıyla Eklendi.",
"user": {
"id": 1943028,
"fullName": "Sercan Yıldız",
"email": "sercan.yildi3z@labsoffice.com",
"platformAddressRef": "23423534b7567",
"platformCustomerId": "354363SER",
"phoneNumber": "5555555555",
"customerSource": "VAGA",
"address": {
"id": "01jn1abc2def3ghi4jkl5mno6p",
"user_id": 1943028,
"user_model": "marketplace_user",
"address_name": "Ev-23423534b7567",
"identifier": {
"customer_name": "Sercan Yıldız",
"phone_number": "5555555555",
"identity": null
},
"address_detail": {
"country_code": "TR",
"city": "Giresun",
"district": "Bulancak",
"town": "İhsaniye Mh Bahçeli Sk No236 d 131 kat 1",
"state": "",
"address": "Bulancak merkez giresun",
"postal_code": ""
},
"is_default": true,
"company": {
"company_name": null,
"tax_number": null,
"tax_office": null
},
"updated_at": "2023-12-28T10:31:57.000000Z",
"created_at": "2023-12-28T10:31:57.000000Z"
},
"isNewUser": true,
"isNewAddress": true
}
}
Hata — type parametresi eksik
{
"status": "error",
"error": "client_error",
"message": "type parametresi zorunludur. Geçerli değerler: customer, marketplace_user"
}
Müşteri Listesi
Bu servis aracılığı ile Labs platformunda oluşturduğunuz müşteri listesini çekebilirsiniz.
Query Parametreleri
- Name
type- Type
- string
- Description
Müşteri tipi.
customerveyamarketplace_user. Gönderilmezse varsayılan:marketplace_user
- Name
search- Type
- string
- Description
Ad, e-posta, telefon numarası veya kimlik numarasına göre arama
- Name
sort- Type
- string
- Description
Sıralama yönü.
asc(varsayılan) veyadesc
- Name
limit- Type
- integer
- Description
Sayfa başına kayıt sayısı (varsayılan: 25)
- Name
page- Type
- integer
- Description
Sayfa numarası
Request
curl --location --request GET 'https://api.labsoffice.com/v1/customers?type=marketplace_user&page=1' \
--header 'Authorization: Bearer {API_TOKEN}'
Response — type=marketplace_user
{
"items": [
{
"id": 1858102,
"fullName": "Gülay Türk",
"email": "234456998_7000037723_0@labsoffice.com",
"phoneNumber": "55555555555",
"customerSource": "HEPSIBURADA",
"platformAddressRef": "addr_ref_001",
"platformCustomerId": "hp_001",
"erpCustomerId": null,
"addresses": []
},
{
"id": 1943012,
"fullName": "Sercan Yıldız",
"email": "sercan.yildiz@labsoffice.com",
"phoneNumber": "5555555555",
"customerSource": "VAGA",
"platformAddressRef": "23423534b7567",
"platformCustomerId": "354363SER",
"erpCustomerId": null,
"addresses": [
{
"id": "01jn1abc2def3ghi4jkl5mno6p",
"user_id": 1943012,
"user_model": "marketplace_user",
"address_name": "Ev-23423534b7567",
"identifier": {
"customer_name": "Sercan Yıldız",
"phone_number": "5555555555",
"identity": null
},
"address_detail": {
"country_code": "TR",
"city": "Giresun",
"district": "Bulancak",
"town": "İhsaniye Mh Bahçeli Sk No236 d 131 kat 1",
"state": "",
"address": "Bulancak merkez giresun",
"postal_code": ""
},
"is_default": true,
"company": {
"company_name": null,
"tax_number": null,
"tax_office": null
},
"updated_at": "2023-12-28T10:27:03.000000Z",
"created_at": "2023-12-28T10:27:03.000000Z"
}
]
}
],
"totalItems": 2,
"totalPage": 1,
"currentPage": 1,
"limit": 25
}
Response — type=customer
{
"items": [
{
"id": 1,
"fullName": "Ahmet Yılmaz",
"email": "ahmet@example.com",
"phoneNumber": "5321234567",
"customerSource": "WEB",
"erpCustomerId": "ERP001",
"addresses": [
{
"id": "01jn2xyz9abc8def7ghi6jkl5m",
"user_id": 1,
"user_model": "customer",
"address_name": "Ev",
"identifier": {
"customer_name": "Ahmet Yılmaz",
"phone_number": "5321234567",
"identity": "12345678901"
},
"address_detail": {
"country_code": "TR",
"city": "İstanbul",
"district": "Kadıköy",
"town": "Caferağa",
"state": null,
"address": "Moda Cad. No:15 D:3",
"postal_code": "34710"
},
"is_default": true,
"company": {
"company_name": null,
"tax_number": null,
"tax_office": null
},
"updated_at": "2024-01-15T09:12:00.000000Z",
"created_at": "2024-01-15T09:12:00.000000Z"
}
]
}
],
"totalItems": 1,
"totalPage": 1,
"currentPage": 1,
"limit": 25
}
Müşteri Görüntüle
Bu servis aracılığı ile Labs platformunda kayıtlı müşteriye ait bilgileri listeleyebilirsiniz.
Query Parametreleri
- Name
type- Type
- string
- Description
Müşteri tipi.
customerveyamarketplace_user. Gönderilmezse varsayılan:marketplace_user
Request
curl --location --request GET 'https://api.labsoffice.com/v1/customers/1943028?type=marketplace_user' \
--header 'Authorization: Bearer {API_TOKEN}'
Response
[
{
"id": 1943028,
"fullName": "Sercan Yıldız",
"email": "sercan.yildi3z@labsoffice.com",
"phoneNumber": "5555555555",
"customerSource": "VAGA",
"platformAddressRef": "23423534b7567",
"platformCustomerId": "354363SER",
"erpCustomerId": null,
"addresses": [
{
"id": "01jn1abc2def3ghi4jkl5mno6p",
"user_id": 1943028,
"user_model": "marketplace_user",
"address_name": "Ev-23423534b7567",
"identifier": {
"customer_name": "Sercan Yıldız",
"phone_number": "5555555555",
"identity": null
},
"address_detail": {
"country_code": "TR",
"city": "Giresun",
"district": "Bulancak",
"town": "İhsaniye Mh Bahçeli Sk No236 d 131 kat 1",
"state": "",
"address": "Bulancak merkez giresun",
"postal_code": ""
},
"is_default": true,
"company": {
"company_name": null,
"tax_number": null,
"tax_office": null
},
"updated_at": "2023-12-28T10:31:57.000000Z",
"created_at": "2023-12-28T10:31:57.000000Z"
}
]
}
]
Müşteri Güncelle
Bu servis aracılığı ile Labs platformundaki mevcut müşteri bilgilerinizi güncelleyebilirsiniz.
Metod yapım aşamasında.
Müşteri Sil
Bu servis aracılığı ile Labs platformundaki mevcut müşteri bilgilerinizi silebilirsiniz.
Zorunlu Query Parametreleri
- Name
type* zorunlu- Type
- string
- Description
Müşteri tipi. Geçerli değerler:
customer,marketplace_user
Request
curl --location --request DELETE 'https://api.labsoffice.com/v1/customers/2021?type=marketplace_user' \
--header 'Authorization: Bearer {API_TOKEN}' \
--header 'Content-Type: application/json'
Response
{
"status": "success",
"message": "Müşteri başarılı bir şekilde silindi"
}