# GET /b2c/v1/config

<div class="api-docs" id="bkmrk-">  <div class="endpoint-section">  
</div></div>## B2C Frontend Configuration

این اندپوینت مخصوص وب‌سایت‌های فروش آنلاین (White-label B2C) است.   
سیستم با بررسی هدر `Domain`، آدرس سایت مشتری را در ستون `b2c_domains` جستجو می‌کند و تنظیمات ظاهری، بنرها، مجوزهای نماد اعتماد و پیکربندی ماژول‌های فروش را برمی‌گرداند.

<div class="api-docs" id="bkmrk--1"><div class="endpoint-section">  
</div>  
---

  </div># Get B2C Config

<div class="api-docs" id="bkmrk-url%3A-%2Fb2c%2Fv1%2Fconfig-"><div class="endpoint-info"><div>**URL:** `/b2c/v1/config`</div><div>**Method:** <span class="method-get">GET</span></div><div>**Controller:** V1BaseController@config</div><div>**Auth:** Public (Public Access)</div></div></div>### Headers (الزامی)

<div class="api-docs" id="bkmrk-header-name-descript"><table class="schema-table" dir="rtl"><thead><tr><th>Header Name</th><th>Description</th></tr></thead><tbody><tr><td dir="ltr">Domain</td><td>دامنه سایت فروش B2C (مثلاً `booking.agency.com`).   
<small>سیستم `www.` و پورت را حذف کرده و در `offices.b2c_domains` جستجو می‌کند.</small></td></tr></tbody></table>

  </div>### Response Structure

<div class="api-docs" id="bkmrk-key-block-descriptio"><table class="schema-table" dir="rtl"><thead><tr><th>Key Block</th><th>Description</th></tr></thead><tbody><tr><td dir="ltr">erp\_domain</td><td>دامنه اصلی پنل مدیریت (ERP) که کارمندان از آن استفاده می‌کنند (جهت ارجاع لینک‌های ادمین).</td></tr><tr><td dir="ltr">communicational.certificates</td><td>لیست مجوزها (نماد اعتماد، ساماندهی و ...).   
سیستم به صورت خودکار تگ `<a><img .../></a>` را برای نمایش تصویر مجوز تولید می‌کند.</td></tr><tr><td dir="ltr">design.advertisement</td><td>لیست بنرهای تبلیغاتی فعال (Status 1 or 3) برای نمایش در اسلایدر یا بخش‌های تبلیغاتی سایت.</td></tr><tr><td dir="ltr">hub</td><td><span style="color: #007bff; font-weight: bold;">تنظیمات اختصاصی فروشگاه (Hub):</span>- `theme/palette`: چیدمان و رنگ‌بندی قالب سایت.
- `modules`: ماژول‌های فعال (پرواز، هتل، بیمه و ...).
- `features`: ویژگی‌های خاص فعال شده برای این مشتری.
- `authentication`: تنظیمات نحوه لاگین/ثبت‌نام کاربران (OTP، ایمیل و ...).

</td></tr></tbody></table>

</div>### Example Response

```json
{
    "office_id": 1025,
    "title": { "fa": "سفر آنلاین", "en": "Safar Online" },
    "brand": { "fa": "سفر24", "en": "Safar24" },
    "short_domain": "s24",
    "erp_domain": "admin.safar24.ir",
    "communicational": {
        "phone": "02199999999",
        "whatsapp": "989120000000",
        "social_media": { "instagram": "safar24_inst" },
        "certificates": [
            {
                "title": "Enamad",
                "content": "<a href="https://docs.airplus.app/..."><img src="https://storage.../enamad.png"></img></a>"
            }
        ]
    },
    "design": {
        "logo": "https://storage.../logo_b2c.png",
        "theme": "minimal-light-1",
        "advertisement": [
            {
                "id": 55,
                "title": "تور نوروزی استانبول",
                "image": "https://storage.../banner1.jpg",
                "link": "/tours/istanbul"
            }
        ]
    },
    "hub": {
        "services": ["flight", "hotel"],
        "theme": "minimal",
        "palette": "1",
        "slogan": "سفری خاطره‌انگیز با ما",
        "modules": {
            "flight_domestic": true,
            "train": false
        },
        "authentication": "otp_mobile"
    },
    "cache": {
        "update": "Tue, 09 Dec 2025 10:30:00 +0330"
    }
}
```

<div class="api-docs" id="bkmrk--2">---

  </div>### Technical Logic

<div class="api-docs" id="bkmrk-request-header%3A-doma"><div class="flowchart"><div class="flow-item">Request Header: Domain</div><div class="flow-arrow">↓</div><div class="flow-item-process">**Parse Domain**  
Normalize URL (Remove www)</div><div class="flow-arrow">↓</div><div class="flow-item-decision">Search DB   
<small>WHERE json\_contains(b2c\_domains, $domain)</small></div><div class="flow-arrow">↓ (Found)</div><div class="flow-item-process" style="background-color: #e3f2fd;">**Fetch Aggregated Data**  
1. `advertisement` (Active banners)  
2. `certificates` (Trust logos)  
3. `hub_config` (Site settings)</div><div class="flow-arrow">↓</div><div class="flow-item-success">Return B2C Config JSON</div></div></div>