VoucherHub API
REST API documentation for VoucherHub. The API provides authentication, product management, transactions, and payment integration.
Base URL
https://be-voucherhub.andreka.dev/api
Authentication
/auth/login
Authenticate a user and receive an access token.
Request
{
"email": "admin@example.com",
"password": "password123"
}
Response
{
"success": true,
"message": "Login successful",
"data": {
"access_token": "eyJhbGciOi...",
"token_type": "bearer"
}
}
/auth/register
Create a new user account.
Categories
/category
Get all available categories.
/category/{id}
Get category details.
/category
Admin
Create a new category.
Products
/products
Get all available voucher products.
/products/{id}
Get product details including variants.
Transactions
/transactions
Create a transaction. Guest checkout is supported.
Request
{
"product_id": 1,
"variant_id": 1,
"quantity": 1,
"buyer_email": "buyer@example.com",
"buyer_phone": "081234567890",
"customer_data": {
"user_id": "12345678"
}
}
Payments
/midtrans/notification
Endpoint used by Midtrans to send payment notifications.