Shop It Docs
Developer Resourcesconfig

Config API

Shipping fee and social links configuration endpoints

Config API

Social links are stored as a singleton config row and exposed through:

  • admin write/read endpoint for backoffice management
  • public read endpoint for website/mobile footer/header links

Endpoints

GET /api/admin/config/social-links

  • Auth: Bearer token
  • Guards: JwtAuthGuard, RoleGuard
  • Permission: Settings_READ

Response payload:

{
  "message": "Social links fetched successfully",
  "data": {
    "facebookUrl": "https://www.facebook.com/nepathangka",
    "instagramUrl": "https://www.instagram.com/nepathangka",
    "whatsappUrl": "https://wa.me/9779800000000",
    "updatedAt": "2026-04-26T12:00:00.000Z"
  }
}

POST /api/admin/config/social-links

  • Auth: Bearer token
  • Guards: JwtAuthGuard, RoleGuard
  • Permission: Settings_UPDATE

Request body:

{
  "facebookUrl": "https://www.facebook.com/nepathangka",
  "instagramUrl": "https://www.instagram.com/nepathangka",
  "whatsappUrl": "https://wa.me/9779800000000"
}

Notes:

  • endpoint creates singleton row with id = 1
  • if row already exists, returns conflict (use PATCH endpoint to edit)

PATCH /api/admin/config/social-links

  • Auth: Bearer token
  • Guards: JwtAuthGuard, RoleGuard
  • Permission: Settings_UPDATE

Request body:

{
  "instagramUrl": "https://www.instagram.com/nepathangka"
}

Notes:

  • partial updates allowed; only provided fields are changed
  • if row does not exist yet, returns not found (create first using POST)

GET /api/config/social-links

  • Auth: public

Response behavior:

  • returns configured values if present
  • returns null values when not configured yet

5. Mobile-Composed Public Route

GET /api/mobile/config/social-links

This is the same public customer controller mounted under /mobile via MobileModule composition routing.

Schema

Table: social_links

  • id serial primary key with check id = 1 (singleton)
  • facebook_url varchar(512) nullable
  • instagram_url varchar(512) nullable
  • whatsapp_url varchar(512) nullable
  • created_at timestamptz not null default now()
  • updated_at timestamptz not null default now()