Back

    Buyamia Directory API

    v1.0

    Create Business

    POST
    /v1/businesses

    Create a new business listing in the directory.

    businesses.write

    Requires the businesses.write permission scope on your API key.

    Request Body

    FieldTypeRequiredDescription
    namestringYesBusiness name
    description_enstringYes*Description in English. *At least one of description_en or description_id is required.
    description_idstringYes*Description in Indonesian. *At least one is required.
    category_iduuidNoPrimary business category ID
    region_iduuidNoRegion location ID
    country_iduuidNoCountry ID
    addressstringNoPhysical address
    phonestringNoPhone number
    emailstringNoContact email address
    websitestringNoWebsite URL
    whatsapp_numberstringNoWhatsApp contact number
    can_fulfill_ordersbooleanNoWhether the business can fulfill procurement orders (default: false)
    visibilitystringNoVisibility level: public, internal, or draft (default: public)

    Behavior

    • Auto-generates a URL-friendly slug from the business name
    • If the slug already exists, appends a unique suffix
    • Sets data_source to "api" to track the origin
    • Fires the business.created webhook event

    Example Request

    cURLbash
    curl -X POST "https://rjpxllsycikfabazvkdh.supabase.co/functions/v1/directory-api/v1/businesses" \
      -H "X-API-Key: your-key" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "PT Furniture Jaya",
        "description_en": "Premium office furniture manufacturer in Bali",
        "category_id": "cat-uuid-here",
        "region_id": "region-uuid-here",
        "address": "Jl. Raya Denpasar No. 42",
        "phone": "+62812345678",
        "email": "info@furniturejaya.com",
        "can_fulfill_orders": true
      }'

    Response (201 Created)

    {
      "data": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "PT Furniture Jaya",
        "slug": "pt-furniture-jaya",
        "description_en": "Premium office furniture manufacturer in Bali",
        "data_source": "api",
        "visibility": "public",
        "can_fulfill_orders": true,
        "created_at": "2026-03-15T08:00:00Z",
        "updated_at": "2026-03-15T08:00:00Z"
      }
    }
    Last updated on March 15, 2026