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.


POST/v1/customers

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

POST
/v1/customers?type=marketplace_user
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"
}

GET/v1/customers

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. customer veya marketplace_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) veya desc

  • Name
    limit
    Type
    integer
    Description

    Sayfa başına kayıt sayısı (varsayılan: 25)

  • Name
    page
    Type
    integer
    Description

    Sayfa numarası

Request

GET
/v1/customers?type=marketplace_user
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
}

GET/v1/customers/{id}

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. customer veya marketplace_user. Gönderilmezse varsayılan: marketplace_user

Request

GET
/v1/customers/{id}?type=marketplace_user
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"
            }
        ]
    }
]

PUT/v1/customers/{id}

Müşteri Güncelle

Bu servis aracılığı ile Labs platformundaki mevcut müşteri bilgilerinizi güncelleyebilirsiniz.

Metod yapım aşamasında.


DELETE/v1/customers/{id}

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

DELETE
/v1/customers/{id}?type=marketplace_user
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"
}