Skip to main content

API Documentation

Interactive API Documentation

When running in DEVELOPMENT mode, access interactive API documentation at:

http://localhost:3610/api/kitab-suci

This uses Scalar API Reference with the OpenAPI 3.0 specification defined in docs/openapi.json.

Authentication Methods

The API supports two authentication methods:

1. Bearer Token (JWT)

Authorization: Bearer <jwt_token>

2. Basic Auth

Authorization: Basic <base64(username:password)>

Common API Endpoints

Store Management

GET  /verify/store/exist           # Check if store exists
GET  /store/activate                # Activate store
POST /store/edit                    # Update store info
POST /store/activity/edit           # Update store activity hours
POST /store/schedule/edit           # Update store schedule
GET  /store/check-online-status     # Check online status

Product Management

POST /product/add                   # Add new product
POST /product/edit                  # Edit product
POST /product/delete                # Delete product
POST /product/list                  # List products
GET  /product/detail/:id            # Get product details

Cart Operations

GET  /cart/list                     # Get cart items
POST /cart/add                      # Add item to cart
POST /cart/update                   # Update cart item
POST /cart/delete                   # Remove from cart

Checkout & Orders

POST /transaction/review-order      # Review order before checkout
POST /transaction/checkout          # Create order
GET  /transaction/order/list        # List orders
GET  /transaction/order/:id         # Get order details
POST /transaction/order/confirm-shipment  # Confirm shipment
GET  /transaction/order/monitor-delivery  # Track delivery

Payments

POST /virtual-account/create        # Create virtual account
GET  /virtual-account/list          # List VAs
POST /webhook/xendit                # Xendit payment webhook
GET  /balance/mutation              # Balance history

Affiliate

POST /affiliate/register            # Register as affiliate
GET  /affiliate/links               # Get affiliate links
GET  /affiliate/dashboard/stats     # Affiliate statistics
GET  /affiliate/dashboard/referral-stats  # Referral stats
GET  /affiliate/commissions         # Commission history

Reviews

POST /review/add                    # Add product review
GET  /review/list                   # List reviews
POST /review/reply                  # Reply to review

Chat

GET  /chat/rooms                    # List chat rooms
GET  /chat/messages/:roomId         # Get messages
POST /chat/send                     # Send message (via WebSocket)

Response Format

Success Response

{
  "success": true,
  "message": "Operation completed successfully",
  "data": {
    // Response data
  }
}

Error Response

{
  "success": false,
  "message": "Error message",
  "errors": [
    {
      "field": "fieldName",
      "message": "Validation error message"
    }
  ]
}